Author: David Spickett
Date: 2025-07-03T11:33:59+01:00
New Revision: d8023e7cf8fefb15f1ea524c2083ecc9b08b4e40

URL: 
https://github.com/llvm/llvm-project/commit/d8023e7cf8fefb15f1ea524c2083ecc9b08b4e40
DIFF: 
https://github.com/llvm/llvm-project/commit/d8023e7cf8fefb15f1ea524c2083ecc9b08b4e40.diff

LOG: [lldb] Use correct size when dumping DWARF64 DW_FORM_ref_addr (#146686)

Not that we ever do that, because this is unused code, but if someone
was debugging lldb I guess they'd call this.

Was missed in https://github.com/llvm/llvm-project/pull/145645

Relates to https://github.com/llvm/llvm-project/issues/135208

Added: 
    

Modified: 
    lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp

Removed: 
    


################################################################################
diff  --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp 
b/lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp
index 767cda634f973..a159b923f8df4 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp
@@ -412,12 +412,8 @@ void DWARFFormValue::Dump(Stream &s) const {
   case DW_FORM_ref_addr: {
     assert(m_unit); // Unit must be valid for DW_FORM_ref_addr objects or we
                     // will get this wrong
-    if (m_unit->GetVersion() <= 2)
-      DumpAddress(s.AsRawOstream(), uvalue, sizeof(uint64_t) * 2);
-    else
-      DumpAddress(s.AsRawOstream(), uvalue,
-                  4 * 2); // 4 for DWARF32, 8 for DWARF64, but we don't
-                          // support DWARF64 yet
+    DumpAddress(s.AsRawOstream(), uvalue,
+                m_unit->GetFormParams().getRefAddrByteSize());
     break;
   }
   case DW_FORM_ref1:


        
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to