SCP: Provide detailed error message when rejecting invalid device DEGUG option

This commit is contained in:
Mark Pizzolato 2018-11-24 06:03:04 -08:00
parent cbe9bba849
commit 712f9c9e3a

7
scp.c
View file

@ -5336,6 +5336,7 @@ int32 flag = flags & 1;
t_bool uflag = ((flags & 2) != 0); t_bool uflag = ((flags & 2) != 0);
char gbuf[CBUFSIZE]; char gbuf[CBUFSIZE];
DEBTAB *dep; DEBTAB *dep;
t_stat r = SCPE_OK;
if ((dptr->flags & DEV_DEBUG) == 0) if ((dptr->flags & DEV_DEBUG) == 0)
return SCPE_NOFNC; return SCPE_NOFNC;
@ -5354,7 +5355,7 @@ if (cptr == NULL) { /* no arguments? */
return SCPE_OK; return SCPE_OK;
} }
if (dptr->debflags == NULL) /* must have table */ if (dptr->debflags == NULL) /* must have table */
return SCPE_ARG; return sim_messagef (SCPE_ARG, "The %s device doesn't have DEBUG options.\n", dptr->name);
while (*cptr) { while (*cptr) {
cptr = get_glyph (cptr, gbuf, ';'); /* get debug flag */ cptr = get_glyph (cptr, gbuf, ';'); /* get debug flag */
for (dep = dptr->debflags; dep->name != NULL; dep++) { for (dep = dptr->debflags; dep->name != NULL; dep++) {
@ -5373,9 +5374,9 @@ while (*cptr) {
} }
} /* end for */ } /* end for */
if (dep->mask == 0) /* no match? */ if (dep->mask == 0) /* no match? */
return SCPE_ARG; r = sim_messagef (SCPE_ARG, "Invalid DEBUG option '%s' for %s device\n", gbuf, dptr->name);
} /* end while */ } /* end while */
return SCPE_OK; return r;
} }
/* Show command */ /* Show command */