Port changes from debugbreak.

This commit is contained in:
Roman Telezhynskyi 2022-02-07 15:05:15 +02:00
parent 5b3bcdf1af
commit 922920c12c

View File

@ -91,7 +91,7 @@ __inline__ static void trap_instruction(void)
* Same problem and workaround as Thumb mode */ * Same problem and workaround as Thumb mode */
} }
#elif defined(__aarch64__) && defined(__APPLE__) #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__) #elif defined(__aarch64__)
#define DEBUG_BREAK_IMPL DEBUG_BREAK_USE_TRAP_INSTRUCTION #define DEBUG_BREAK_IMPL DEBUG_BREAK_USE_TRAP_INSTRUCTION
__attribute__((always_inline)) __attribute__((always_inline))
@ -142,6 +142,12 @@ __inline__ static void debug_break(void)
{ {
trap_instruction(); 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 #elif DEBUG_BREAK_IMPL == DEBUG_BREAK_USE_BULTIN_TRAP
__attribute__((always_inline)) __attribute__((always_inline))
__inline__ static void debug_break(void) __inline__ static void debug_break(void)