diff options
| author | Mason Reed <mason@vector35.com> | 2026-03-28 15:07:27 -0700 |
|---|---|---|
| committer | Mason Reed <35282038+emesare@users.noreply.github.com> | 2026-03-29 21:04:13 -0700 |
| commit | 7d672a27f258a9e0057a8aa91938b735276d2897 (patch) | |
| tree | 86344c24f2ceaa8d3d9fbbb50a20fa4c94c59b52 /plugins | |
| parent | a8136a2e13c283171ae5ccca7ce8b02a83e6cdb1 (diff) | |
[SVD Import] Remove "add bitfield" setting
We unconditionally add them now that bitfields are represented correctly in the type system
Diffstat (limited to 'plugins')
| -rw-r--r-- | plugins/svd/src/lib.rs | 23 | ||||
| -rw-r--r-- | plugins/svd/src/settings.rs | 19 |
2 files changed, 0 insertions, 42 deletions
diff --git a/plugins/svd/src/lib.rs b/plugins/svd/src/lib.rs index 6ada01f9..1eb84a5f 100644 --- a/plugins/svd/src/lib.rs +++ b/plugins/svd/src/lib.rs @@ -51,27 +51,6 @@ impl AddCommentsField { } } -pub struct AddBitfieldsField; - -impl AddBitfieldsField { - pub fn field(default: bool) -> FormInputField { - FormInputField::Checkbox { - prompt: "Add Bitfields".to_string(), - default: Some(default), - value: false, - } - } - - pub fn from_form(form: &Form) -> Option<bool> { - let field = form.get_field_with_name("Add Bitfields")?; - let field_value = field.try_value_int()?; - match field_value { - 1 => Some(true), - _ => Some(false), - } - } -} - pub struct AddMemoryRegionsField; impl AddMemoryRegionsField { @@ -101,7 +80,6 @@ impl Command for LoadSVDFile { let mut load_settings = LoadSettings::from_view_settings(view); form.add_field(LoadFileField::field()); form.add_field(AddCommentsField::field(load_settings.add_comments)); - form.add_field(AddBitfieldsField::field(load_settings.add_bitfields)); form.add_field(AddMemoryRegionsField::field( load_settings.add_backing_regions, )); @@ -112,7 +90,6 @@ impl Command for LoadSVDFile { return; }; load_settings.add_comments = AddCommentsField::from_form(&form).unwrap_or(true); - load_settings.add_bitfields = AddBitfieldsField::from_form(&form).unwrap_or(true); load_settings.add_backing_regions = AddMemoryRegionsField::from_form(&form).unwrap_or(true); let file_content = match std::fs::read_to_string(&file_path) { diff --git a/plugins/svd/src/settings.rs b/plugins/svd/src/settings.rs index fb2f680c..7f57f0bf 100644 --- a/plugins/svd/src/settings.rs +++ b/plugins/svd/src/settings.rs @@ -6,7 +6,6 @@ use std::path::PathBuf; #[derive(Debug, Clone)] pub struct LoadSettings { pub add_backing_regions: bool, - pub add_bitfields: bool, pub add_comments: bool, pub auto_load_file: Option<PathBuf>, } @@ -14,8 +13,6 @@ pub struct LoadSettings { impl LoadSettings { pub const ADD_BACKING_REGIONS_DEFAULT: bool = true; pub const ADD_BACKING_REGIONS_SETTING: &'static str = "analysis.svd.addBackingRegions"; - pub const ADD_BITFIELDS_DEFAULT: bool = true; - pub const ADD_BITFIELDS_SETTING: &'static str = "analysis.svd.addBitfields"; pub const ADD_COMMENTS_DEFAULT: bool = true; pub const ADD_COMMENTS_SETTING: &'static str = "analysis.svd.addComments"; pub const AUTO_LOAD_FILE_DEFAULT: &'static str = ""; @@ -35,17 +32,6 @@ impl LoadSettings { &add_backing_region_props.to_string(), ); - let add_bitfields_props = json!({ - "title" : "Add Bitfields", - "type" : "boolean", - "default" : Self::ADD_BITFIELDS_DEFAULT, - "description" : "Whether to add bitfields. Bitfields are not supported by Binary Ninja, so this is a workaround using unions.", - }); - bn_settings.register_setting_json( - Self::ADD_BITFIELDS_SETTING, - &add_bitfields_props.to_string(), - ); - let add_comments_props = json!({ "title" : "Add Comments", "type" : "boolean", @@ -73,10 +59,6 @@ impl LoadSettings { load_settings.add_backing_regions = settings.get_bool_with_opts(Self::ADD_BACKING_REGIONS_SETTING, &mut query_opts); } - if settings.contains(Self::ADD_BITFIELDS_SETTING) { - load_settings.add_bitfields = - settings.get_bool_with_opts(Self::ADD_BITFIELDS_SETTING, &mut query_opts); - } if settings.contains(Self::ADD_COMMENTS_SETTING) { load_settings.add_comments = settings.get_bool_with_opts(Self::ADD_COMMENTS_SETTING, &mut query_opts); @@ -97,7 +79,6 @@ impl Default for LoadSettings { fn default() -> Self { Self { add_backing_regions: Self::ADD_BACKING_REGIONS_DEFAULT, - add_bitfields: Self::ADD_BITFIELDS_DEFAULT, add_comments: Self::ADD_COMMENTS_DEFAULT, auto_load_file: None, } |
