mirror of
https://github.com/intel/llvm.git
synced 2026-01-16 21:55:39 +08:00
[lldb] Avoid force loading symbol files in statistics collection (#129593)
This commit modifies the `DebuggerStats::ReportStatistics` implementation to avoid loading symbol files for unloaded symbols. We collect stats on debugger shutdown and without this change it can cause the debugger to hang for a long while on shutdown if they symbols were not previously loaded (e.g. `settings set target.preload-symbols false`). The implementation is done by adding an optional parameter to `Module::GetSymtab` to control if the corresponding symbol file will be loaded in the same way that can control it for `Module::GetSymbolFile`.
This commit is contained in:
@@ -1022,8 +1022,8 @@ SymbolFile *Module::GetSymbolFile(bool can_create, Stream *feedback_strm) {
|
||||
return m_symfile_up ? m_symfile_up->GetSymbolFile() : nullptr;
|
||||
}
|
||||
|
||||
Symtab *Module::GetSymtab() {
|
||||
if (SymbolFile *symbols = GetSymbolFile())
|
||||
Symtab *Module::GetSymtab(bool can_create) {
|
||||
if (SymbolFile *symbols = GetSymbolFile(can_create))
|
||||
return symbols->GetSymtab();
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user