diff options
Diffstat (limited to 'Kernel/Thread.cpp')
-rw-r--r-- | Kernel/Thread.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/Kernel/Thread.cpp b/Kernel/Thread.cpp index d218c6b697..220b7bf966 100644 --- a/Kernel/Thread.cpp +++ b/Kernel/Thread.cpp @@ -27,6 +27,7 @@ #include <Kernel/Thread.h> #include <Kernel/ThreadTracer.h> #include <Kernel/TimerQueue.h> +#include <Kernel/kstdio.h> #include <LibC/signal_numbers.h> namespace Kernel { @@ -501,8 +502,14 @@ void Thread::finalize() m_join_blocker_set.thread_finalizing(); } - if (m_dump_backtrace_on_finalization) - dbgln("{}", backtrace()); + if (m_dump_backtrace_on_finalization) { + auto trace_or_error = backtrace(); + if (!trace_or_error.is_error()) { + auto trace = trace_or_error.release_value(); + dbgln("Backtrace:"); + kernelputstr(trace->characters(), trace->length()); + } + } drop_thread_count(false); } |