pub struct DwarfAnalyzer { /* private fields */ }Expand description
DWARF analyzer - unified entry point for all DWARF analysis
Implementations§
Source§impl DwarfAnalyzer
impl DwarfAnalyzer
Sourcepub async fn from_pid(pid: u32) -> Result<Self>
pub async fn from_pid(pid: u32) -> Result<Self>
Create DWARF analyzer from PID (now uses parallel loading)
Sourcepub fn is_inline_at(&mut self, module_address: &ModuleAddress) -> Option<bool>
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.
Sourcepub fn resolve_struct_type_shallow_by_name_in_module<P: AsRef<Path>>(
&mut self,
module_path: P,
name: &str,
) -> Option<TypeInfo>
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
Sourcepub fn resolve_struct_type_shallow_by_name(
&mut self,
name: &str,
) -> Option<TypeInfo>
pub fn resolve_struct_type_shallow_by_name( &mut self, name: &str, ) -> Option<TypeInfo>
Resolve struct/class by name (shallow) across modules (first match)
Sourcepub fn resolve_union_type_shallow_by_name_in_module<P: AsRef<Path>>(
&mut self,
module_path: P,
name: &str,
) -> Option<TypeInfo>
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
Sourcepub fn resolve_union_type_shallow_by_name(
&mut self,
name: &str,
) -> Option<TypeInfo>
pub fn resolve_union_type_shallow_by_name( &mut self, name: &str, ) -> Option<TypeInfo>
Resolve union by name (shallow) across modules (first match)
Sourcepub fn resolve_enum_type_shallow_by_name_in_module<P: AsRef<Path>>(
&mut self,
module_path: P,
name: &str,
) -> Option<TypeInfo>
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
Sourcepub fn resolve_enum_type_shallow_by_name(
&mut self,
name: &str,
) -> Option<TypeInfo>
pub fn resolve_enum_type_shallow_by_name( &mut self, name: &str, ) -> Option<TypeInfo>
Resolve enum by name (shallow) across modules (first match)
Sourcepub async fn from_pid_parallel(pid: u32) -> Result<Self>
pub async fn from_pid_parallel(pid: u32) -> Result<Self>
Create DWARF analyzer from PID using parallel loading
Sourcepub async fn from_pid_parallel_with_progress<F>(
pid: u32,
progress_callback: F,
) -> Result<Self>
pub async fn from_pid_parallel_with_progress<F>( pid: u32, progress_callback: F, ) -> Result<Self>
Create DWARF analyzer from PID using parallel loading with progress callback
Sourcepub async fn from_pid_parallel_with_config<F>(
pid: u32,
debug_search_paths: &[String],
allow_loose_debug_match: bool,
progress_callback: F,
) -> Result<Self>
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>
Create DWARF analyzer from PID using parallel loading with debug search paths and progress callback
Sourcepub async fn from_exec_path<P: AsRef<Path>>(exec_path: P) -> Result<Self>
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)
Sourcepub async fn from_exec_path_with_config<P: AsRef<Path>>(
exec_path: P,
debug_search_paths: &[String],
allow_loose_debug_match: bool,
) -> Result<Self>
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
Sourcepub fn lookup_function_addresses(&self, name: &str) -> Vec<ModuleAddress>
pub fn lookup_function_addresses(&self, name: &str) -> Vec<ModuleAddress>
Lookup function addresses across all modules
Returns: Vec
Sourcepub fn vaddr_to_file_offset<P: AsRef<Path>>(
&self,
module_path: P,
vaddr: u64,
) -> Option<u64>
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
Sourcepub fn get_all_variables_at_address(
&mut self,
module_address: &ModuleAddress,
) -> Result<Vec<VariableWithEvaluation>>
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
Sourcepub fn plan_chain_access(
&mut self,
module_address: &ModuleAddress,
base_var: &str,
chain: &[String],
) -> Result<Option<VariableWithEvaluation>>
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
Sourcepub fn get_loaded_modules(&self) -> Vec<&PathBuf>
pub fn get_loaded_modules(&self) -> Vec<&PathBuf>
Get all loaded module paths
Sourcepub fn find_global_variables_by_name(
&self,
name: &str,
) -> Vec<(PathBuf, GlobalVariableInfo)>
pub fn find_global_variables_by_name( &self, name: &str, ) -> Vec<(PathBuf, GlobalVariableInfo)>
Find global/static variables by name across all loaded modules
Sourcepub fn plan_global_chain_access(
&mut self,
prefer_module: &PathBuf,
base: &str,
fields: &[String],
) -> Result<Option<(PathBuf, VariableWithEvaluation)>>
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:
-
Query globals index by base name (prefer current module first).
-
For each candidate: try static-offset lowering when link-time address exists.
-
Fallback to per-module planner at addr=0.
Returns None if unresolved; never falls back to unrelated globals.
Sourcepub fn resolve_variable_by_offsets_in_module<P: AsRef<Path>>(
&mut self,
module_path: P,
cu_off: DebugInfoOffset,
die_off: UnitOffset,
) -> Result<VariableWithEvaluation>
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)
Sourcepub fn list_all_global_variables(&self) -> Vec<(PathBuf, GlobalVariableInfo)>
pub fn list_all_global_variables(&self) -> Vec<(PathBuf, GlobalVariableInfo)>
List all global/static variables with usable addresses across all loaded modules
Sourcepub fn classify_section_for_address<P: AsRef<Path>>(
&self,
module_path: P,
vaddr: u64,
) -> Option<SectionType>
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
Sourcepub 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)>>
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
Sourcepub fn lookup_function_address_by_name(
&self,
function_name: &str,
) -> Option<ModuleAddress>
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
Sourcepub fn lookup_source_location(
&mut self,
module_address: &ModuleAddress,
) -> Option<SourceLocation>
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
Sourcepub fn lookup_addresses_by_source_line(
&self,
file_path: &str,
line_number: u32,
) -> Vec<ModuleAddress>
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
Sourcepub fn get_all_function_names(&self) -> Vec<String>
pub fn get_all_function_names(&self) -> Vec<String>
Get all function names (cross-module)
Sourcepub fn get_stats(&self) -> AnalyzerStats
pub fn get_stats(&self) -> AnalyzerStats
Get statistics for debugging
Sourcepub fn get_module_stats(&self) -> ModuleStats
pub fn get_module_stats(&self) -> ModuleStats
Get module statistics (compatible with ghostscope-binary’s ModuleStats)
Sourcepub fn get_main_executable(&self) -> Option<MainExecutableInfo>
pub fn get_main_executable(&self) -> Option<MainExecutableInfo>
Get main executable module information
Sourcepub fn list_functions(&self) -> Vec<String>
pub fn list_functions(&self) -> Vec<String>
Get list of all function names across all modules
Sourcepub fn lookup_functions_by_pattern(&self, pattern: &str) -> Vec<String>
pub fn lookup_functions_by_pattern(&self, pattern: &str) -> Vec<String>
Lookup functions by pattern (simplified - exact match only for now)
Sourcepub fn lookup_all_function_names(&self) -> Vec<String>
pub fn lookup_all_function_names(&self) -> Vec<String>
Get all function names (alias for compatibility)
Get shared library information (compatibility method)
Sourcepub fn get_executable_file_info(&self) -> Option<ExecutableFileInfo>
pub fn get_executable_file_info(&self) -> Option<ExecutableFileInfo>
Get executable file information (for “info file” command)
Sourcepub fn find_symbol_by_module_address(
&self,
module_address: &ModuleAddress,
) -> Option<String>
pub fn find_symbol_by_module_address( &self, module_address: &ModuleAddress, ) -> Option<String>
Find symbol by module address
Sourcepub fn get_grouped_file_info_by_module(
&self,
) -> Result<Vec<(String, Vec<SimpleFileInfo>)>>
pub fn get_grouped_file_info_by_module( &self, ) -> Result<Vec<(String, Vec<SimpleFileInfo>)>>
Get grouped file info by module (compatibility method)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DwarfAnalyzer
impl RefUnwindSafe for DwarfAnalyzer
impl Send for DwarfAnalyzer
impl Sync for DwarfAnalyzer
impl Unpin for DwarfAnalyzer
impl UnwindSafe for DwarfAnalyzer
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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