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<S: BnStrCompatible>(
&self,
parser_name: S,
) -> Vec<NameAndType>
pub fn types_by_name<S: BnStrCompatible>( &self, parser_name: S, ) -> Vec<NameAndType>
Returns all types within the parser
pub fn types(&self) -> Vec<NameAndType>
sourcepub fn functions_by_name<S: BnStrCompatible>(
&self,
parser_name: S,
) -> Vec<DebugFunctionInfo>
pub fn functions_by_name<S: BnStrCompatible>( &self, parser_name: S, ) -> Vec<DebugFunctionInfo>
Returns all functions within the parser
pub fn functions(&self) -> Vec<DebugFunctionInfo>
sourcepub fn data_variables_by_name<S: BnStrCompatible>(
&self,
parser_name: S,
) -> Vec<NamedDataVariableWithType>
pub fn data_variables_by_name<S: BnStrCompatible>( &self, parser_name: S, ) -> Vec<NamedDataVariableWithType>
Returns all data variables within the parser
pub fn data_variables(&self) -> Vec<NamedDataVariableWithType>
pub fn type_by_name<S: BnStrCompatible>( &self, parser_name: S, name: S, ) -> Option<Ref<Type>>
pub fn get_data_variable_by_name<S: BnStrCompatible>( &self, parser_name: S, name: S, ) -> Option<NamedDataVariableWithType>
pub fn get_data_variable_by_address<S: BnStrCompatible>( &self, parser_name: S, address: u64, ) -> Option<NamedDataVariableWithType>
sourcepub fn get_types_by_name<S: BnStrCompatible>(&self, name: S) -> Vec<NameAndType>
pub fn get_types_by_name<S: BnStrCompatible>(&self, name: S) -> Vec<NameAndType>
Returns a list of NameAndType
where the name
is the parser the type originates from.
pub fn get_data_variables_by_name<S: BnStrCompatible>( &self, name: S, ) -> 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<S: BnStrCompatible>(&self, parser_name: S) -> bool
pub fn remove_parser_types<S: BnStrCompatible>(&self, parser_name: S) -> bool
pub fn remove_parser_functions<S: BnStrCompatible>( &self, parser_name: S, ) -> bool
pub fn remove_parser_data_variables<S: BnStrCompatible>( &self, parser_name: S, ) -> bool
pub fn remove_type_by_name<S: BnStrCompatible>( &self, parser_name: S, name: S, ) -> bool
pub fn remove_function_by_index<S: BnStrCompatible>( &self, parser_name: S, index: usize, ) -> bool
pub fn remove_data_variable_by_address<S: BnStrCompatible>( &self, parser_name: S, address: u64, ) -> bool
sourcepub fn add_type<S: BnStrCompatible>(
&self,
name: S,
new_type: &Type,
components: &[&str],
) -> bool
pub fn add_type<S: BnStrCompatible>( &self, name: S, 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<S: BnStrCompatible>(
&self,
address: u64,
t: &Type,
name: Option<S>,
components: &[&str],
) -> bool
pub fn add_data_variable<S: BnStrCompatible>( &self, address: u64, t: &Type, name: Option<S>, components: &[&str], ) -> bool
Adds a data variable scoped under the current parser’s name to the debug info