================
@@ -45,3 +45,26 @@ def test_NSError_p(self):
],
)
self.runCmd("process continue")
+
+ @skipIfOutOfTreeDebugserver
+ def test_runtime_types_efficient_memreads(self):
+ # Test that we use an efficient reading of memory when reading
+ # Objective-C method descriptions.
+ logfile = os.path.join(self.getBuildDir(), "log.txt")
+ self.runCmd(f"log enable -f {logfile} gdb-remote packets process")
+ self.addTearDownHook(lambda: self.runCmd("log disable gdb-remote
packets"))
+
+ self.build()
+ self.target, process, thread, bkpt = lldbutil.run_to_source_breakpoint(
+ self, "// Break here for NSString tests",
lldb.SBFileSpec("main.m", False)
+ )
+
+ self.runCmd(f"proc plugin packet send StartTesting", check=False)
+ self.expect('expression str = [NSString stringWithCString: "new"]')
+ self.runCmd(f"proc plugin packet send EndTesting", check=False)
+
+ self.assertTrue(os.path.exists(logfile))
+ log_text = open(logfile).read()
+ log_text = log_text.split("StartTesting", 1)[-1].split("EndTesting",
1)[0]
+ self.assertIn("MultiMemRead:", log_text)
+ self.assertNotIn("MultiMemRead error", log_text)
----------------
felipepiovezan wrote:
Ohh i should add a comment about this, the sneaky thing is that I also enabled
the gdbremote process log
https://github.com/llvm/llvm-project/pull/164311
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits