[Lldb-commits] [lldb] Add asan tests for libsanitizers. (PR #88349)

via lldb-commits lldb-commits at lists.llvm.org
Thu Apr 11 10:15:49 PDT 2024


================
@@ -26,6 +31,67 @@ def setUp(self):
         self.line_free = line_number("main.c", "// free line")
         self.line_breakpoint = line_number("main.c", "// break line")
 
+    # Test line numbers: rdar://126237493
+    def libsanitizer_tests(self):
+        target = self.createTestTarget()
+
+        self.runCmd(
+            "env SanitizersAddress=1 MallocSanitizerZone=1 MallocSecureAllocator=0"
+        )
+
+        self.runCmd("run")
+        # In libsanitizers, memory history is not supported until a report has been generated
+        # test the 'memory history' command
+        self.expect(
----------------
jimingham wrote:

The reason you can issue the "memory history" command directly after a "run" is I'm assuming because in the normal course of execution this process is going to stop with an asan exception, right?

If so, please test that the stop reason is what you expect, both to make sure the asan stop message is getting properly delivered and so we get a better error in case something unrelated went wrong.

https://github.com/llvm/llvm-project/pull/88349


More information about the lldb-commits mailing list