llvm-symbolizer: access the base address from the skeleton CU, not the split unit
authorDavid Blaikie <dblaikie@gmail.com>
Fri, 26 May 2023 00:59:40 +0000 (00:59 +0000)
committerDavid Blaikie <dblaikie@gmail.com>
Fri, 26 May 2023 00:59:40 +0000 (00:59 +0000)
commit3c5e3b70a3591869526bca72d36fc664aeff02bd
tree86210fadeda2242b9b9464c1ce967a694e0c47b5
parenteaf3de6970fc6e779310a59fbf8f8452f6b34c55
llvm-symbolizer: access the base address from the skeleton CU, not the split unit

In Split DWARF, if the unit had a non-trivial base address (a real
low_pc, rather than one with fixed value 0) then computing addresses
needs to access that base address to add to any base address-relative
values. But the code was trying to access the base address in the split
unit, when it's actually in the skeleton unit. So delegate to the
skeleton if it's available.

Fixes #62941
llvm/lib/DebugInfo/DWARF/DWARFUnit.cpp
llvm/test/tools/llvm-symbolizer/split-dwarf-base-addr.s [new file with mode: 0644]