mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-24 02:12:09 -05:00
Kernel: Don't allow dump_backtrace() to call dump_backtrace().
That was not a very graceful looking loop to be stuck in.
This commit is contained in:
parent
ec0d598934
commit
d2c3749cf3
1 changed files with 7 additions and 0 deletions
|
@ -3,6 +3,7 @@
|
|||
#include "Scheduler.h"
|
||||
#include <Kernel/FileSystem/FileDescriptor.h>
|
||||
#include <Kernel/ELF/ELFLoader.h>
|
||||
#include <AK/TemporaryChange.h>
|
||||
|
||||
static KSym* s_ksyms;
|
||||
dword ksym_lowest_address;
|
||||
|
@ -132,6 +133,12 @@ static void load_ksyms_from_data(const ByteBuffer& buffer)
|
|||
|
||||
void dump_backtrace()
|
||||
{
|
||||
static bool in_dump_backtrace = false;
|
||||
if (in_dump_backtrace) {
|
||||
dbgprintf("dump_backtrace() called from within itself, what the hell is going on!\n");
|
||||
return;
|
||||
}
|
||||
TemporaryChange change(in_dump_backtrace, true);
|
||||
dword ebp;
|
||||
asm volatile("movl %%ebp, %%eax":"=a"(ebp));
|
||||
dump_backtrace_impl(ebp, ksyms_ready);
|
||||
|
|
Loading…
Add table
Reference in a new issue