xv6

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 0e8765dc03ad5883598069241a38e6106e0d98a0
parent 3d0ab0250f3407bc4b97d7bc4244b4ba6eaaf792
Author: Brian Swetland <swetland@frotz.net>
Date:   Sun,  5 Jan 2014 12:49:12 -0800

make procdump() work on x64

Use the newly added getstackpcs() for arbitrary-bp-relative unwinding.

Diffstat:
Mkernel/proc.c | 6++----
1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/kernel/proc.c b/kernel/proc.c @@ -433,7 +433,6 @@ kill(int pid) void procdump(void) { -#ifndef X64 static char *states[] = { [UNUSED] "unused", [EMBRYO] "embryo", @@ -445,7 +444,7 @@ procdump(void) int i; struct proc *p; char *state; - uint pc[10]; + uintp pc[10]; for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ if(p->state == UNUSED) @@ -456,13 +455,12 @@ procdump(void) state = "???"; cprintf("%d %s %s", p->pid, state, p->name); if(p->state == SLEEPING){ - getcallerpcs((uint*)p->context->ebp+2, pc); + getstackpcs((uintp*)p->context->ebp, pc); for(i=0; i<10 && pc[i] != 0; i++) cprintf(" %p", pc[i]); } cprintf("\n"); } -#endif }