mac: support for M1, but no crashwrangler binary yet
@@ -699,13 +699,21 @@ kern_return_t catch_mach_exception_raise_state_identity(
* Get program counter.
* Cast to void* in order to silence the alignment warnings
*/
+#if defined(__x86_64__)
x86_thread_state_t* platform_in_state = ((x86_thread_state_t*)(void*)in_state);
+#elif defined(__aarch64__)
+ arm_thread_state_t* platform_in_state = ((arm_thread_state_t*)(void*)in_state);
+#endif /* defined(__x86_64__) */
+#if defined(__x86_64__)
if (x86_THREAD_STATE32 == platform_in_state->tsh.flavor) {
run->pc = platform_in_state->uts.ts32.__eip;
} else {
run->pc = platform_in_state->uts.ts64.__rip;
}
+#elif defined(__aarch64__)
+ run->pc = platform_in_state->__pc;
+#endif /* defined(__x86_64__) */
/*
* Get the exception type
