mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-22 17:31:58 -05:00
Kernel: Add ability to dump backtrace from provided frame pointer
When an exception happens it is sometimes hard to figure out where exactly the exception happened, so use the frame pointer of the trap frame to print a backtrace.
This commit is contained in:
parent
57901a6f62
commit
ad5e8bbb4f
3 changed files with 8 additions and 0 deletions
|
@ -49,6 +49,8 @@ extern "C" void exception_common(Kernel::TrapFrame const* const trap_frame)
|
|||
|
||||
auto esr_el1 = Kernel::Aarch64::ESR_EL1::read();
|
||||
dbgln("esr_el1: EC({:#b}) IL({:#b}) ISS({:#b}) ISS2({:#b})", esr_el1.EC, esr_el1.IL, esr_el1.ISS, esr_el1.ISS2);
|
||||
|
||||
dump_backtrace_from_base_pointer(trap_frame->x[29]);
|
||||
}
|
||||
|
||||
Kernel::Processor::halt();
|
||||
|
|
|
@ -161,6 +161,11 @@ NEVER_INLINE static void dump_backtrace_impl(FlatPtr base_pointer, bool use_ksym
|
|||
}
|
||||
}
|
||||
|
||||
void dump_backtrace_from_base_pointer(FlatPtr base_pointer)
|
||||
{
|
||||
dump_backtrace_impl(base_pointer, g_kernel_symbols_available, PrintToScreen::Yes);
|
||||
}
|
||||
|
||||
void dump_backtrace(PrintToScreen print_to_screen)
|
||||
{
|
||||
static bool in_dump_backtrace = false;
|
||||
|
|
|
@ -29,5 +29,6 @@ extern FlatPtr g_lowest_kernel_symbol_address;
|
|||
extern FlatPtr g_highest_kernel_symbol_address;
|
||||
|
||||
void dump_backtrace(PrintToScreen print_to_screen = PrintToScreen::No);
|
||||
void dump_backtrace_from_base_pointer(FlatPtr base_pointer);
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue