Use inline asm for debugbreak on linux to remove stack frames

* raise() adds several stack frames in debug builds, and even an inline function
  will too, regardless of always_inline status.
This commit is contained in:
baldurk
2022-06-15 17:13:56 +01:00
parent f6ac09c4e1
commit 4d8fdf4e31
4 changed files with 13 additions and 9 deletions
+13
View File
@@ -42,11 +42,24 @@
#include <signal.h>
#define __PRETTY_FUNCTION_SIGNATURE__ __PRETTY_FUNCTION__
#if ENABLED(RDOC_SWITCH)
#include <stdlib.h>
#define OS_DEBUG_BREAK() abort()
#elif ENABLED(RDOC_LINUX)
#define OS_DEBUG_BREAK() \
do \
{ \
__asm__ volatile("int $0x03"); \
} while((void)0, 0)
#else
#define OS_DEBUG_BREAK() raise(SIGTRAP)
#endif
#if defined(__clang__)