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

source

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

source

pub fn types(&self) -> Vec<Ref<NameAndType>>

A generator of all types provided by DebugInfoParsers

source

pub fn functions_by_name<S: BnStrCompatible>( &self, parser_name: S ) -> Vec<DebugFunctionInfo>

Returns a generator of all functions provided by a named DebugInfoParser

source

pub fn functions(&self) -> Vec<DebugFunctionInfo>

A generator of all functions provided by DebugInfoParsers

source

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

source

pub fn data_variables(&self) -> Vec<DataVariableAndName<String>>

A generator of all data variables provided by DebugInfoParsers

source

pub fn type_by_name<S: BnStrCompatible>( &self, parser_name: S, name: S ) -> Option<Ref<Type>>

May return nullptr

source

pub fn get_data_variable_by_name<S: BnStrCompatible>( &self, parser_name: S, name: S ) -> Option<(u64, Ref<Type>)>

source

pub fn get_data_variable_by_address<S: BnStrCompatible>( &self, parser_name: S, address: u64 ) -> Option<(String, Ref<Type>)>

source

pub fn get_types_by_name<S: BnStrCompatible>( &self, name: S ) -> Vec<(String, Ref<Type>)>

source

pub fn get_data_variables_by_name<S: BnStrCompatible>( &self, name: S ) -> Vec<(String, u64, Ref<Type>)>

source

pub fn get_data_variables_by_address( &self, address: u64 ) -> Vec<(String, String, Ref<Type>)>

The tuple is (DebugInfoParserName, TypeName, type)

source

pub fn remove_parser_info<S: BnStrCompatible>(&self, parser_name: S) -> bool

source

pub fn remove_parser_types<S: BnStrCompatible>(&self, parser_name: S) -> bool

source

pub fn remove_parser_functions<S: BnStrCompatible>( &self, parser_name: S ) -> bool

source

pub fn remove_parser_data_variables<S: BnStrCompatible>( &self, parser_name: S ) -> bool

source

pub fn remove_type_by_name<S: BnStrCompatible>( &self, parser_name: S, name: S ) -> bool

source

pub fn remove_function_by_index<S: BnStrCompatible>( &self, parser_name: S, index: usize ) -> bool

source

pub fn remove_data_variable_by_address<S: BnStrCompatible>( &self, parser_name: S, address: u64 ) -> bool

source

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

source

pub fn add_function(&self, new_func: DebugFunctionInfo) -> bool

Adds a function scoped under the current parser’s name to the debug info

source

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

source

pub fn add_data_variable_info<S: BnStrCompatible>( &self, var: DataVariableAndName<S> ) -> bool

Trait Implementations§

source§

impl Hash for DebugInfo

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for DebugInfo

source§

fn eq(&self, other: &DebugInfo) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl ToOwned for DebugInfo

§

type Owned = Ref<DebugInfo>

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> Self::Owned

Creates owned data from borrowed data, usually by cloning. Read more
1.63.0 · source§

fn clone_into(&self, target: &mut Self::Owned)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl Eq for DebugInfo

source§

impl StructuralPartialEq for DebugInfo

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.