Skip to content

Commit

Permalink
debug: use better crash function
Browse files Browse the repository at this point in the history
  • Loading branch information
rr- committed Jan 9, 2025
1 parent aa8be62 commit 185fd2e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/libtrx/include/libtrx/debug.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
do { \
if (!(x)) { \
LOG_DEBUG("Assertion failed: %s", #x); \
*(int *)0 = 0; \
__builtin_trap(); \
} \
} while (0)

#define ASSERT_FAIL(x) \
do { \
LOG_DEBUG("Assertion failed"); \
*(int *)0 = 0; \
__builtin_trap(); \
} while (0)
1 change: 1 addition & 0 deletions src/libtrx/log_linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ void Log_Init_Extra(const char *path)
{
signal(SIGSEGV, M_SignalHandler);
signal(SIGFPE, M_SignalHandler);
signal(SIGILL, M_SignalHandler);
}

void Log_Shutdown_Extra(void)
Expand Down

0 comments on commit 185fd2e

Please sign in to comment.