================ @@ -0,0 +1,116 @@ +""" +Make sure that the concurrent vfork() from multiple threads works correctly. +""" + + +import lldb +import lldbsuite.test.lldbutil as lldbutil +from lldbsuite.test.lldbtest import * +from lldbsuite.test.decorators import * + + +class TestConcurrentVFork(TestBase): + NO_DEBUG_INFO_TESTCASE = True + + def get_pid_from_variable(self, target): + return target.FindFirstGlobalVariable("g_pid").GetValueAsUnsigned() + + def build_run_to_breakpoint(self, use_fork, call_exec): + self.build() + + args = [] + if use_fork: + args.append("--fork") + if call_exec: + args.append("--exec") + launch_info = lldb.SBLaunchInfo(args) + launch_info.SetWorkingDirectory(self.getBuildDir()) + + return lldbutil.run_to_source_breakpoint( + self, "// break here", lldb.SBFileSpec("main.cpp") + ) + + def follow_parent_helper(self, use_fork, call_exec): + (target, process, thread, bkpt) = self.build_run_to_breakpoint( + use_fork, call_exec + ) + + parent_pid = self.get_pid_from_variable(target) ---------------- clayborg wrote:
Only one caller to this function, inline the code: ``` parent_pid = target.FindFirstGlobalVariable("g_pid").GetValueAsUnsigned() ``` https://github.com/llvm/llvm-project/pull/81564 _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits