示例#1
0
printnews()
{
    if (ss_variables) {
	prvarnews();
    }
    if (trcond()) {
	if (ss_lines && curline > 0) {
	    skimsource(srcfilename(pc));
	    printf("trace:  ");
	    printlines(curline, curline);
	}
	if (ss_instructions) {
	    printf("inst trace: ");
	    printinst(pc, pc);
	}
    }
    bpact();
    if (stopcond()) {
	isstopped = TRUE;
	curline = srcline(pc);
	printstatus();
    }
}
示例#2
0
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);
}