aboutsummaryrefslogtreecommitdiff
path: root/libs/libc/print.c
diff options
context:
space:
mode:
authorMarvin Borner2021-05-18 22:06:59 +0200
committerMarvin Borner2021-05-18 22:07:19 +0200
commit45bfdffcb2e00fda595b3f9318469f6b0d29cbe4 (patch)
treef78d66a7687aeb5c4fe4806adf60f70bab95dd9b /libs/libc/print.c
parentc905cd632cc7c5fa8e61eae7c00ed8e14743ced9 (diff)
Fixed issues with intel emulation
Diffstat (limited to 'libs/libc/print.c')
-rw-r--r--libs/libc/print.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libs/libc/print.c b/libs/libc/print.c
index c4455eb..463fef6 100644
--- a/libs/libc/print.c
+++ b/libs/libc/print.c
@@ -241,6 +241,8 @@ void print_trace(u32 count)
__asm__ volatile("movl %%ebp, %0;" : "=r"(stk));
print("EBP\tEIP\n");
for (u32 i = 0; stk && memory_readable(stk) && i < count; i++) {
+ if (!stk->ebp || !stk->eip)
+ break;
printf("0x%x\t0x%x\n", stk->ebp, stk->eip);
stk = stk->ebp;
}