You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
347 B
C

/* Copyright (C) 2021 fef <owo@fef.moe>. All rights reserved. */
#include <arch/vmparam.h>
#include <gay/kprintf.h>
#include <gay/ktrace.h>
void ktrace_print(void)
{
void **rbp;
__asm__ volatile("movq (%%rbp), %0" : "=r"(rbp));
kprintf("Stack trace:\n");
while (rbp >= (void **)KERNBASE) {
kprintf(" %p\n", rbp[1]);
rbp = *rbp;
}
}