From 5dcbe41d2bd4712c8014aa7e843723ad7b40fd74 Mon Sep 17 00:00:00 2001 From: Scott Tsai Date: Fri, 2 Jul 2021 18:30:27 +0800 Subject: [PATCH] Use __builtin_debuggrap on Apple AARCH64 (#21) Origin: upstream, https://github.com/scottt/debugbreak/commit/5dcbe41d2bd4712c8014aa7e843723ad7b40fd74.patch Forwarded: not-needed --- debugbreak.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/debugbreak.h b/debugbreak.h index a41d42b..bfb8288 100644 --- a/debugbreak.h +++ b/debugbreak.h @@ -91,7 +91,7 @@ __inline__ static void trap_instruction(void) * Same problem and workaround as Thumb mode */ } #elif defined(__aarch64__) && defined(__APPLE__) - #define DEBUG_BREAK_IMPL DEBUG_BREAK_USE_BULTIN_TRAP + #define DEBUG_BREAK_IMPL DEBUG_BREAK_USE_BULTIN_DEBUGTRAP #elif defined(__aarch64__) #define DEBUG_BREAK_IMPL DEBUG_BREAK_USE_TRAP_INSTRUCTION __attribute__((always_inline)) @@ -142,6 +142,12 @@ __inline__ static void debug_break(void) { trap_instruction(); } +#elif DEBUG_BREAK_IMPL == DEBUG_BREAK_USE_BULTIN_DEBUGTRAP +__attribute__((always_inline)) +__inline__ static void debug_break(void) +{ + __builtin_debugtrap(); +} #elif DEBUG_BREAK_IMPL == DEBUG_BREAK_USE_BULTIN_TRAP __attribute__((always_inline)) __inline__ static void debug_break(void) -- 2.51.0