[Lldb-commits] [lldb] Add commands frequency to statistics dump (PR #80375)

via lldb-commits lldb-commits at lists.llvm.org
Mon Feb 5 11:01:55 PST 2024


================
@@ -355,6 +360,25 @@ def test_modules(self):
         self.assertNotEqual(exe_module, None)
         self.verify_keys(exe_module, 'module dict for "%s"' % (exe), module_keys)
 
+    def test_commands(self):
+        """
+        Test "statistics dump" and the command information.
+        """
+        self.build()
+        exe = self.getBuildArtifact("a.out")
+        target = self.createTestTarget(file_path=exe)
+
+        interp = self.dbg.GetCommandInterpreter()
+        result = lldb.SBCommandReturnObject()
+        interp.HandleCommand("target list", result)
+        interp.HandleCommand("target list", result)
+
+        debug_stats = self.get_stats()
+
+        command_stats = self.get_command_stats(debug_stats)
+        self.assertNotEqual(command_stats, None)
+        self.assertEqual(command_stats["target list"], 2)
----------------
jeffreytan81 wrote:

I am pretty sure lldb test base class destroys debugger object during tearDown() between each test method which means the associated command interpreter will be destroyed as well.

I have run "ninja check-lldb" to see no failure from this test (these tests has been running internally for half year now).

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


More information about the lldb-commits mailing list