[...]
Thanks for doing this! Yep, we could unset the env temporarily.
As a general comment, perf has some helper functions for libdw
in util/dwarf-aux.[ch]. Please take a look and use/update them.
[...]
Probably we can use cu_find_lineinfo().
[...]
+static struct a2l_data *addr2line_init(const char *path)
debuginfo__new()?
[...]
+static int get_inline_function(struct dso *dso, struct inline_node *node,
+ struct symbol *sym)
+{
+ struct a2l_data *a2l = dso->a2l;
+ Dwarf_Addr addr = a2l->addr + a2l->bias;
+ Dwarf_Addr bias = 0;
+ Dwarf_Die *cudie = dwfl_module_addrdie(a2l->mod, addr, &bias);
+
+ Dwarf_Die *scopes = NULL;
+ int nscopes = dwarf_getscopes(cudie, addr - bias, &scopes);
It's not clear to me how this dwarf_getscopes() and later
dwarf_getscopes_die() work together. Can you please add some
comment? Also we have die_get_scopes() and I think it's simpler.
[...]
Why not get the function name from the abstract origin?
[...]