This is an archive of the discontinued LLVM Phabricator instance.

[DWARF] Add support for parsing/dumping section indices in location lists
ClosedPublic

Authored by labath on Nov 21 2019, 7:21 AM.

Details

Summary

This does exactly what it says on the box. The only small gotcha is the
section index computation for offset_pair entries, which can use either
the base address section, or the section from the offset_pair entry.
This is to support both the cases where the base address is relocated
(points to the base of the CU, typically), and the case where the base
address is a constant (typically zero) and relocations are on the
offsets themselves.

Diff Detail

Event Timeline

labath created this revision.Nov 21 2019, 7:21 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 21 2019, 7:21 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
labath marked an inline comment as done.Nov 21 2019, 7:24 AM

This patch doesn't change the dump format for the "raw" entries, but it creates a good opportunity to do that.

llvm/test/tools/llvm-dwarfdump/X86/debug_loclists.s
8–42

I thought this layout would make the verbose/regular dump differences more obvious, but it could be just confusing...

aprantl accepted this revision.Nov 21 2019, 8:48 AM
aprantl added inline comments.
llvm/test/tools/llvm-dwarfdump/X86/debug_loclists.s
8–42

If it *works* I think this is good. In the past I've encountered very unintuitive behavior when combining multiple --check-prefix options and -NEXT, but it looks like you are using it to the intended effect here.

This revision is now accepted and ready to land.Nov 21 2019, 8:48 AM

Thanks.

Do you have any opinion on what should be the format of "raw" debug loc entries? (a, b) ".sect", [a,b] ".sect", {a, b} ".sect", etc. ?

This revision was automatically updated to reflect the committed changes.