[kernel] Improve debugcon & panic display

Several minor changes related to debug output.

- Colorize the debugcon logger like the userspace one.
- Display the process and thread for each cpu in the panic display
- Skip the panic() frame in panic back traces
- Don't try to follow obviously bad (non-canonical) stack frame pointers
This commit is contained in:
Justin C. Miller
2023-02-14 20:18:56 -08:00
parent 847ef1ccfe
commit bce01591f3
4 changed files with 35 additions and 17 deletions

View File

@@ -19,7 +19,7 @@ panicking::serial_port &com1 = __com1_storage.value;
util::no_construct<panicking::symbol_table> __syms_storage;
panicking::symbol_table &syms = __syms_storage.value;
constexpr int order = __ATOMIC_ACQ_REL;
static constexpr int order = __ATOMIC_ACQ_REL;
extern "C"
void panic_handler(const cpu_state *regs)
@@ -41,7 +41,7 @@ void panic_handler(const cpu_state *regs)
asm ("pause");
panicking::frame const *fp = nullptr;
asm ( "mov %%rbp, %0" : "=r" (fp) );
asm ( "movq (%%rbp), %0" : "=r" (fp) );
if (panic)
print_header(com1, panic->message, panic->function,