err(1, "bkpt_check: Can't get registers.");
err(1, "bkpt_check: Can't get registers");
bkpt_check(struct pstate *ps){	struct breakpoint *bkpt;	struct callback *cb;	TAILQ_HEAD(,callback) sstep_cbs;	reg *rg, pc;	int ret;	int didsome = 0;	int stop = 0;	/* Requeue all single-step callbacks because bkpts can add ssteps. */	TAILQ_INIT(&sstep_cbs);	while ((cb = TAILQ_FIRST(&ps->ps_sstep_cbs)) != NULL) {		TAILQ_REMOVE(&ps->ps_sstep_cbs, cb, cb_list);		TAILQ_INSERT_TAIL(&sstep_cbs, cb, cb_list);	}	/*	 * The default is to stop. Unless we do some processing and none	 * of the callbacks require a stop.	 */	rg = alloca(sizeof(*rg) * md_def.nregs);	if (rg == NULL)		err(1, "bkpt_check: Can't allocate stack space.");	if (md_getregs(ps, rg))		err(1, "bkpt_check: Can't get registers.");	pc = rg[md_def.pcoff];	pc -= BREAKPOINT_DECR_PC;	bkpt = bkpt_find_at_pc(ps, pc);	if (bkpt == NULL)		goto sstep;	ps->ps_npc = pc;	while ((cb = TAILQ_FIRST(&bkpt->bkpt_cbs)) != NULL) {		didsome = 1;		TAILQ_REMOVE(&bkpt->bkpt_cbs, cb, cb_list);		ret = (*cb->cb_fun)(ps, cb->cb_arg);		free(cb);		switch (ret) {		case BKPT_DEL_STOP:			stop = 1;		case BKPT_DEL_CONT:			break;		case BKPT_KEEP_STOP:			stop = 1;		case BKPT_KEEP_CONT:			sstep_set(ps, sstep_bkpt_readd, (void *)bkpt->bkpt_pc);			break;		default:			errx(1, "unkonwn bkpt_fun return, internal error");		}	}	bkpt_delete(ps, bkpt);sstep:	while ((cb = TAILQ_FIRST(&sstep_cbs)) != NULL) {		didsome = 1;		TAILQ_REMOVE(&sstep_cbs, cb, cb_list);		stop |= (*cb->cb_fun)(ps, cb->cb_arg);		free(cb);	}	ps->ps_flags &= ~PSF_STEP;	return (didsome && !stop);}