pub struct DebugInfo { /* private fields */ }Expand description
Provides an interface to both provide and query debug info. The DebugInfo object is used internally by the binary view to which it is applied to determine the attributes of functions, types, and variables that would otherwise be costly to deduce.
DebugInfo objects themselves are independent of binary views; their data can be sourced from any arbitrary binary views and be applied to any other arbitrary binary view. A DebugInfo object can also contain debug info from multiple DebugInfoParsers. This makes it possible to gather debug info that may be distributed across several different formats and files.
DebugInfo cannot be instantiated by the user, instead get it from either the binary view (see binaryninja::binaryview::BinaryView::debug_info)
or a debug-info parser (see binaryninja::debuginfo::DebugInfoParser::parse_debug_info).
Please note that calling one of add_* functions will not work outside of a debuginfo plugin.
Implementations§
Source§impl DebugInfo
impl DebugInfo
Sourcepub fn types_by_name(&self, parser_name: &str) -> Vec<NameAndType>
pub fn types_by_name(&self, parser_name: &str) -> Vec<NameAndType>
Returns all types within the parser
pub fn types(&self) -> Vec<NameAndType>
Sourcepub fn functions_by_name(&self, parser_name: &str) -> Vec<DebugFunctionInfo>
pub fn functions_by_name(&self, parser_name: &str) -> Vec<DebugFunctionInfo>
Returns all functions within the parser
pub fn functions(&self) -> Vec<DebugFunctionInfo>
Sourcepub fn data_variables_by_name(
&self,
parser_name: &str,
) -> Vec<NamedDataVariableWithType>
pub fn data_variables_by_name( &self, parser_name: &str, ) -> Vec<NamedDataVariableWithType>
Returns all data variables within the parser
pub fn data_variables(&self) -> Vec<NamedDataVariableWithType>
pub fn type_by_name(&self, parser_name: &str, name: &str) -> Option<Ref<Type>>
pub fn get_data_variable_by_name( &self, parser_name: &str, name: &str, ) -> Option<NamedDataVariableWithType>
pub fn get_data_variable_by_address( &self, parser_name: &str, address: u64, ) -> Option<NamedDataVariableWithType>
Sourcepub fn get_types_by_name(&self, name: &str) -> Vec<NameAndType>
pub fn get_types_by_name(&self, name: &str) -> Vec<NameAndType>
Returns a list of NameAndType where the name is the parser the type originates from.
pub fn get_data_variables_by_name( &self, name: &str, ) -> Vec<(String, u64, Ref<Type>)>
Sourcepub fn get_data_variables_by_address(
&self,
address: u64,
) -> Vec<(String, String, Ref<Type>)>
pub fn get_data_variables_by_address( &self, address: u64, ) -> Vec<(String, String, Ref<Type>)>
The tuple is (DebugInfoParserName, TypeName, type)
pub fn remove_parser_info(&self, parser_name: &str) -> bool
pub fn remove_parser_types(&self, parser_name: &str) -> bool
pub fn remove_parser_functions(&self, parser_name: &str) -> bool
pub fn remove_parser_data_variables(&self, parser_name: &str) -> bool
pub fn remove_type_by_name(&self, parser_name: &str, name: &str) -> bool
pub fn remove_function_by_index(&self, parser_name: &str, index: usize) -> bool
pub fn remove_data_variable_by_address( &self, parser_name: &str, address: u64, ) -> bool
Sourcepub fn add_type(&self, name: &str, new_type: &Type, components: &[&str]) -> bool
pub fn add_type(&self, name: &str, new_type: &Type, components: &[&str]) -> bool
Adds a type scoped under the current parser’s name to the debug info
Sourcepub fn add_function(&self, new_func: &DebugFunctionInfo) -> bool
pub fn add_function(&self, new_func: &DebugFunctionInfo) -> bool
Adds a function scoped under the current parser’s name to the debug info
Sourcepub fn add_data_variable(
&self,
address: u64,
t: &Type,
name: Option<&str>,
components: &[&str],
) -> bool
pub fn add_data_variable( &self, address: u64, t: &Type, name: Option<&str>, components: &[&str], ) -> bool
Adds a data variable scoped under the current parser’s name to the debug info
pub fn add_data_variable_info(&self, var: NamedDataVariableWithType) -> bool
Trait Implementations§
Source§impl ToOwned for DebugInfo
impl ToOwned for DebugInfo
impl Eq for DebugInfo
impl StructuralPartialEq for DebugInfo
Auto Trait Implementations§
impl Freeze for DebugInfo
impl RefUnwindSafe for DebugInfo
impl !Send for DebugInfo
impl !Sync for DebugInfo
impl Unpin for DebugInfo
impl UnwindSafe for DebugInfo
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more