[all-commits] [llvm/llvm-project] 9dd861: [nfc] [lldb] 1/2: Fix DW_AT_ranges DW_FORM_sec_off...

Jan Kratochvil via All-commits all-commits at lists.llvm.org
Wed May 19 06:58:19 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 9dd861a4f53968c732531de5d4488ace20d6d075
      https://github.com/llvm/llvm-project/commit/9dd861a4f53968c732531de5d4488ace20d6d075
  Author: Jan Kratochvil <jan.kratochvil at redhat.com>
  Date:   2021-05-19 (Wed, 19 May 2021)

  Changed paths:
    M lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp
    M lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.h

  Log Message:
  -----------
  [nfc] [lldb] 1/2: Fix DW_AT_ranges DW_FORM_sec_offset not using DW_AT_rnglists_base (used by GCC)

Refactor code only for D98289.

Reviewed By: clayborg

Differential Revision: https://reviews.llvm.org/D99653


  Commit: d1310817194aad488c86f4fb627c33090600a4a9
      https://github.com/llvm/llvm-project/commit/d1310817194aad488c86f4fb627c33090600a4a9
  Author: Jan Kratochvil <jan.kratochvil at redhat.com>
  Date:   2021-05-19 (Wed, 19 May 2021)

  Changed paths:
    M lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp
    M lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.h
    A lldb/test/Shell/SymbolFile/DWARF/DW_AT_range-DW_FORM_sec_offset.s

  Log Message:
  -----------
  [lldb] 2/2: Fix DW_AT_ranges DW_FORM_sec_offset not using DW_AT_rnglists_base (used by GCC)

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.

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

Differential Revision: https://reviews.llvm.org/D98289


Compare: https://github.com/llvm/llvm-project/compare/ab4e04a0f31a...d1310817194a


More information about the All-commits mailing list