tweak pcs in traceback so they point to calling line instead of line after call.

R=rsc
DELTA=2  (0 added, 0 deleted, 2 changed)
OCL=19745
CL=19745
This commit is contained in:
Rob Pike 2008-11-20 17:19:45 -08:00
parent 0998eaf4a1
commit ec913c42b3
2 changed files with 2 additions and 2 deletions

View File

@ -32,7 +32,7 @@ void
sys·printpc(void *p)
{
prints("PC=0x");
sys·printpointer(sys·getcallerpc(p));
sys·printpointer((byte*)sys·getcallerpc(p) - 1); // -1 to get to CALL instr.
}
void

View File

@ -70,7 +70,7 @@ traceback(uint8 *pc, uint8 *sp, void* r15)
/* print this frame */
prints("0x");
sys·printpointer(callpc);
sys·printpointer(callpc - 1); // -1 to get to CALL instr.
prints("?zi\n");
prints("\t");
prints(name);