[Lldb-commits] [lldb] [lldb] Fix breakpoint resolver serialization bug (PR #76766)
Greg Clayton via lldb-commits
lldb-commits at lists.llvm.org
Wed Jan 3 14:14:22 PST 2024
================
@@ -49,6 +49,37 @@ def test_scripted_extra_args(self):
self.setup_targets_and_cleanup()
self.do_check_extra_args()
+ def test_resolver_serialization(self):
+ """Test that breakpoint resolvers contain the expected information"""
+ self.build()
+ self.setup_targets_and_cleanup()
+
+ sym_ctx_list = self.orig_target.FindFunctions("main")
+ self.assertTrue(sym_ctx_list.GetSize() == 1, "Unable to find function `main'")
+ sym_ctx = sym_ctx_list.GetContextAtIndex(0)
+ self.assertTrue(
+ sym_ctx.IsValid(), "SBSymbolContext representing function `main' is invalid"
+ )
+ main_func = sym_ctx.GetFunction()
+ self.assertTrue(
+ main_func.IsValid(), "SBFunction representing `main' is invalid"
+ )
+ main_addr = main_func.GetStartAddress()
+
+ bkpt = self.orig_target.BreakpointCreateBySBAddress(main_addr)
+ self.assertTrue(
+ bkpt.IsValid(), "Could not place breakpoint on `main' by address"
+ )
+ stream = lldb.SBStream()
+ sd = bkpt.SerializeToStructuredData()
+ sd.GetAsJSON(stream)
+ serialized_data = json.loads(stream.GetData())
+
+ self.assertIn(
+ "a.out",
----------------
clayborg wrote:
If you make the change suggested in the comment, you can possibly switch `"a.out"` with `exe_path`
https://github.com/llvm/llvm-project/pull/76766
More information about the lldb-commits
mailing list