[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
Tue Jun 17 13:07:42 PDT 2025


================
@@ -512,6 +517,32 @@ def test_breakpoints(self):
             self.verify_keys(
                 breakpoint, 'target_stats["breakpoints"]', bp_keys_exist, None
             )
+    
+    def test_loaded_dwo_file_count(self):
+        """
+        Test "statistics dump" and the loaded dwo file count.
+        Builds a binary w/ separate .dwo files and debug_names, and then
+        verifies the loaded dwo file count is the expected count after running
+        various commands
+        """
+        da = {"CXX_SOURCES": "third.cpp baz.cpp", "EXE": self.getBuildArtifact("a.out")}
+        self.build(dictionary=da, debug_info=["dwo", "debug_names"])
----------------
qxy11 wrote:

Sounds good, I added some more comments in the test about the debug names. From looking into the code, it seems like having the debug names table allows for the lazy loading w/ `DebugNamesDWARFIndex ` since we avoid calling the `Index` [method](https://github.com/llvm/llvm-project/blob/2ab9c35ea93f8557827d4cadcceb05e4eed2d30a/lldb/source/Plugins/SymbolFile/DWARF/ManualDWARFIndex.cpp#L34) in `ManualDWARFIndex`, and only trigger loading if `GetNonSkeletonUnit` gets [called](https://github.com/llvm/llvm-project/blob/2ab9c35ea93f8557827d4cadcceb05e4eed2d30a/lldb/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.cpp#L121). 

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


More information about the lldb-commits mailing list