feature: print_stack working (dont use opti flags, else the stack is broken)
This commit is contained in:
13
src/debug/print_stack.c
Normal file
13
src/debug/print_stack.c
Normal file
@ -0,0 +1,13 @@
|
||||
#include "debug.h"
|
||||
#include "kprintf.h"
|
||||
|
||||
void print_stack(void)
|
||||
{
|
||||
struct stackframe *stack =
|
||||
(struct stackframe *)__builtin_frame_address(0);
|
||||
|
||||
while (stack) {
|
||||
kprintf(0, "stack->ebp: %d\n", stack->ebp);
|
||||
stack = stack->ebp;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user