diff options
author | Russ Cox <rsc@golang.org> | 2010-10-07 06:45:40 -0400 |
---|---|---|
committer | Russ Cox <rsc@golang.org> | 2010-10-07 06:45:40 -0400 |
commit | 7eb13b95a39300b50c02dde0cf32c76d992dcab7 (patch) | |
tree | af59433e6133fe46008469d9a52d309344d6b7db | |
parent | 53fff1e74d03260e58ceba0cd2f70c3cc5a54043 (diff) | |
download | go-7eb13b95a39300b50c02dde0cf32c76d992dcab7.tar.gz go-7eb13b95a39300b50c02dde0cf32c76d992dcab7.zip |
runtime: fix argument dump in traceback
Was printing words at SP instead of at FP
after shuffle due to nascent flag.
R=r, r2
CC=golang-dev
https://golang.org/cl/2316044
-rw-r--r-- | src/pkg/runtime/amd64/traceback.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/pkg/runtime/amd64/traceback.c b/src/pkg/runtime/amd64/traceback.c index 3e60002910..5cdbf2092c 100644 --- a/src/pkg/runtime/amd64/traceback.c +++ b/src/pkg/runtime/amd64/traceback.c @@ -21,7 +21,7 @@ gentraceback(byte *pc0, byte *sp, G *g, int32 skip, uintptr *pcbuf, int32 m) { byte *p; int32 i, n, iter, nascent; - uintptr pc, tracepc; + uintptr pc, tracepc, *fp; Stktop *stk; Func *f; @@ -93,10 +93,15 @@ gentraceback(byte *pc0, byte *sp, G *g, int32 skip, uintptr *pcbuf, int32 m) tracepc--; printf(" %S:%d\n", f->src, funcline(f, tracepc)); printf("\t%S(", f->name); + fp = (uintptr*)sp; + if(f->frame < sizeof(uintptr)) + fp++; + else + fp += f->frame/sizeof(uintptr); for(i = 0; i < f->args; i++) { if(i != 0) prints(", "); - ·printhex(((uintptr*)sp)[i]); + ·printhex(fp[i]); if(i >= 4) { prints(", ..."); break; |