SCP: Record breakpoint match details in globals

sim_brk_match_type and sim_brk_match_addr can be used to generate
appropriate messages relating to the breakpoint match.
This commit is contained in:
Mark Pizzolato 2016-08-31 11:56:47 -07:00
parent f03df970ea
commit e06b815d2a
3 changed files with 8 additions and 4 deletions

Binary file not shown.

10
scp.c
View file

@ -475,6 +475,8 @@ t_bool sim_processing_event = FALSE;
uint32 sim_brk_summ = 0; uint32 sim_brk_summ = 0;
uint32 sim_brk_types = 0; uint32 sim_brk_types = 0;
uint32 sim_brk_dflt = 0; uint32 sim_brk_dflt = 0;
uint32 sim_brk_match_type;
t_addr sim_brk_match_addr;
char *sim_brk_act[MAX_DO_NEST_LVL]; char *sim_brk_act[MAX_DO_NEST_LVL];
char *sim_brk_act_buf[MAX_DO_NEST_LVL]; char *sim_brk_act_buf[MAX_DO_NEST_LVL];
BRKTAB **sim_brk_tab = NULL; BRKTAB **sim_brk_tab = NULL;
@ -9284,7 +9286,6 @@ uint32 sim_brk_test (t_addr loc, uint32 btyp)
{ {
BRKTAB *bp; BRKTAB *bp;
uint32 spc = (btyp >> SIM_BKPT_V_SPC) & (SIM_BKPT_N_SPC - 1); uint32 spc = (btyp >> SIM_BKPT_V_SPC) & (SIM_BKPT_N_SPC - 1);
uint32 res = 0;
if (sim_brk_summ & BRK_TYP_DYN_ALL) if (sim_brk_summ & BRK_TYP_DYN_ALL)
btyp |= BRK_TYP_DYN_ALL; btyp |= BRK_TYP_DYN_ALL;
@ -9297,12 +9298,13 @@ if ((bp = sim_brk_fnd_ex (loc, btyp, TRUE))) { /* in table, and type ma
return 0; return 0;
bp->cnt = 0; /* reset count */ bp->cnt = 0; /* reset count */
sim_brk_setact (bp->act); /* set up actions */ sim_brk_setact (bp->act); /* set up actions */
res = btyp & bp->typ; /* set return value */ sim_brk_match_type = btyp & bp->typ; /* set return value */
if (bp->typ & BRK_TYP_TEMP) if (bp->typ & BRK_TYP_TEMP)
sim_brk_clr (loc, bp->typ); /* delete one-shot breakpoint */ sim_brk_clr (loc, bp->typ); /* delete one-shot breakpoint */
return res; sim_brk_match_addr = loc;
return sim_brk_match_type;
} }
return res; return 0;
} }
/* Get next pending action, if any */ /* Get next pending action, if any */

2
scp.h
View file

@ -272,6 +272,8 @@ extern volatile int32 stop_cpu;
extern uint32 sim_brk_types; /* breakpoint info */ extern uint32 sim_brk_types; /* breakpoint info */
extern uint32 sim_brk_dflt; extern uint32 sim_brk_dflt;
extern uint32 sim_brk_summ; extern uint32 sim_brk_summ;
extern uint32 sim_brk_match_type;
extern t_addr sim_brk_match_addr;
extern FILE *stdnul; extern FILE *stdnul;
extern t_bool sim_asynch_enabled; extern t_bool sim_asynch_enabled;