[Lldb-commits] [PATCH] D130796: [LLDB][NativePDB] Switch to use DWARFLocationList.

Zequan Wu via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Jul 29 12:36:14 PDT 2022


zequanwu created this revision.
Herald added a project: All.
zequanwu requested review of this revision.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.

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 overlapped address ranges sometimes exist <https://github.com/llvm/llvm-project/issues/56616> in codeview and 
DWARFLocationList doesn't allow overlapped ranges (otherwise internal binary 
search may fail), here's implementation strategy:

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 earlier. 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, 5) -> ecx, [5, 6) -> eax.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D130796

Files:
  lldb/include/lldb/Utility/RangeMap.h
  lldb/source/Expression/DWARFExpressionList.cpp
  lldb/source/Plugins/SymbolFile/NativePDB/DWARFLocationExpression.cpp
  lldb/source/Plugins/SymbolFile/NativePDB/DWARFLocationExpression.h
  lldb/source/Plugins/SymbolFile/NativePDB/PdbUtil.cpp
  lldb/source/Plugins/SymbolFile/NativePDB/PdbUtil.h
  lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp
  lldb/test/Shell/SymbolFile/NativePDB/Inputs/local-variables-registers.lldbinit
  lldb/test/Shell/SymbolFile/NativePDB/inline_sites.test
  lldb/test/Shell/SymbolFile/NativePDB/local-variables-registers.s
  lldb/test/Shell/SymbolFile/NativePDB/subfield_register_simple_type.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D130796.448702.patch
Type: text/x-patch
Size: 84579 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20220729/681e6b21/attachment-0001.bin>


More information about the lldb-commits mailing list