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
This commit is contained in:
Axel Dörfler
2008-02-03 17:52:43 +00:00
parent aa1df4dc4d
commit db18308b90
+8 -6
View File
@@ -336,7 +336,8 @@ stack_trace(int argc, char **argv)
static void 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; const char *symbol, *image;
addr_t baseAddress; 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("("); kprintf("(");
for (int32 i = 0; i < argCount; i++) { for (int32 i = 0; i < argCount; i++) {
@@ -399,7 +400,7 @@ show_call(int argc, char **argv)
struct thread *thread = NULL; struct thread *thread = NULL;
addr_t oldPageDirectory = 0; addr_t oldPageDirectory = 0;
uint32 ebp = x86_read_ebp(); addr_t ebp = x86_read_ebp();
int32 argCount = 0; int32 argCount = 0;
if (argc >= 2 && argv[argc - 1][0] == '-') { if (argc >= 2 && argv[argc - 1][0] == '-') {
@@ -426,7 +427,7 @@ show_call(int argc, char **argv)
bool onKernelStack = true; bool onKernelStack = true;
for (int32 index = 1; index <= callIndex; index++) { for (int32 index = 0; index <= callIndex; index++) {
onKernelStack = onKernelStack onKernelStack = onKernelStack
&& is_kernel_stack_address(thread, ebp); && is_kernel_stack_address(thread, ebp);
@@ -434,7 +435,7 @@ show_call(int argc, char **argv)
struct iframe *frame = (struct iframe *)ebp; struct iframe *frame = (struct iframe *)ebp;
if (index == callIndex) if (index == callIndex)
print_call(thread, frame->eip, ebp, argCount); print_call(thread, frame->eip, ebp, frame->ebp, argCount);
ebp = frame->ebp; ebp = frame->ebp;
} else { } else {
@@ -449,7 +450,8 @@ show_call(int argc, char **argv)
break; break;
if (index == callIndex) if (index == callIndex)
print_call(thread, eip, ebp, argCount); print_call(thread, eip, ebp, nextEbp, argCount);
ebp = nextEbp; ebp = nextEbp;
} }