symbolic_demangle DemangleOptions support only get parameters?
anranziruo opened this issue · 4 comments
@getsentry/owners-native @zhangchao1 hey all, looks like the Issue could use some additional info.
let view = ByteView::open("main.dSYM/Contents/Resources/DWARF/main")?;
let objects = Object::parse(&view)?;
let session = objects.debug_session()?;
for fn_name in session.functions().into_iter(){
println!("{:?}",fn_item);
}
pub struct Function<'data> {
/// Relative instruction address of the start of the function.
pub address: u64,
/// Total code size covered by the function body, including inlined functions.
pub size: u64,
/// The name and language of the function symbol.
pub name: Name<'data>,
/// Path to the compilation directory. File paths are relative to this.
pub compilation_dir: &'data [u8],
/// Lines covered by this function, including inlined children.
pub lines: Vec<LineInfo<'data>>,
/// Functions that have been inlined into this function's body.
pub inlinees: Vec<Function<'data>>,
/// Specifies whether this function is inlined.
pub inline: bool,
}
this inlinees infos name has matched the DW_AT_name of DW_TAG_subprogram?
@souredoutlook
I’m not sure what exactly you mean?
We do prefer the symbol name from the symbol table for top-level functions.
Otherwise we fall back to DW_AT_linkage_name
and DW_AT_name
, which we also use for inlined functions.
We also demangle symbols completely by default, with argument types and return types. The exception is the PDB type formatter which I think does not support return types for now.
We do expose the raw mangled name as well, if there is more specific need for demangling, you can reach for the crates that do that directly.