()
| 19 | pub const AUTO_LOAD_FILE_SETTING: &'static str = "analysis.svd.autoLoadFile"; |
| 20 | |
| 21 | pub fn register() { |
| 22 | let bn_settings = Settings::new(); |
| 23 | |
| 24 | let add_bitfields_props = json!({ |
| 25 | "title" : "Add Bitfields", |
| 26 | "type" : "boolean", |
| 27 | "default" : Self::ADD_BITFIELDS_DEFAULT, |
| 28 | "description" : "Whether to add bitfields. Bitfields are not supported by Binary Ninja, so this is a workaround using unions.", |
| 29 | }); |
| 30 | bn_settings |
| 31 | .register_setting_json(Self::ADD_BITFIELDS_SETTING, add_bitfields_props.to_string()); |
| 32 | |
| 33 | let add_comments_props = json!({ |
| 34 | "title" : "Add Comments", |
| 35 | "type" : "boolean", |
| 36 | "default" : Self::ADD_COMMENTS_DEFAULT, |
| 37 | "description" : "Whether to add comments. If you see comment placement is off, try disabling this.", |
| 38 | }); |
| 39 | bn_settings |
| 40 | .register_setting_json(Self::ADD_COMMENTS_SETTING, add_comments_props.to_string()); |
| 41 | |
| 42 | let file_props = json!({ |
| 43 | "title" : "SVD File", |
| 44 | "type" : "string", |
| 45 | "default" : Self::AUTO_LOAD_FILE_DEFAULT, |
| 46 | "description" : "The SVD File to automatically load when opening the view.", |
| 47 | "uiSelectionAction" : "file" |
| 48 | }); |
| 49 | bn_settings.register_setting_json(Self::AUTO_LOAD_FILE_SETTING, file_props.to_string()); |
| 50 | } |
| 51 | |
| 52 | pub fn from_view_settings(view: &BinaryView) -> Self { |
| 53 | let mut load_settings = LoadSettings::default(); |
no test coverage detected