mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 08:47:34 +00: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 "Scheduler.h"
|
||||||
#include <Kernel/FileSystem/FileDescriptor.h>
|
#include <Kernel/FileSystem/FileDescriptor.h>
|
||||||
#include <Kernel/ELF/ELFLoader.h>
|
#include <Kernel/ELF/ELFLoader.h>
|
||||||
|
#include <AK/TemporaryChange.h>
|
||||||
|
|
||||||
static KSym* s_ksyms;
|
static KSym* s_ksyms;
|
||||||
dword ksym_lowest_address;
|
dword ksym_lowest_address;
|
||||||
|
@ -132,6 +133,12 @@ static void load_ksyms_from_data(const ByteBuffer& buffer)
|
||||||
|
|
||||||
void dump_backtrace()
|
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;
|
dword ebp;
|
||||||
asm volatile("movl %%ebp, %%eax":"=a"(ebp));
|
asm volatile("movl %%ebp, %%eax":"=a"(ebp));
|
||||||
dump_backtrace_impl(ebp, ksyms_ready);
|
dump_backtrace_impl(ebp, ksyms_ready);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue