Skip to content

Commit 7678d5e

Browse files
committed
Only report total currently loaded debug info
1 parent 36c84ce commit 7678d5e

File tree

4 files changed

+9
-4
lines changed

4 files changed

+9
-4
lines changed

lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -896,8 +896,9 @@ void DWARFUnit::ComputeAbsolutePath() {
896896
m_file_spec->MakeAbsolute(GetCompilationDirectory());
897897
}
898898

899-
SymbolFileDWARFDwo *DWARFUnit::GetDwoSymbolFile() {
900-
ExtractUnitDIEIfNeeded();
899+
SymbolFileDWARFDwo *DWARFUnit::GetDwoSymbolFile(bool load_if_needed) {
900+
if (load_if_needed)
901+
ExtractUnitDIEIfNeeded();
901902
if (m_dwo)
902903
return &llvm::cast<SymbolFileDWARFDwo>(m_dwo->GetSymbolFileDWARF());
903904
return nullptr;

lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ class DWARFUnit : public UserID {
241241
FileSpec GetFile(size_t file_idx);
242242
FileSpec::Style GetPathStyle();
243243

244-
SymbolFileDWARFDwo *GetDwoSymbolFile();
244+
SymbolFileDWARFDwo *GetDwoSymbolFile(bool load_if_needed = true);
245245

246246
die_iterator_range dies() {
247247
ExtractDIEsIfNeeded();

lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2687,7 +2687,7 @@ uint64_t SymbolFileDWARF::GetDebugInfoSize() {
26872687
if (cu == nullptr)
26882688
continue;
26892689

2690-
SymbolFileDWARFDwo *dwo = cu->GetDwoSymbolFile();
2690+
SymbolFileDWARFDwo *dwo = cu->GetDwoSymbolFile(false);
26912691
if (dwo)
26922692
debug_info_size += dwo->GetDebugInfoSize();
26932693
}

lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,10 @@ class SymbolFileDWARF : public SymbolFileCommon {
186186
GetMangledNamesForFunction(const std::string &scope_qualified_name,
187187
std::vector<ConstString> &mangled_names) override;
188188

189+
// Return total currently loaded debug info
190+
// For cases like .dwo files, the debug info = skeleton debug info + all dwo
191+
// debug info where .dwo files might not be loaded yet. Calling this function
192+
// will not force the loading of any .dwo files.
189193
uint64_t GetDebugInfoSize() override;
190194

191195
void FindTypes(const lldb_private::TypeQuery &match,

0 commit comments

Comments
 (0)