The tuple is (DebugInfoParserName, address, type)
(
&self,
name: S,
)
| 620 | |
| 621 | // The tuple is (DebugInfoParserName, address, type) |
| 622 | pub fn get_data_variables_by_name<S: BnStrCompatible>( |
| 623 | &self, |
| 624 | name: S, |
| 625 | ) -> Vec<(String, u64, Ref<Type>)> { |
| 626 | let name = name.into_bytes_with_nul(); |
| 627 | |
| 628 | let mut count: usize = 0; |
| 629 | let raw_variables_and_names = unsafe { |
| 630 | BNGetDebugDataVariablesByName(self.handle, name.as_ref().as_ptr() as *mut _, &mut count) |
| 631 | }; |
| 632 | |
| 633 | let variables_and_names: &[*mut BNDataVariableAndName] = |
| 634 | unsafe { std::slice::from_raw_parts(raw_variables_and_names as *mut _, count) }; |
| 635 | |
| 636 | let result = variables_and_names |
| 637 | .iter() |
| 638 | .take(count) |
| 639 | .map(|&variable_and_name| unsafe { |
| 640 | ( |
| 641 | raw_to_string((*variable_and_name).name).unwrap(), |
| 642 | (*variable_and_name).address, |
| 643 | Type::from_raw((*variable_and_name).type_).to_owned(), |
| 644 | ) |
| 645 | }) |
| 646 | .collect(); |
| 647 | |
| 648 | unsafe { BNFreeDataVariablesAndName(raw_variables_and_names, count) }; |
| 649 | result |
| 650 | } |
| 651 | |
| 652 | /// The tuple is (DebugInfoParserName, TypeName, type) |
| 653 | pub fn get_data_variables_by_address(&self, address: u64) -> Vec<(String, String, Ref<Type>)> { |
nothing calls this directly
no test coverage detected