From 971bf954e4a39351c51cd6c0de71236f2a57e4b2 Mon Sep 17 00:00:00 2001 From: "Peter S. Housel" Date: Sat, 23 May 2026 20:07:58 -0700 Subject: [PATCH] run-time: Generate a backtrace when handling a breakpoint exception * sources/lib/run-time/llvm-exceptions.c (catch_mach_exception_raise_state_identity): Handle the ARCH_AARCH64 case for converting exception machine state into libunwind context for printing a backtrace. --- sources/lib/run-time/llvm-exceptions.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sources/lib/run-time/llvm-exceptions.c b/sources/lib/run-time/llvm-exceptions.c index 263f3424d..05a5efcce 100644 --- a/sources/lib/run-time/llvm-exceptions.c +++ b/sources/lib/run-time/llvm-exceptions.c @@ -328,9 +328,8 @@ kern_return_t catch_mach_exception_raise_state_identity memcpy(&uc, ts, sizeof(uintptr_t) * 18); #elif defined OPEN_DYLAN_ARCH_AARCH64 arm_thread_state64_t *ts = (arm_thread_state64_t *) old_state; - fprintf(stderr, "Unhandled exception: exception=%d code=%lld/%lld\n", - exception, code[0], code[1]); - abort(); + // Both of these structures begin with the aarch64 general registers + memcpy(&uc, ts, sizeof *ts); #else #error No thread state to unwind context conversion #endif