diff --git a/PDP11/pdp11_cpu.c b/PDP11/pdp11_cpu.c index df08b28e..5ebb5b24 100644 --- a/PDP11/pdp11_cpu.c +++ b/PDP11/pdp11_cpu.c @@ -657,15 +657,6 @@ MTAB cpu_mod[] = { { 0 } }; -DEVICE cpu_dev = { - "CPU", &cpu_unit, cpu_reg, cpu_mod, - 1, 8, 22, 2, 8, 16, - &cpu_ex, &cpu_dep, &cpu_reset, - NULL, NULL, NULL, - NULL, DEV_DYNM, 0, - NULL, &cpu_set_size, NULL - }; - BRKTYPTAB cpu_breakpoints [] = { BRKTYPE('E',"Execute Instruction at Virtual Address"), BRKTYPE('P',"Execute Instruction at Physical Address"), @@ -676,6 +667,17 @@ BRKTYPTAB cpu_breakpoints [] = { { 0 } }; +DEVICE cpu_dev = { + "CPU", &cpu_unit, cpu_reg, cpu_mod, + 1, 8, 22, 2, 8, 16, + &cpu_ex, &cpu_dep, &cpu_reset, + NULL, NULL, NULL, + NULL, DEV_DYNM, 0, + NULL, &cpu_set_size, NULL, + NULL, NULL, NULL, NULL, + cpu_breakpoints + }; + t_value pdp11_pc_value (void) { return (t_value)PC; diff --git a/scp.c b/scp.c index 96dc48af..7d1361ca 100644 --- a/scp.c +++ b/scp.c @@ -2434,6 +2434,40 @@ void fprint_show_help (FILE *st, DEVICE *dptr) fprint_show_help_ex (st, dptr, TRUE); } +void fprint_brk_help_ex (FILE *st, DEVICE *dptr, t_bool silent) +{ +BRKTYPTAB *brkt = dptr->brk_types; +char gbuf[CBUFSIZE]; + +if (sim_brk_types == 0) { + if (!silent) { + fprintf (st, "Breakpoints are not supported in the %s simulator\n", sim_name); + if (dptr->help) + dptr->help (st, dptr, NULL, 0, NULL); + } + return; + } +if (brkt == NULL) { + int i; + + if (sim_brk_types & ~sim_brk_dflt) { + fprintf (st, "%s supports the following breakpoint types:\n", sim_dname (dptr)); + for (i=0; i<26; i++) { + if (sim_brk_types & (1<btyp) { + fprintf (st, " %s %s\n", put_switches (gbuf, sizeof(gbuf), brkt->btyp), brkt->desc); + ++brkt; + } +fprintf (st, "The default breakpoint type is: %s\n", put_switches (gbuf, sizeof(gbuf), sim_brk_dflt)); +} + t_stat help_dev_help (FILE *st, DEVICE *dptr, UNIT *uptr, int32 flag, const char *cptr) { char gbuf[CBUFSIZE]; @@ -2461,6 +2495,10 @@ if (*cptr) { fprint_attach_help_ex (st, dptr, FALSE); return SCPE_OK; } + if (cmdp->action == &brk_cmd) { + fprint_brk_help_ex (st, dptr, FALSE); + return SCPE_OK; + } if (dptr->help) return dptr->help (st, dptr, uptr, flag, cptr); fprintf (st, "No %s help is available for the %s device\n", cmdp->name, dptr->name); @@ -2486,6 +2524,7 @@ fprint_set_help_ex (st, dptr, TRUE); fprint_show_help_ex (st, dptr, TRUE); fprint_attach_help_ex (st, dptr, TRUE); fprint_reg_help_ex (st, dptr, TRUE); +fprint_brk_help_ex (st, dptr, TRUE); return SCPE_OK; } @@ -9451,7 +9490,7 @@ if (sim_brk_type_desc) { } } if (!msg[0]) - sprintf (msg, "%s Breakpoint at: %s\n", put_switches (buf , sizeof(buf), sim_brk_match_type), addr); + sprintf (msg, "%s Breakpoint at: %s\n", put_switches (buf, sizeof(buf), sim_brk_match_type), addr); return msg; } diff --git a/sim_defs.h b/sim_defs.h index 9c6ffa27..f8d0f323 100644 --- a/sim_defs.h +++ b/sim_defs.h @@ -467,6 +467,7 @@ struct DEVICE { /* attach help */ void *help_ctx; /* Context available to help routines */ const char *(*description)(DEVICE *dptr); /* Device Description */ + BRKTYPTAB *brk_types; /* Breakpoint types */ }; /* Device flags */