================
@@ -0,0 +1,46 @@
+"""
+Test that pending breakpoints resolve for JITted code with mcjit and rtdyld.
+"""
+
+import lldb
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+
+
+class TestJitBreakpoint(TestBase):
+    @skipUnlessArch("x86_64")
+    @skipUnlessCompilerIsClang
+    @expectedFailureAll(oslist=["windows"])
+    def test_jit_breakpoints(self):
+        self.build()
+        self.ll = self.getBuildArtifact("jitbp.ll")
+        self.do_test("--jit-kind=mcjit")
+        self.do_test("--jit-linker=rtdyld")
+
+    def do_test(self, jit_flag: str):
+        self.runCmd("settings set plugin.jit-loader.gdb.enable on")
+
+        clang_path = self.findBuiltClang()
+        self.assertTrue(clang_path, "built clang could not be found")
+        lli_path = os.path.join(os.path.dirname(clang_path), "lli")
+        self.assertTrue(lldbutil.is_exe(lli_path), f"'{lli_path}' is not an 
executable")
+        self.runCmd(f"target create {lli_path}", CURRENT_EXECUTABLE_SET)
----------------
jimingham wrote:

lldbutil.run_to_source_breakpoint takes the path to the executable to run as a 
named argument, and a boolean for whether the pattern is found on launch, so 
you could replace from line 27 to line 46 with:

`lldbutil.run_to_source_breakpoint(self, "int jitbp()", 
lldb.SBFileSpec("jitbt.cpp"), exe_name=lli_path, 
has_locations_before_run=False)`

https://github.com/llvm/llvm-project/pull/170333
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to