This is an archive of the discontinued LLVM Phabricator instance.

[LLDB] - Add support for DW_FORM_rnglistx and relative DW_RLE_* entries.
ClosedPublic

Authored by grimar on Oct 31 2018, 4:49 AM.

Diff Detail

Event Timeline

grimar created this revision.Oct 31 2018, 4:49 AM

Just one question about extracting the value for DW_AT_ranges. It would be nice if we just took care of extracting the value so the form value was more useful

source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp
1083–1090

Can/should we do all this work when we extract the form value so that "form_value.Unsigned()" just returns the right thing? If not, every place that gets DW_AT_ranges attribute would need to do this.

grimar updated this revision to Diff 172121.Nov 1 2018, 7:25 AM
  • Addressed review comments.
source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp
1083–1090

Doing everything inside DWARFFormValue::ExtractValue would make the callers code simpler indeed,
but my concern is that it would mean that instead of the attribute value requested it would return the offset value read from .debug_rnglists section. I am not sure it is good idea to read any debug section content at that low level.

I think 'ExtractValue` ideally should not know about the debug sections. And also that would not be consistent with the other forms it reads. I am not sure if we might want to know the raw value of the DW_FORM_rnglistx one day, but with such change, we will lose such possibility.

I would suggest making a helper function instead, so all the callers can use it. I did it in this patch, what do you think?

clayborg accepted this revision.Nov 1 2018, 10:07 AM

Solution is fine. As long as we don't have to duplicate the work everywhere that needs a ranges offset.

This revision is now accepted and ready to land.Nov 1 2018, 10:07 AM
This revision was automatically updated to reflect the committed changes.