[llvm] [llvm-debuginfo-analyzer] Add support for WebAssembly binary format. (PR #82588)

Heejin Ahn via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 13 15:46:53 PDT 2024


================
@@ -429,10 +431,14 @@ void LVELFReader::processOneAttribute(const DWARFDie &Die, LVOffset *OffsetPtr,
         CurrentHighPC = *Address;
       if (std::optional<uint64_t> Offset = FormValue.getAsUnsignedConstant())
         // High PC is an offset from LowPC.
-        CurrentHighPC = CurrentLowPC + *Offset;
+        // Don't add the WebAssembly offset if we have seen a DW_AT_low_pc.
+        CurrentHighPC =
+            (FoundLowPC ? CurrentLowPC - WasmOffset : CurrentLowPC) + *Offset;
----------------
aheejin wrote:

Ah I see. Then, if we are going to add `WasmOffset` three lines later, why do we subtract it here?

https://github.com/llvm/llvm-project/pull/82588


More information about the llvm-commits mailing list