[Lldb-commits] [PATCH] D135664: [wasm] Always treat DWARF expression addresses as load addresses

Philip Pfaffe via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Oct 28 04:02:15 PDT 2022


pfaffe updated this revision to Diff 471485.
pfaffe added a comment.

Add comments.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D135664/new/

https://reviews.llvm.org/D135664

Files:
  lldb/source/Expression/DWARFExpression.cpp


Index: lldb/source/Expression/DWARFExpression.cpp
===================================================================
--- lldb/source/Expression/DWARFExpression.cpp
+++ lldb/source/Expression/DWARFExpression.cpp
@@ -910,6 +910,8 @@
       stack.push_back(Scalar(opcodes.GetAddress(&offset)));
       if (target &&
           target->GetArchitecture().GetCore() == ArchSpec::eCore_wasm32) {
+        // wasm file sections aren't mapped into memory, therefore addresses can
+        // never point into a file section and are always LoadAddresses.
         stack.back().SetValueType(Value::ValueType::LoadAddress);
       } else {
         stack.back().SetValueType(Value::ValueType::FileAddress);
@@ -2516,6 +2518,8 @@
       stack.push_back(Scalar(value));
       if (target &&
           target->GetArchitecture().GetCore() == ArchSpec::eCore_wasm32) {
+        // wasm file sections aren't mapped into memory, therefore addresses can
+        // never point into a file section and are always LoadAddresses.
         stack.back().SetValueType(Value::ValueType::LoadAddress);
       } else {
         stack.back().SetValueType(Value::ValueType::FileAddress);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D135664.471485.patch
Type: text/x-patch
Size: 1160 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20221028/4f96f64a/attachment.bin>


More information about the lldb-commits mailing list