[Lldb-commits] [lldb] Fix debug info size statistics for split dwarf (PR #80218)
via lldb-commits
lldb-commits at lists.llvm.org
Wed Jan 31 17:17:15 PST 2024
================
@@ -2667,6 +2667,29 @@ static bool UpdateCompilerContextForSimpleTemplateNames(TypeQuery &match) {
}
return any_context_updated;
}
+
+uint64_t SymbolFileDWARF::GetDebugInfoSize() {
+ DWARFDebugInfo &info = DebugInfo();
+ uint32_t num_comp_units = info.GetNumUnits();
+
+ uint64_t debug_info_size = SymbolFileCommon::GetDebugInfoSize();
+ // In dwp scenario, debug info == skeleton debug info + dwp debug info.
+ if (std::shared_ptr<SymbolFileDWARFDwo> dwp_sp = GetDwpSymbolFile())
+ return debug_info_size + dwp_sp->GetDebugInfoSize();
+
+ // In dwo scenario, debug info == skeleton debug info + all dwo debug info.
+ for (uint32_t i = 0; i < num_comp_units; i++) {
+ DWARFUnit *cu = info.GetUnitAtIndex(i);
+ if (cu == nullptr)
+ continue;
+
+ SymbolFileDWARFDwo *dwo = cu->GetDwoSymbolFile();
----------------
jeffreytan81 wrote:
I think that makes sense but I would leave that to @kusmour who is working on a follow-up patch to only load dwo files already loaded from "statistics dump".
https://github.com/llvm/llvm-project/pull/80218
More information about the lldb-commits
mailing list