Struct binaryninja::debuginfo::DebugInfo
source · 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<Ref<NameAndType>>
pub fn types_by_name<S: BnStrCompatible>( &self, parser_name: S ) -> Vec<Ref<NameAndType>>
Returns a generator of all types provided by a named DebugInfoParser
sourcepub fn types(&self) -> Vec<Ref<NameAndType>>
pub fn types(&self) -> Vec<Ref<NameAndType>>
A generator of all types provided by DebugInfoParsers
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 a generator of all functions provided by a named DebugInfoParser
sourcepub fn functions(&self) -> Vec<DebugFunctionInfo>
pub fn functions(&self) -> Vec<DebugFunctionInfo>
A generator of all functions provided by DebugInfoParsers
sourcepub fn data_variables_by_name<S: BnStrCompatible>(
&self,
parser_name: S
) -> Vec<DataVariableAndName<String>>
pub fn data_variables_by_name<S: BnStrCompatible>( &self, parser_name: S ) -> Vec<DataVariableAndName<String>>
Returns a generator of all data variables provided by a named DebugInfoParser
sourcepub fn data_variables(&self) -> Vec<DataVariableAndName<String>>
pub fn data_variables(&self) -> Vec<DataVariableAndName<String>>
A generator of all data variables provided by DebugInfoParsers
sourcepub fn type_by_name<S: BnStrCompatible>(
&self,
parser_name: S,
name: S
) -> Option<Ref<Type>>
pub fn type_by_name<S: BnStrCompatible>( &self, parser_name: S, name: S ) -> Option<Ref<Type>>
May return nullptr
pub fn get_data_variable_by_name<S: BnStrCompatible>( &self, parser_name: S, name: S ) -> Option<(u64, Ref<Type>)>
pub fn get_data_variable_by_address<S: BnStrCompatible>( &self, parser_name: S, address: u64 ) -> Option<(String, Ref<Type>)>
pub fn get_types_by_name<S: BnStrCompatible>( &self, name: S ) -> Vec<(String, Ref<Type>)>
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