================
@@ -1077,7 +1077,8 @@ uint32_t DWARFUnit::GetHeaderByteSize() const { return 
m_header.getSize(); }
 
 std::optional<uint64_t>
 DWARFUnit::GetStringOffsetSectionItem(uint32_t index) const {
-  lldb::offset_t offset = GetStrOffsetsBase() + index * 4;
+  lldb::offset_t offset =
+      GetStrOffsetsBase() + index * m_header.getDwarfOffsetByteSize();
   return m_dwarf.GetDWARFContext().getOrLoadStrOffsetsData().GetU32(&offset);
----------------
labath wrote:

GetU32 should probably also change to `GetUnsigned(getDwarfOffsetByteSize())`

https://github.com/llvm/llvm-project/pull/147054
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to