[Lldb-commits] [lldb] [lldb] Add stop-on-fork and stop-on-vfork settings (PR #188710)
via lldb-commits
lldb-commits at lists.llvm.org
Mon Jun 29 16:55:41 PDT 2026
================
@@ -0,0 +1,57 @@
+"""
+Make sure that we stop on fork and follow mode works.
+"""
+
+import lldb
+import lldbsuite.test.lldbutil as lldbutil
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test.decorators import *
+
+
+class TestStopOnForkAndVFork(TestBase):
+ NO_DEBUG_INFO_TESTCASE = True
+
+ def do_test(self, mode, fork):
+ self.build()
+
+ args = [fork]
+ launch_info = lldb.SBLaunchInfo(args)
+ launch_info.SetWorkingDirectory(self.getBuildDir())
+
+ (_, process, _, _) = lldbutil.run_to_source_breakpoint(
+ self, "// break here", lldb.SBFileSpec("main.c"), launch_info
+ )
+ self.runCmd(f"settings set target.process.stop-on-{fork} true")
+ self.runCmd(f"settings set target.process.follow-fork-mode {mode}")
----------------
jimingham wrote:
Depending on the `mode` plus the answer to the question above about when this stop-on actually stops, you know whether you expect this stop to be in the parent or the child. Be good to test for that explicitly.
https://github.com/llvm/llvm-project/pull/188710
More information about the lldb-commits
mailing list