[Lldb-commits] [PATCH] D99653: [nfc] [lldb] 1/2: Fix DW_AT_ranges DW_FORM_sec_offset not using DW_AT_rnglists_base (used by GCC)
Jan Kratochvil via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Wed May 19 06:57:56 PDT 2021
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
jankratochvil marked an inline comment as done.
Closed by commit rG9dd861a4f539: [nfc] [lldb] 1/2: Fix DW_AT_ranges DW_FORM_sec_offset not using… (authored by jankratochvil).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D99653/new/
https://reviews.llvm.org/D99653
Files:
lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp
lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.h
Index: lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.h
===================================================================
--- lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.h
+++ lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.h
@@ -235,15 +235,7 @@
/// Return a rangelist's offset based on an index. The index designates
/// an entry in the rangelist table's offset array and is supplied by
/// DW_FORM_rnglistx.
- llvm::Optional<uint64_t> GetRnglistOffset(uint32_t Index) const {
- if (!m_rnglist_table)
- return llvm::None;
- if (llvm::Optional<uint64_t> off = m_rnglist_table->getOffsetEntry(
- m_dwarf.GetDWARFContext().getOrLoadRngListsData().GetAsLLVM(),
- Index))
- return *off + m_ranges_base;
- return llvm::None;
- }
+ llvm::Optional<uint64_t> GetRnglistOffset(uint32_t Index);
llvm::Optional<uint64_t> GetLoclistOffset(uint32_t Index) {
if (!m_loclist_table_header)
@@ -291,6 +283,8 @@
return &m_die_array[0];
}
+ const llvm::Optional<llvm::DWARFDebugRnglistTable> &GetRnglist();
+
SymbolFileDWARF &m_dwarf;
std::shared_ptr<DWARFUnit> m_dwo;
DWARFUnitHeader m_header;
Index: lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp
===================================================================
--- lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp
+++ lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp
@@ -500,6 +500,19 @@
ranges_base, toString(table_or_error.takeError()).c_str());
}
+const llvm::Optional<llvm::DWARFDebugRnglistTable> &DWARFUnit::GetRnglist() {
+ return m_rnglist_table;
+}
+
+llvm::Optional<uint64_t> DWARFUnit::GetRnglistOffset(uint32_t Index) {
+ if (!GetRnglist())
+ return llvm::None;
+ if (llvm::Optional<uint64_t> off = GetRnglist()->getOffsetEntry(
+ m_dwarf.GetDWARFContext().getOrLoadRngListsData().GetAsLLVM(), Index))
+ return *off + m_ranges_base;
+ return llvm::None;
+}
+
void DWARFUnit::SetStrOffsetsBase(dw_offset_t str_offsets_base) {
m_str_offsets_base = str_offsets_base;
}
@@ -941,11 +954,11 @@
return ranges;
}
- if (!m_rnglist_table)
+ if (!GetRnglist())
return llvm::createStringError(errc::invalid_argument,
"missing or invalid range list table");
- auto range_list_or_error = m_rnglist_table->findList(
+ auto range_list_or_error = GetRnglist()->findList(
m_dwarf.GetDWARFContext().getOrLoadRngListsData().GetAsLLVM(), offset);
if (!range_list_or_error)
return range_list_or_error.takeError();
@@ -976,7 +989,7 @@
DWARFUnit::FindRnglistFromIndex(uint32_t index) {
if (llvm::Optional<uint64_t> offset = GetRnglistOffset(index))
return FindRnglistFromOffset(*offset);
- if (m_rnglist_table)
+ if (GetRnglist())
return llvm::createStringError(errc::invalid_argument,
"invalid range list table index %d", index);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D99653.346447.patch
Type: text/x-patch
Size: 2914 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20210519/7416c382/attachment-0001.bin>
More information about the lldb-commits
mailing list