From 3e6671b69575cd775f1b2c0a6f5a162d7875d2f2 Mon Sep 17 00:00:00 2001 From: Mariusz Borsa Date: Wed, 12 Feb 2025 19:33:19 -0800 Subject: [PATCH] [lldb][ASAN][Swift] Do not use backticks in tests Backticks prevents emitting proper diagnostics when expression evaluation fails. Replacing backticks expressions with use of lldb tremporary variables in ASAN lldb Swift test https://github.com/swiftlang/llvm-project/issues/10012 (cherry picked from commit 578efae420a6bee094c9b438081516617c5f1075) --- lldb/test/API/functionalities/asan/swift/TestAsanSwift.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lldb/test/API/functionalities/asan/swift/TestAsanSwift.py b/lldb/test/API/functionalities/asan/swift/TestAsanSwift.py index 5ef1e3d3b2c88..938d979d6757f 100644 --- a/lldb/test/API/functionalities/asan/swift/TestAsanSwift.py +++ b/lldb/test/API/functionalities/asan/swift/TestAsanSwift.py @@ -74,12 +74,14 @@ def do_test_asan(self): # interceptors. self.runCmd("continue") + self.runCmd("expr let $targetptr = ptr") + # the stop reason of the thread should be breakpoint. self.expect("thread list", lldbtest.STOPPED_DUE_TO_BREAKPOINT, substrs=['stopped', 'stop reason = breakpoint']) self.expect( - "memory history `ptr`", + "memory history $targetptr", substrs=[ 'Memory allocated by Thread 1', 'main.swift']) @@ -105,7 +107,7 @@ def do_test_asan(self): break self.expect( - "memory history `ptr`", + "memory history $targetptr", substrs=[ 'Memory allocated by Thread 1', 'main.swift'])