add stack traces on asserts
Some checks failed
re3 conan+cmake / build-cmake (openal, glfw, macos-latest, gl3) (push) Has been cancelled
re3 conan+cmake / build-cmake (openal, glfw, ubuntu-18.04, gl3) (push) Has been cancelled
re3 conan+cmake / build-cmake (openal, glfw, windows-latest, gl3) (push) Has been cancelled
re3 conan+cmake / build-cmake (openal, windows-latest, d3d9) (push) Has been cancelled
re3 cmake devkitA64 (Nintendo Switch) / build-nintendo-switch (push) Has been cancelled
re3 premake amd64 / build (Debug, win-amd64-librw_d3d9-oal) (push) Has been cancelled
re3 premake amd64 / build (Debug, win-amd64-librw_gl3_glfw-oal) (push) Has been cancelled
re3 premake amd64 / build (Release, win-amd64-librw_d3d9-oal) (push) Has been cancelled
re3 premake amd64 / build (Release, win-amd64-librw_gl3_glfw-oal) (push) Has been cancelled
re3 premake x86 / build (Debug, win-x86-librw_d3d9-mss) (push) Has been cancelled
re3 premake x86 / build (Debug, win-x86-librw_d3d9-oal) (push) Has been cancelled
re3 premake x86 / build (Debug, win-x86-librw_gl3_glfw-mss) (push) Has been cancelled
re3 premake x86 / build (Debug, win-x86-librw_gl3_glfw-oal) (push) Has been cancelled
re3 premake x86 / build (Release, win-x86-librw_d3d9-mss) (push) Has been cancelled
re3 premake x86 / build (Release, win-x86-librw_d3d9-oal) (push) Has been cancelled
re3 premake x86 / build (Release, win-x86-librw_gl3_glfw-mss) (push) Has been cancelled
re3 premake x86 / build (Release, win-x86-librw_gl3_glfw-oal) (push) Has been cancelled
re3 premake x86 / build (Vanilla, win-x86-librw_d3d9-mss) (push) Has been cancelled
re3 premake x86 / build (Vanilla, win-x86-librw_d3d9-oal) (push) Has been cancelled
re3 premake x86 / build (Vanilla, win-x86-librw_gl3_glfw-mss) (push) Has been cancelled
re3 premake x86 / build (Vanilla, win-x86-librw_gl3_glfw-oal) (push) Has been cancelled

This commit is contained in:
Stefanos Kornilios Mitsis Poiitidis 2025-03-06 19:17:39 +02:00
parent 423acd51bc
commit 6b5dddbd23

View file

@ -1189,6 +1189,8 @@ const int re3_buffsize = 1024;
static char re3_buff[re3_buffsize]; static char re3_buff[re3_buffsize];
#endif #endif
extern void stacktrace();
#ifndef MASTER #ifndef MASTER
void re3_assert(const char *expr, const char *filename, unsigned int lineno, const char *func) void re3_assert(const char *expr, const char *filename, unsigned int lineno, const char *func)
{ {
@ -1239,8 +1241,22 @@ void re3_assert(const char *expr, const char *filename, unsigned int lineno, con
abort(); abort();
#else #else
// TODO // TODO
printf("\nREVC ASSERT FAILED\n\tFile: %s\n\tLine: %d\n\tFunction: %s\n\tExpression: %s\n",filename,lineno,func,expr); fflush(stdout);
assert(false); fflush(stderr);
dbglog(DBG_CRITICAL, "\nRE3 ASSERT FAILED\n\tFile: %s\n\tLine: %d\n\tFunction: %s\n\tExpression: %s\n",filename,lineno,func,expr);
dbglog(DBG_CRITICAL, "POSIX error (may not be relevant): %s\n", strerror(errno));
#if defined(DC_SIM) || defined(DC_TEXCONV)
for(;;);
#else
stacktrace();
dbgio_dev_select("fb");
sleep(1);
dbglog(DBG_CRITICAL, "RE3 ASSERT FAILED\n\tFile: %s\n\tLine: %d\n\tFunction: %s\n\tExpression: %s\n",filename,lineno,func,expr);
dbglog(DBG_CRITICAL, "POSIX error (may not be relevant): %s\n", strerror(errno));
stacktrace();
dbgio_flush();
abort();
#endif
#endif #endif
} }
#endif #endif