This is the mail archive of the mailing list for the frysk project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Getting inline function information


Yes, dwarf has two redundant sources of information here. To be honest I think both should be programmably accessable - scanning .debug_line is a lot cheaper than .debug_info and often simple file/line info is all the user is after. For instance, fstack would, by default, just want .debug_line for backtraces as that keeps things very fast.

One got-ya with .debug_line though, I'm not sure if the spec clearly defines inline nesting rules?


Adam Jocksch wrote:
After conversing with Roland this afternoon, I think I've figured out the way we should be approaching this problem. It looks like we need to do the following things for each PC in the stack frame returned from libunwind:

1) get the scopes for that pc using dwarf_getscopes (already wrapped).
2) Started at the innermost scope, work our way backwards and check for a Dwarf_Die with the DW_TAG_inlined_subroutine tag on it. Attributes attached to this tag may give us more information about the call state of the inlined code. You can get the Dwarf tag by using dwarf_tag.

He also suggested taking a look at elfutils/src/addr2line.c:print_dwarf_function (which I have yet to do but will do shortly) for more information. It looks like the things that need to be accomplished to get this working are
a) Wrap dwarf_tag
b) Wrap whatever we need to get any/all relevant attributes out of the dwarf_tag (this may very well end up becoming a part of step (a) ).

Hopefully I should be able to get started on this sometime this week, so if anyone has any questions/comments/criticisms please feel free to respond :)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]