[Lldb-commits] [lldb] [lldb] Add count for number of DWO files loaded in statistics (PR #144424)

via lldb-commits lldb-commits at lists.llvm.org
Mon Jun 16 16:51:23 PDT 2025


================
@@ -425,6 +425,11 @@ class SymbolFile : public PluginInterface {
   /// Reset the statistics for the symbol file.
   virtual void ResetStatistics() {}
 
+  /// Get the number of loaded DWO files for this symbol file.
+  /// This is used for statistics gathering and will return 0 for most
+  /// symbol file implementations except DWARF symbol files.
+  virtual uint32_t GetLoadedDwoFileCount() const { return 0; }
----------------
qxy11 wrote:

Thanks for the reference! In `GetSeparateDebugInfo` [here](https://github.com/llvm/llvm-project/blob/d882670d498a29f4e02f357ef9fe07c43de034c8/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp#L4185), the call to `GetDwoSymbolFile` ends up loading all DWO files (even if they weren't already loaded). I think it'd work if we set the `load_all_debug_info` to false in the call and do `GetDwoSymbolFile(false)`, in which case we'd have to add an extra `load_all_debug_info` argument to `GetSeparateDebugInfo` as well so that other existing use cases for GetSeparateDebugInfo don't get effected. I can try that instead of adding the new overload.

https://github.com/llvm/llvm-project/pull/144424


More information about the lldb-commits mailing list