DwarfAnalyzer

Struct DwarfAnalyzer 

Source
pub struct DwarfAnalyzer { /* private fields */ }
Expand description

DWARF analyzer - unified entry point for all DWARF analysis

Implementations§

Source§

impl DwarfAnalyzer

Source

pub async fn from_pid(pid: u32) -> Result<Self>

Create DWARF analyzer from PID (now uses parallel loading)

Source

pub fn is_inline_at(&mut self, module_address: &ModuleAddress) -> Option<bool>

Classify whether an address is inside an inlined subroutine instance Returns Some(true) if inline, Some(false) if a normal (non-inline) context, or None if the module/address cannot be resolved.

Source

pub fn resolve_struct_type_shallow_by_name_in_module<P: AsRef<Path>>( &mut self, module_path: P, name: &str, ) -> Option<TypeInfo>

Resolve struct/class by name (shallow) in a specific module using only indexes

Source

pub fn resolve_struct_type_shallow_by_name( &mut self, name: &str, ) -> Option<TypeInfo>

Resolve struct/class by name (shallow) across modules (first match)

Source

pub fn resolve_union_type_shallow_by_name_in_module<P: AsRef<Path>>( &mut self, module_path: P, name: &str, ) -> Option<TypeInfo>

Resolve union by name (shallow) in a specific module

Source

pub fn resolve_union_type_shallow_by_name( &mut self, name: &str, ) -> Option<TypeInfo>

Resolve union by name (shallow) across modules (first match)

Source

pub fn resolve_enum_type_shallow_by_name_in_module<P: AsRef<Path>>( &mut self, module_path: P, name: &str, ) -> Option<TypeInfo>

Resolve enum by name (shallow) in a specific module

Source

pub fn resolve_enum_type_shallow_by_name( &mut self, name: &str, ) -> Option<TypeInfo>

Resolve enum by name (shallow) across modules (first match)

Source

pub async fn from_pid_parallel(pid: u32) -> Result<Self>

Create DWARF analyzer from PID using parallel loading

Source

pub async fn from_pid_parallel_with_progress<F>( pid: u32, progress_callback: F, ) -> Result<Self>
where F: Fn(ModuleLoadingEvent) + Send + Sync + 'static,

Create DWARF analyzer from PID using parallel loading with progress callback

Source

pub async fn from_pid_parallel_with_config<F>( pid: u32, debug_search_paths: &[String], allow_loose_debug_match: bool, progress_callback: F, ) -> Result<Self>
where F: Fn(ModuleLoadingEvent) + Send + Sync + 'static,

Create DWARF analyzer from PID using parallel loading with debug search paths and progress callback

Source

pub async fn from_exec_path<P: AsRef<Path>>(exec_path: P) -> Result<Self>

Create DWARF analyzer from executable path (single module mode, now async parallel)

Source

pub async fn from_exec_path_with_config<P: AsRef<Path>>( exec_path: P, debug_search_paths: &[String], allow_loose_debug_match: bool, ) -> Result<Self>

Create DWARF analyzer from executable path with debug search paths

Source

pub fn lookup_function_addresses(&self, name: &str) -> Vec<ModuleAddress>

Lookup function addresses across all modules Returns: Vec - one for each address where the function is found

Source

pub fn vaddr_to_file_offset<P: AsRef<Path>>( &self, module_path: P, vaddr: u64, ) -> Option<u64>

Convert a module-relative virtual address (DWARF PC) to an ELF file offset Returns None if the module is unknown or the address is not within a PT_LOAD segment

Source

pub fn get_all_variables_at_address( &mut self, module_address: &ModuleAddress, ) -> Result<Vec<VariableWithEvaluation>>

Get all variables visible at the given module address with EvaluationResult

§Arguments
  • module_address - Module address containing both module path and address offset
Source

pub fn plan_chain_access( &mut self, module_address: &ModuleAddress, base_var: &str, chain: &[String], ) -> Result<Option<VariableWithEvaluation>>

Plan a chain access (e.g., r.headers_in) and synthesize a VariableWithEvaluation

Source

pub fn get_loaded_modules(&self) -> Vec<&PathBuf>

Get all loaded module paths

Source

pub fn find_global_variables_by_name( &self, name: &str, ) -> Vec<(PathBuf, GlobalVariableInfo)>

Find global/static variables by name across all loaded modules

Source

pub fn plan_global_chain_access( &mut self, prefer_module: &PathBuf, base: &str, fields: &[String], ) -> Result<Option<(PathBuf, VariableWithEvaluation)>>

Plan a member/chain access across modules focusing on global/static variables. Strict policy and order:

  1. Query globals index by base name (prefer current module first).

  2. For each candidate: try static-offset lowering when link-time address exists.

  3. Fallback to per-module planner at addr=0.

    Returns None if unresolved; never falls back to unrelated globals.

Source

pub fn resolve_variable_by_offsets_in_module<P: AsRef<Path>>( &mut self, module_path: P, cu_off: DebugInfoOffset, die_off: UnitOffset, ) -> Result<VariableWithEvaluation>

Resolve a variable by CU/DIE offsets in a specific module at an arbitrary address context (for globals)

Source

pub fn list_all_global_variables(&self) -> Vec<(PathBuf, GlobalVariableInfo)>

List all global/static variables with usable addresses across all loaded modules

Source

pub fn classify_section_for_address<P: AsRef<Path>>( &self, module_path: P, vaddr: u64, ) -> Option<SectionType>

Classify the section type for a link-time virtual address in a specific module

Source

pub fn compute_global_member_static_offset<P: AsRef<Path>>( &mut self, module_path: P, link_address: u64, cu_off: DebugInfoOffset, var_die: UnitOffset, fields: &[String], ) -> Result<Option<(u64, TypeInfo)>>

Compute static offset for a global variable member chain

Source

pub fn lookup_function_address_by_name( &self, function_name: &str, ) -> Option<ModuleAddress>

Lookup function address by name - returns first match Returns ModuleAddress for the first function found

Source

pub fn lookup_source_location( &mut self, module_address: &ModuleAddress, ) -> Option<SourceLocation>

Lookup source location by module address Returns source location for the given module address

Source

pub fn lookup_addresses_by_source_line( &self, file_path: &str, line_number: u32, ) -> Vec<ModuleAddress>

Lookup addresses by source line (cross-module) Returns: Vec for all matches

Source

pub fn get_all_function_names(&self) -> Vec<String>

Get all function names (cross-module)

Source

pub fn get_stats(&self) -> AnalyzerStats

Get statistics for debugging

Source

pub fn get_module_stats(&self) -> ModuleStats

Get module statistics (compatible with ghostscope-binary’s ModuleStats)

Source

pub fn get_main_executable(&self) -> Option<MainExecutableInfo>

Get main executable module information

Source

pub fn list_functions(&self) -> Vec<String>

Get list of all function names across all modules

Source

pub fn lookup_functions_by_pattern(&self, pattern: &str) -> Vec<String>

Lookup functions by pattern (simplified - exact match only for now)

Source

pub fn lookup_all_function_names(&self) -> Vec<String>

Get all function names (alias for compatibility)

Source

pub fn get_pid(&self) -> u32

Get PID (accessor for private field)

Source

pub fn get_shared_library_info(&self) -> Vec<SharedLibraryInfo>

Get shared library information (compatibility method)

Source

pub fn get_executable_file_info(&self) -> Option<ExecutableFileInfo>

Get executable file information (for “info file” command)

Source

pub fn find_symbol_by_module_address( &self, module_address: &ModuleAddress, ) -> Option<String>

Find symbol by module address

Source

pub fn get_grouped_file_info_by_module( &self, ) -> Result<Vec<(String, Vec<SimpleFileInfo>)>>

Get grouped file info by module (compatibility method)

Trait Implementations§

Source§

impl Debug for DwarfAnalyzer

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

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

Source§

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>,

Source§

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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more