[Lldb-commits] [PATCH] D98289: [lldb] Fix DW_AT_ranges DW_FORM_sec_offset not using DW_AT_rnglists_base (used by GCC)

Jan Kratochvil via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Mar 9 13:03:33 PST 2021

jankratochvil created this revision.
jankratochvil added reviewers: labath, grimar.
jankratochvil added a project: LLDB.
Herald added a subscriber: JDevlieghere.
jankratochvil requested review of this revision.

`DW_AT_ranges` can use `DW_FORM_sec_offset` (instead of `DW_FORM_rnglistx`). In such case `DW_AT_rnglists_base` does not need to be present.
DWARF-5 spec:

> "If the offset_entry_count is zero, then DW_FORM_rnglistx cannot be used to access a range list; DW_FORM_sec_offset must be used instead. If the offset_entry_count is non-zero, then DW_FORM_rnglistx may be used to access a range list;"

This fix is for `TestTypeCompletion.py` category `dwarf` using GCC with DWARF-5.
`TestTypeCompletion.py` category `dwo` still fails but that is a GCC bug: -gdwarf-5 -gsplit-dwarf puts .debug_rnglists to main file, not .dwo file <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99490>

The fix just provides `GetRnglist()` lazy getter for `m_rnglist_table`.
The testcase is easier to review by: `diff -u lldb/test/Shell/SymbolFile/DWARF/DW_AT_low_pc-addrx.s lldb/test/Shell/SymbolFile/DWARF/DW_AT_range-DW_FORM_sec_offset.s`

  rG LLVM Github Monorepo



-------------- next part --------------
A non-text attachment was scrubbed...
Name: D98289.329450.patch
Type: text/x-patch
Size: 9610 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20210309/7547b85e/attachment.bin>

More information about the lldb-commits mailing list