diff --git a/plugins/svd/src/mapper.rs b/plugins/svd/src/mapper.rs index 0a4764812a..2d51161542 100644 --- a/plugins/svd/src/mapper.rs +++ b/plugins/svd/src/mapper.rs @@ -174,7 +174,7 @@ impl DeviceMapper { &data_memory, Some(memory_info.segment_flags), ); - + if !added_memory { log::error!( "Failed to add memory for peripheral block! {} @ 0x{:x}", @@ -183,7 +183,7 @@ impl DeviceMapper { ); } } - + view.add_segment(memory_info.segment); view.add_section(memory_info.section); diff --git a/plugins/svd/src/settings.rs b/plugins/svd/src/settings.rs index 9b4a9e07cb..9621da6415 100644 --- a/plugins/svd/src/settings.rs +++ b/plugins/svd/src/settings.rs @@ -30,9 +30,11 @@ impl LoadSettings { "default" : Self::ADD_BACKING_REGIONS_DEFAULT, "description" : "Whether to add backing regions. Backing regions allow you to write to the underlying memory of a view, but will take up space in the BNDB.", }); - bn_settings - .register_setting_json(Self::ADD_BACKING_REGIONS_SETTING, add_backing_region_props.to_string()); - + bn_settings.register_setting_json( + Self::ADD_BACKING_REGIONS_SETTING, + add_backing_region_props.to_string(), + ); + let add_bitfields_props = json!({ "title" : "Add Bitfields", "type" : "boolean", diff --git a/rust/src/function.rs b/rust/src/function.rs index d8b5c19906..7990f109a9 100644 --- a/rust/src/function.rs +++ b/rust/src/function.rs @@ -467,6 +467,15 @@ impl Function { } } + pub fn variable_type(&self, var: &Variable) -> Option>> { + let raw_var = BNVariable::from(var); + let result = unsafe { BNGetVariableType(self.handle, &raw_var) }; + match result.type_.is_null() { + false => Some(Conf::>::from_owned_raw(result)), + true => None, + } + } + pub fn high_level_il(&self, full_ast: bool) -> Result, ()> { unsafe { let hlil_ptr = BNGetFunctionHighLevelIL(self.handle);