printerror() { register PROCESS *p; char *filename; int c; p = process; if (p->signo != ESIGNAL && p->signo != SIGINT) { error("signal %d at px pc %d, lc %d", p->signo, p->pc, pc); } curline = srcline(pc); curfunc = whatblock(pc); skimsource(srcfilename(pc)); if (p->signo == ESIGNAL) { printf("\nerror at "); printwhere(curline, cursource); if (errnum != 0) { printf(": %s", pxerrmsg[errnum]); } } else { printf("\n\ninterrupt at "); printwhere(curline, cursource); } putchar('\n'); printlines(curline, curline); erecover(); }
dump() { FRAME *frp; ADDRESS prevpc; LINENO line; SYM *f; if (pc == 0) { error("program is not active"); } prevpc = pc; for (frp = curframe(); frp != NIL; frp = nextframe(frp)) { f = whatblock(entry(frp)); line = srcline(prevpc); printf("%s", name(f)); printparams(f, frp); printf(", "); printwhere(line, srcfilename(prevpc)); printf("\n"); dumpvars(f, frp); putchar('\n'); prevpc = frp->save_pc; } line = srcline(prevpc); printf("%s, ", name(program)); printwhere(line, srcfilename(prevpc)); printf("\n"); dumpvars(program, NIL); }
BOOLEAN bpact() { register BPINFO *p; BPINFO *prev, *next; BOOLEAN found; ADDRESS oldpc; delayed = NONE; found = FALSE; prev = NIL; for (p = bphead; p != NIL; p = next) { next = p->bpnext; if (p->bpaddr == pc) { prbpfound(p); found = TRUE; if (p->bpcond == NIL || isswitch(p->bptype) || cond(p->bpcond)) { prbphandled(); if (handlebp(p) == NOSAVE) { prbpnosave(); if (prev == NIL) { bphead = next; } else { prev->bpnext = next; } dispose(p); } else { prbpsave(); prev = p; } } else { prev = p; } } else { prev = p; } } if (delayed != NONE) { oldpc = pc; runtofirst(); if ((delayed&DELAY_CALL) == DELAY_CALL) { SYM *s, *t; s = curfunc; t = whatblock(return_addr()); if (t == NIL) { panic("can't find block for caller addr %d", caller_addr()); } printcall(s, t); addbp(return_addr(), RETURN, s, NIL, NIL, 0); } if (pc != oldpc) { bpact(); } if (isstopped) { printstatus(); } } else { if (isstopped) { printstatus(); } } fflush(stdout); return(found); }