From f5fab9683a29abe8af75ab01b6d911938f7df225 Mon Sep 17 00:00:00 2001 From: VAN BOSSUYT Nicolas Date: Wed, 11 Dec 2024 15:34:31 +0100 Subject: [PATCH] impl-posix: Fixup backtrace printing on panic. --- src/impls/impl-posix/base.cpp | 2 +- src/impls/impl-posix/entry.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/impls/impl-posix/base.cpp b/src/impls/impl-posix/base.cpp index ec0028b..ef98a2a 100644 --- a/src/impls/impl-posix/base.cpp +++ b/src/impls/impl-posix/base.cpp @@ -21,7 +21,7 @@ Backtrace forceCaptureBacktrace() { char **symbols = backtrace_symbols(buffer, count); for (int i = 0; i < count; i++) { - char *symbol = symbols[i]; + char const *symbol = symbols[i]; bt._frames.pushBack({ String(symbol), String("unknown"), diff --git a/src/impls/impl-posix/entry.cpp b/src/impls/impl-posix/entry.cpp index 4dd91b7..2b19b01 100644 --- a/src/impls/impl-posix/entry.cpp +++ b/src/impls/impl-posix/entry.cpp @@ -7,9 +7,9 @@ void __panicHandler(Karm::PanicKind kind, char const *msg) { fprintf(stderr, "%s: %s\n", kind == Karm::PanicKind::PANIC ? "panic" : "debug", msg); - // NOTE: We hare calling backinto the framework here, it might cause another + // NOTE: We are calling backinto the framework here, it might cause another // panic, this is why we are keeping track of nested panics - static isize _panicDepth = 1; + static isize _panicDepth = 0; _panicDepth++; if (_panicDepth == 1) { auto bt = Karm::Backtrace::capture();