Commit dbecfbf8 authored by Austin Clements's avatar Austin Clements

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
parent 45ce8255
...@@ -60,7 +60,9 @@ traceback(byte *pc0, byte *sp, G *g) ...@@ -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 ...@@ -144,4 +146,3 @@ runtime·Caller(int32 n, uintptr retpc, String retfile, int32 retline, bool retb
FLUSH(&retline); FLUSH(&retline);
FLUSH(&retbool); FLUSH(&retbool);
} }
...@@ -57,7 +57,9 @@ traceback(byte *pc0, byte *sp, G *g) ...@@ -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 ...@@ -141,5 +143,3 @@ runtime·Caller(int32 n, uint64 retpc, String retfile, int32 retline, bool retbo
FLUSH(&retline); FLUSH(&retline);
FLUSH(&retbool); FLUSH(&retbool);
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment