This is an archive of the discontinued LLVM Phabricator instance.

[lldb/DWARF] Switch to llvm debug_rnglists parser
ClosedPublic

Authored by labath on Dec 4 2019, 8:20 AM.

Details

Summary

Our rnglist support was working only for the trivial cases (one CU),
because we only ever parsed one contribution out of the debug_rnglists
section. This means we were never able to resolve range lists for the
second and subsequent units (DW_FORM_sec_offset references came out
blang, and DW_FORM_rnglistx references always used the ranges lists from
the first unit).

Since both llvm and lldb rnglist parsers are sufficiently
self-contained, and operate similarly, we can fix this problem by
switching to the llvm parser instead. Besides the changes which are due
to variations in the interface, the main thing is that now the range
list object is a member of the DWARFUnit, instead of the entire symbol
file. This ensures that each unit can get it's own private set of range
list indices, and is consistent with how llvm's DWARFUnit does it
(overall, I've tried to structure the code the same way as the llvm
version).

I've also added a test case for the two unit scenario.

Diff Detail

Event Timeline

labath created this revision.Dec 4 2019, 8:20 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 4 2019, 8:20 AM
This revision is now accepted and ready to land.Dec 4 2019, 9:26 AM
This revision was automatically updated to reflect the committed changes.