panic: print backtrace on panic

Panics currently lack backtraces, which are a very useful thing to
have. Make the profiling backtrace function generic and print backtraces
using it.
This commit is contained in:
Matheus
2026-10-08 22:14:46 -03:00
parent 9b8c81a2cf
commit 91ec85d8ca
4 changed files with 99 additions and 24 deletions
@@ -0,0 +1,11 @@
#ifndef _ARCH_BACKTRACE_H
#define _ARCH_BACKTRACE_H
#include <stdbool.h>
#include <arch/context.h>
typedef bool (*backtrace_fn_t)(void *ctx, void *ip);
void arch_get_backtrace(context_t *cpu_context, backtrace_fn_t fn, void *context);
#endif