From db18308b906c75432ac60243588db7f288abb797 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Sun, 3 Feb 2008 17:52:43 +0000 Subject: [PATCH] Fixed the "call" command to actually show the arguments that belong to the function name it prints. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23846 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/system/kernel/arch/x86/arch_debug.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/system/kernel/arch/x86/arch_debug.cpp b/src/system/kernel/arch/x86/arch_debug.cpp index 7debed9e15..41e0269e66 100644 --- a/src/system/kernel/arch/x86/arch_debug.cpp +++ b/src/system/kernel/arch/x86/arch_debug.cpp @@ -336,7 +336,8 @@ stack_trace(int argc, char **argv) static void -print_call(struct thread *thread, addr_t eip, addr_t ebp, int32 argCount) +print_call(struct thread *thread, addr_t eip, addr_t ebp, addr_t nextEbp, + int32 argCount) { const char *symbol, *image; addr_t baseAddress; @@ -366,7 +367,7 @@ print_call(struct thread *thread, addr_t eip, addr_t ebp, int32 argCount) } } - int32 *arg = (int32 *)(ebp + 8); + int32 *arg = (int32 *)(nextEbp + 8); kprintf("("); for (int32 i = 0; i < argCount; i++) { @@ -399,7 +400,7 @@ show_call(int argc, char **argv) struct thread *thread = NULL; addr_t oldPageDirectory = 0; - uint32 ebp = x86_read_ebp(); + addr_t ebp = x86_read_ebp(); int32 argCount = 0; if (argc >= 2 && argv[argc - 1][0] == '-') { @@ -426,7 +427,7 @@ show_call(int argc, char **argv) bool onKernelStack = true; - for (int32 index = 1; index <= callIndex; index++) { + for (int32 index = 0; index <= callIndex; index++) { onKernelStack = onKernelStack && is_kernel_stack_address(thread, ebp); @@ -434,7 +435,7 @@ show_call(int argc, char **argv) struct iframe *frame = (struct iframe *)ebp; if (index == callIndex) - print_call(thread, frame->eip, ebp, argCount); + print_call(thread, frame->eip, ebp, frame->ebp, argCount); ebp = frame->ebp; } else { @@ -449,7 +450,8 @@ show_call(int argc, char **argv) break; if (index == callIndex) - print_call(thread, eip, ebp, argCount); + print_call(thread, eip, ebp, nextEbp, argCount); + ebp = nextEbp; }