This is an archive of the discontinued LLVM Phabricator instance.

[LLDB] - Add basic support for .debug_rnglists section (DWARF5)
ClosedPublic

Authored by grimar on Oct 8 2018, 4:16 AM.

Details

Summary

This adds a basic support of the .debug_rnglists section.
Only the DW_RLE_start_length and DW_RLE_end_of_list entries are supported.

Diff Detail

Repository
rL LLVM

Event Timeline

grimar created this revision.Oct 8 2018, 4:16 AM
clayborg requested changes to this revision.Oct 8 2018, 9:30 AM

Just add a switch statement when handling the encodings and a lldbassert as mentioned in inlined comments and this will be good to go.

source/Plugins/SymbolFile/DWARF/DWARFDebugRanges.cpp
134–144 ↗(On Diff #168642)

Use a switch statement here? We also want to use a lldbassert for any non supported encodings (in the default case of the switch statement) so we know if/when a compiler starts emitting an encoding we don't yet support when running the test suite with assertions enabled. That will let us know why things are failing.

This revision now requires changes to proceed.Oct 8 2018, 9:30 AM

For space savings it seems like we would want to support the DW_RLE_base_address and DW_RLE_offset_pair pretty soon.

grimar updated this revision to Diff 168759.Oct 9 2018, 1:25 AM
  • Addressed review comments.
source/Plugins/SymbolFile/DWARF/DWARFDebugRanges.cpp
134–144 ↗(On Diff #168642)

Thanks! I was wondering if I can use some kind of an assert here. Because I noticed that usually lldb just return false
when is unable to parse some debug section (like a case of unknown form or attribute) or tries to skip the unknown constructions.
Having an assert definitely can simplify the further support here.

grimar added a comment.Oct 9 2018, 3:55 AM

For space savings it seems like we would want to support the DW_RLE_base_address and DW_RLE_offset_pair pretty soon.

I am working on a follow-up patch to support those.

clayborg accepted this revision.Oct 9 2018, 7:11 AM
This revision is now accepted and ready to land.Oct 9 2018, 7:11 AM
This revision was automatically updated to reflect the committed changes.
xbolva00 added inline comments.
lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugRanges.cpp
163

variable is not used anywhere

grimar added inline comments.Oct 31 2018, 6:51 AM
lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugRanges.cpp
163

Removed in r345720, thanks!