Author: Jonas Devlieghere
Date: 2026-08-02T16:37:54Z
New Revision: 84046ac88f3104def05049a701535a79c19560bd

URL: 
https://github.com/llvm/llvm-project/commit/84046ac88f3104def05049a701535a79c19560bd
DIFF: 
https://github.com/llvm/llvm-project/commit/84046ac88f3104def05049a701535a79c19560bd.diff

LOG: [lldb][test] Recognize a Wasm trap as a crash (#213551)

is_thread_crashed maps how each platform reports the bad access the test
suite uses to simulate a crash, and had no case for Wasm, where there
are no signals and a bad access raises a trap that a runtime reports as
an exception. Without one it fell through to a description match that
never held, so a crashed thread read as running fine.

Added: 
    

Modified: 
    lldb/packages/Python/lldbsuite/test/lldbutil.py

Removed: 
    


################################################################################
diff  --git a/lldb/packages/Python/lldbsuite/test/lldbutil.py 
b/lldb/packages/Python/lldbsuite/test/lldbutil.py
index f2e0b013f8402..78f7155ee2507 100644
--- a/lldb/packages/Python/lldbsuite/test/lldbutil.py
+++ b/lldb/packages/Python/lldbsuite/test/lldbutil.py
@@ -979,6 +979,10 @@ def is_thread_crashed(test, thread):
         )
     elif test.getPlatform() == "windows":
         return "Exception 0xc0000005" in thread.GetStopDescription(200)
+    elif test.getPlatform() in ["wasip1", "wasi"]:
+        # Wasm has no signals. What a bad access raises is a trap, which a
+        # runtime reports as an exception described by the trap it hit.
+        return thread.GetStopReason() == lldb.eStopReasonException
     else:
         return "invalid address" in thread.GetStopDescription(100)
 


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

Reply via email to