Skip to content

Allow lldb to load .dwp files with large .debug_info or .debug_types. #73736

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion lldb/source/Plugins/SymbolFile/DWARF/DWARFContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,10 @@ llvm::DWARFContext &DWARFContext::GetAsLLVM() {
AddSection("debug_line_str", getOrLoadLineStrData());
AddSection("debug_cu_index", getOrLoadCuIndexData());
AddSection("debug_tu_index", getOrLoadTuIndexData());

if (isDwo()) {
AddSection("debug_info.dwo", getOrLoadDebugInfoData());
AddSection("debug_types.dwo", getOrLoadDebugTypesData());
}
m_llvm_context = llvm::DWARFContext::create(section_map, addr_size);
}
return *m_llvm_context;
Expand Down
4 changes: 2 additions & 2 deletions lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class DWARFUnitHeader {
return m_unit_type == llvm::dwarf::DW_UT_type ||
m_unit_type == llvm::dwarf::DW_UT_split_type;
}
uint32_t GetNextUnitOffset() const { return m_offset + m_length + 4; }
dw_offset_t GetNextUnitOffset() const { return m_offset + m_length + 4; }

llvm::Error ApplyIndexEntry(const llvm::DWARFUnitIndex::Entry *index_entry);

Expand Down Expand Up @@ -157,7 +157,7 @@ class DWARFUnit : public UserID {
// Size of the CU data (without initial length and without header).
size_t GetDebugInfoSize() const;
// Size of the CU data incl. header but without initial length.
uint32_t GetLength() const { return m_header.GetLength(); }
dw_offset_t GetLength() const { return m_header.GetLength(); }
uint16_t GetVersion() const { return m_header.GetVersion(); }
const llvm::DWARFAbbreviationDeclarationSet *GetAbbreviations() const;
dw_offset_t GetAbbrevOffset() const;
Expand Down