[Lldb-commits] [llvm] [lldb] Add support for parsing type unit entries in .debug_names. (PR #72952)
Greg Clayton via lldb-commits
lldb-commits at lists.llvm.org
Tue Nov 21 11:15:07 PST 2023
================
@@ -37,19 +37,29 @@ llvm::DenseSet<dw_offset_t>
DebugNamesDWARFIndex::GetUnits(const DebugNames &debug_names) {
llvm::DenseSet<dw_offset_t> result;
for (const DebugNames::NameIndex &ni : debug_names) {
- for (uint32_t cu = 0; cu < ni.getCUCount(); ++cu)
+ const uint32_t num_cus = ni.getCUCount();
+ for (uint32_t cu = 0; cu < num_cus; ++cu)
result.insert(ni.getCUOffset(cu));
+ const uint32_t num_tus = ni.getLocalTUCount();
+ for (uint32_t tu = 0; tu < num_tus; ++tu)
+ result.insert(ni.getLocalTUOffset(tu));
}
return result;
}
std::optional<DIERef>
DebugNamesDWARFIndex::ToDIERef(const DebugNames::Entry &entry) {
+ // Look for a CU offset or a local TU offset as they are both offsets into
+ // the .debug_info section.
std::optional<uint64_t> cu_offset = entry.getCUOffset();
- if (!cu_offset)
- return std::nullopt;
+ if (!cu_offset) {
+ cu_offset = entry.getLocalTUOffset();
----------------
clayborg wrote:
Good idea
https://github.com/llvm/llvm-project/pull/72952
More information about the lldb-commits
mailing list