1
0
mirror of https://github.com/golang/go synced 2024-11-20 02:54:39 -07:00

Don't try to account for CALL instruction in 0th frame.

R=rsc
APPROVED=rsc
DELTA=9  (4 added, 3 deleted, 2 changed)
OCL=33238
CL=33251
This commit is contained in:
Austin Clements 2009-08-13 18:10:38 -07:00
parent 45ce825544
commit dbecfbf86d
2 changed files with 6 additions and 5 deletions

View File

@ -60,7 +60,9 @@ traceback(byte *pc0, byte *sp, G *g)
printf("%S", f->name); printf("%S", f->name);
if(pc > f->entry) if(pc > f->entry)
printf("+%p", (uintptr)(pc - f->entry)); printf("+%p", (uintptr)(pc - f->entry));
printf(" %S:%d\n", f->src, funcline(f, pc-1)); // -1 to get to CALL instr. if(n > 0)
pc--; // get to CALL instruction
printf(" %S:%d\n", f->src, funcline(f, pc));
printf("\t%S(", f->name); printf("\t%S(", f->name);
for(i = 0; i < f->args; i++) { for(i = 0; i < f->args; i++) {
if(i != 0) if(i != 0)
@ -144,4 +146,3 @@ runtime·Caller(int32 n, uintptr retpc, String retfile, int32 retline, bool retb
FLUSH(&retline); FLUSH(&retline);
FLUSH(&retbool); FLUSH(&retbool);
} }

View File

@ -57,7 +57,9 @@ traceback(byte *pc0, byte *sp, G *g)
printf("%S", f->name); printf("%S", f->name);
if(pc > f->entry) if(pc > f->entry)
printf("+%p", (uintptr)(pc - f->entry)); printf("+%p", (uintptr)(pc - f->entry));
printf(" %S:%d\n", f->src, funcline(f, pc-1)); // -1 to get to CALL instr. if(n > 0)
pc--; // get to CALL instruction
printf(" %S:%d\n", f->src, funcline(f, pc));
printf("\t%S(", f->name); printf("\t%S(", f->name);
for(i = 0; i < f->args; i++) { for(i = 0; i < f->args; i++) {
if(i != 0) if(i != 0)
@ -141,5 +143,3 @@ runtime·Caller(int32 n, uint64 retpc, String retfile, int32 retline, bool retbo
FLUSH(&retline); FLUSH(&retline);
FLUSH(&retbool); FLUSH(&retbool);
} }