This is an archive of the discontinued LLVM Phabricator instance.

[dwarfdump] Dump DW_AT_ranges values inline in the debug_info dump.
ClosedPublic

Authored by friss on Oct 9 2014, 1:50 PM.

Details

Summary

The output looks like that:

DW_AT_ranges [FORM_data4]    (0x00000000
   [0x00000001000024a0 - 0x00000001000024c2)
   [0x0000000100002505 - 0x000000010000268b)
   End)

Diff Detail

Repository
rL LLVM

Event Timeline

friss updated this revision to Diff 14675.Oct 9 2014, 1:50 PM
friss retitled this revision from to [dwarfdump] Dump DW_AT_ranges values inline in the debug_info dump..
friss added reviewers: dblaikie, samsonov.
friss updated this object.
friss added a subscriber: Unknown Object (MLST).
dblaikie edited edge metadata.Oct 16 2014, 8:48 AM

Oops, sorry, forgot to mash the 'send' button...

lib/DebugInfo/DWARFDebugInfoEntry.cpp
154 ↗(On Diff #14675)

What's the failure mode if DW_AT_ranges isn't an index, or is not a correct index? (outside the range of ranges, etc)

test/DebugInfo/dwarfdump-ranges.test
16 ↗(On Diff #14675)

I'd probably skip the "End" word and just put ")" on the end of the previous line - given the consistent ending, line length, etc, it should be pretty obvious.

But I'm open to other ideas.

What does Darwin's dwarfdump formatting for this look like?

friss added inline comments.Oct 16 2014, 9:12 AM
lib/DebugInfo/DWARFDebugInfoEntry.cpp
154 ↗(On Diff #14675)

Depends on the case. Something really wrong will get you a empty range list thus you'll get the same output as before (this is all handled in getAddressRanges and the helpers it calls). A random index pointing into the range list section will dump... random values, but I guess that's expected.

test/DebugInfo/dwarfdump-ranges.test
16 ↗(On Diff #14675)

The End is there only to match Darwin's dwarfdump. I can drop it if you prefer.

dblaikie accepted this revision.Oct 16 2014, 9:20 AM
dblaikie edited edge metadata.

OK - looks good (yeah, looked through the range list extraction code - it appears to do the right thing and provide an empty range list if the specified offset is outside the range section, etc)

I'd vote weakly in favor of dropping the "End)" line and just putting the ')' at the end of the preceeding line:

DW_AT_ranges [FORM_data4]    (0x00000000
   [0x00000001000024a0 - 0x00000001000024c2)
   [0x0000000100002505 - 0x000000010000268b))
This revision is now accepted and ready to land.Oct 16 2014, 9:20 AM
friss closed this revision.Oct 22 2014, 9:19 PM
friss updated this revision to Diff 15296.

Closed by commit rL220466 (authored by @friss).