Skip to content

Commit d8619ba

Browse files
QuzarDCQuzarDC
authored andcommitted
assert: Fix stack tracing during asserts.
This was accidentally disabled with the introduction of the `__is_defined()` macro as the instruction from `environ.sh` was merely to define `FRAME_POINTERS` rather than set it to 1, which is required for `__is_defined()`. As we no longer use the define, remove that restriction entirely. Additionally avoid skipping any frames. Despite the `__noinline` attribute, this can still lead to dropping frames during a trace and the worst case downside is that the traces get a few internal calls.
1 parent 4c1d656 commit d8619ba

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

kernel/libc/koslib/assert.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
66
*/
77

8-
// In both the newlib and KOS libc cases, we use our own assert. The
9-
// assert_msg and assert hooking functionality is just too useful.
8+
/* In both the newlib and KOS libc cases, we use our own assert. The
9+
assert_msg and assert hooking functionality is just too useful. */
1010

1111
#include <assert.h>
1212
#include <stdio.h>
@@ -27,8 +27,7 @@ __noinline static void __noreturn assert_handler_default(const char *file, int l
2727
dbglog(DBG_CRITICAL, "Assertion \"%s\" failed at %s:%d in `%s': %s\n\n",
2828
expr, file, line, func, msg);
2929

30-
if(__is_defined(FRAME_POINTERS))
31-
arch_stk_trace(2);
30+
arch_stk_trace(0);
3231

3332
abort();
3433
/* NOT REACHED */

0 commit comments

Comments
 (0)