This is an archive of the discontinued LLVM Phabricator instance.

[lldb] Improve invalid DWARF DW_AT_ranges error reporting
ClosedPublic

Authored by jankratochvil on May 20 2021, 9:12 AM.

Details

Summary

In D98289#inline-939112 @dblaikie said:

Perhaps this could be more informative about what makes the range list index of 0 invalid? "index 0 out of range of range list table (with range list base 0xXXX) with offset entry count of XX (valid indexes 0-(XX-1))" Maybe that's too verbose/not worth worrying about since this'll only be relevant to DWARF producers trying to debug their DWARFv5, maybe no one will ever see this message in practice. Just a thought.

If this is OK I will need to submit the LLVM part separately.

Diff Detail

Event Timeline

jankratochvil created this revision.May 20 2021, 9:12 AM
jankratochvil requested review of this revision.May 20 2021, 9:12 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 20 2021, 9:12 AM
dblaikie accepted this revision.May 20 2021, 10:31 AM

Looks good to me - at least includes more values from the file to point to the problem. Though phrasing might be better (I guess some other code prints the "DW_AT_ranges(0x0) attribute" part, which to me seems a bit weird (doesn't include the form, which might be useful for instance) and the "00000000: " prefix on the "DW_FORM_rnglistx cannot be used" part is maybe a bit of a strange way to print the CU offset (nothing in the diagnostic says what this number is) - maybe the higher level error handling could print these high level details out as a suffix ("Failure in CU that begins at offset <blah>, in DIE at offset <blah>, at attribute DW_AT_*, encoded with DW_FORM_*, with value blah").

But probably not a big deal - if someone's getting sufficiently bogus DWARF to reach this, they can probably figure it out. Maybe other LLDB folks have some ideas about how best to structure the error handling more generally in this regard.

This revision is now accepted and ready to land.May 20 2021, 10:31 AM
jankratochvil requested review of this revision.May 20 2021, 11:20 AM
jankratochvil updated this revision to Diff 346801.

Is the message format OK now?

jankratochvil planned changes to this revision.May 20 2021, 11:32 AM
jankratochvil updated this revision to Diff 346807.
dblaikie accepted this revision.May 20 2021, 11:36 AM

Yeah, looks pretty good!

This revision is now accepted and ready to land.May 20 2021, 11:36 AM
This revision was landed with ongoing or failed builds.May 20 2021, 12:37 PM
This revision was automatically updated to reflect the committed changes.