SCP, PDP11: Added HELP CPU BREAK to display info about breakpoint types

This commit is contained in:
Mark Pizzolato 2016-10-06 13:25:54 -07:00
parent d4f38d5358
commit cf1e7b9cca
3 changed files with 52 additions and 10 deletions

View file

@ -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;

41
scp.c
View file

@ -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<<i))
fprintf (st, " -%c\n", 'A'+i);
}
}
fprintf (st, "The default breakpoint type is: %s\n", put_switches (gbuf, sizeof(gbuf), sim_brk_dflt));
return;
}
fprintf (st, "%s supports the following breakpoint types:\n", sim_dname (dptr));
while (brkt->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;
}

View file

@ -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 */