[Lldb-commits] [lldb] Handle stepping through "lazy library" stubs (PR #225238)

via lldb-commits lldb-commits at lists.llvm.org
Tue Sep 22 14:11:29 PDT 2026


================
@@ -0,0 +1,64 @@
+"""
+Test that we can step through the stubs implementing the
+Darwin linker's lazy_library feature.
+"""
+
+
+import lldb
+from lldbsuite.test.decorators import *
+import lldbsuite.test.lldbutil as lldbutil
+from lldbsuite.test.lldbtest import *
+
+
+class TestStepThroughLazyLibrary(TestBase):
+    NO_DEBUG_INFO_TESTCASE = True
+
+    @skipIf(macos_version=["<", "27"])
+    def test_step_through_lazy_library(self):
+        self.build()
+        self.main_source_file = lldb.SBFileSpec("main.c")
+        self.lazy_test()
+
+    def lazy_test(self):
+        # This function starts a process, "a.out" by default, sets a source
+        # breakpoint, runs to it, and returns the thread, process & target.
+        # It optionally takes an SBLaunchOption argument if you want to pass
+        # arguments or environment variables.
----------------
jimingham wrote:

That's actually the text from the TestSampleTest.py that I neglected to delete.

The sample_test serves two slightly cross-purposes.  OTOH, it is a template to start a new test with, and it's also supposed to be educational.  But that means you have to remember to delete the educational bits from the template when you use it...

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


More information about the lldb-commits mailing list