[all-commits] [llvm/llvm-project] 71d778: [LLDB][NativePDB] Switch to use DWARFLocationList.

Zequan Wu via All-commits all-commits at lists.llvm.org
Wed Aug 17 13:37:29 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 71d778f33e8615f525f118db351c6541b40199ab
      https://github.com/llvm/llvm-project/commit/71d778f33e8615f525f118db351c6541b40199ab
  Author: Zequan Wu <zequanwu at google.com>
  Date:   2022-08-17 (Wed, 17 Aug 2022)

  Changed paths:
    M lldb/include/lldb/Utility/RangeMap.h
    M lldb/source/Plugins/SymbolFile/NativePDB/CodeViewRegisterMapping.cpp
    M lldb/source/Plugins/SymbolFile/NativePDB/CodeViewRegisterMapping.h
    M lldb/source/Plugins/SymbolFile/NativePDB/DWARFLocationExpression.cpp
    M lldb/source/Plugins/SymbolFile/NativePDB/DWARFLocationExpression.h
    M lldb/source/Plugins/SymbolFile/NativePDB/PdbUtil.cpp
    M lldb/source/Plugins/SymbolFile/NativePDB/PdbUtil.h
    M lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp
    M lldb/test/Shell/SymbolFile/NativePDB/Inputs/local-variables-registers.lldbinit
    M lldb/test/Shell/SymbolFile/NativePDB/inline_sites.test
    M lldb/test/Shell/SymbolFile/NativePDB/local-variables-registers.s
    R lldb/test/Shell/SymbolFile/NativePDB/subfield_register_simple_type.s

  Log Message:
  -----------
  [LLDB][NativePDB] Switch to use DWARFLocationList.

Before, NativePDB uses scoped range as a workaround for value range, that causes
problems (e.g. a variable's value can only have one range, but usually a
variable's value is located at different address ranges, each at different
locations, in optimized build).
This patch let NativePDB switch to DWARFLocationList so a variable's value can
be described at multiple non-overlapped address ranges and each range maps to a
location.
Because overlapping ranges exists, here's peference when choosing ranges:
1. Always prefer whole value locations. Suppose a variable size is 8 bytes, one record is that for range [1, 5) first 4 bytes is at ecx, and another record is that for range [2, 8) the 8 bytes value is at rdx. This results: [1, 2) has first 4 bytes at ecx, [2, 8) has the whole value at rdx.
2. Always prefer the locations parsed later. Suppose first record is that for range [1, 5) value is at ecx, second record is that for range [2, 6) value is at eax. This results: [1, 2) -> ecx, [2, 6) -> eax.

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




More information about the All-commits mailing list