From 80d5c28e2ac89fafa3d2b70ab241108d32124b9e Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Tue, 23 Jul 2024 13:23:13 -0400 Subject: [PATCH] kernel/x86: Don't skip the first address when fetching user stack traces. Let the loop handle the iframe instead of processing it up front, so that it doesn't call get_next_frame_no_debugger the first time around. Fixes the profiler skipping the first function when profiling user space only. --- src/system/kernel/arch/x86/arch_debug.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/system/kernel/arch/x86/arch_debug.cpp b/src/system/kernel/arch/x86/arch_debug.cpp index e20a9d84a0..2992d7c61a 100644 --- a/src/system/kernel/arch/x86/arch_debug.cpp +++ b/src/system/kernel/arch/x86/arch_debug.cpp @@ -1147,8 +1147,7 @@ arch_debug_get_stack_trace(addr_t* returnAddresses, int32 maxCount, if (frame == NULL) return 0; - bp = frame->bp; - onKernelStack = false; + bp = (addr_t)frame; } while (bp != 0 && count < maxCount) {