[all-commits] [llvm/llvm-project] f69f92: [lldb/DWARF] Fix DW_AT_addr_base & DW_AT_low_pc in...

Pavel Labath via All-commits all-commits at lists.llvm.org
Fri Dec 6 01:46:35 PST 2019


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: f69f92344adaada1f8f3cfcd711037227432b062
      https://github.com/llvm/llvm-project/commit/f69f92344adaada1f8f3cfcd711037227432b062
  Author: Pavel Labath <pavel at labath.sk>
  Date:   2019-12-06 (Fri, 06 Dec 2019)

  Changed paths:
    M lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp
    A lldb/test/Shell/SymbolFile/DWARF/DW_AT_low_pc-addrx.s

  Log Message:
  -----------
  [lldb/DWARF] Fix DW_AT_addr_base & DW_AT_low_pc interaction

In DWARF5 DW_AT_low_pc (and DW_AT_entry_pc, and possibly others) can use
DW_FORM_addrx to refer to the address indirectly. This means we need to
have processed the DW_AT_addr_base attribute before we can do anything
with these.

Since we were processing the unit attributes serially, this created a
problem in cases where the DW_AT_addr_base comes after DW_AT_low_pc --
we would end up computing the wrong unit base address, which also
corrupted any values which later depended on that (for instance range
lists). Clang currently always emits DW_AT_addr_base last.

The fix is simple -- process DW_AT_addr_base first, regardless of its
position in the attribute list.




More information about the All-commits mailing list