[Lldb-commits] [lldb] [lldb] Implement a statusline in LLDB (PR #121860)

Pavel Labath via lldb-commits lldb-commits at lists.llvm.org
Wed Feb 12 02:36:56 PST 2025


================
@@ -0,0 +1,46 @@
+import lldb
+import re
+
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test.lldbpexpect import PExpectTest
+
+
+class TestStatusline(PExpectTest):
+    def do_setup(self):
+        # Create a target and run to a breakpoint.
+        exe = self.getBuildArtifact("a.out")
+        self.expect(
+            "target create {}".format(exe), substrs=["Current executable set to"]
+        )
+        self.expect('breakpoint set -p "Break here"', substrs=["Breakpoint 1"])
+        self.expect("run", substrs=["stop reason"])
+
+    # PExpect uses many timeouts internally and doesn't play well
+    # under ASAN on a loaded machine..
+    @skipIfAsan
+    def test(self):
+        """Basic test for the statusline.
+
+        PExpect was designed for line-oriented output so we're limited in what
----------------
labath wrote:

You should still be able to check a fair number of things. This isn't like the curses GUI, where there's the curses library sitting between our code and the terminal. All of the escape codes we print are fully within our control.

For example, it should be possible to check that the right escape sequence for enabling/disabling the status line is printed in response to changing the setting value.

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


More information about the lldb-commits mailing list