mirror of
https://github.com/simh/simh.git
synced 2026-01-26 20:12:23 +00:00
ALL simulators with instruction history support: Minor history enhancements
- Issue reasonable error message explaining invalid SET CPU HISTORY=n input - Let SIGINT (^C) abort SHOW HISTORY output
This commit is contained in:
@@ -3929,8 +3929,10 @@ cpu_set_hist(UNIT * uptr, int32 val, CONST char *cptr, void *desc)
|
||||
return SCPE_OK;
|
||||
}
|
||||
lnt = (int32) get_uint(cptr, 10, HIST_MAX, &r);
|
||||
if ((r != SCPE_OK) || (lnt && (lnt < HIST_MIN)))
|
||||
return SCPE_ARG;
|
||||
if (r != SCPE_OK)
|
||||
return sim_messagef (SCPE_ARG, "Invalid Numeric Value: %s. Maximum is %d\n", cptr, HIST_MAX);
|
||||
if (lnt && (lnt < HIST_MIN))
|
||||
return sim_messagef (SCPE_ARG, "%d is less than the minumum history value of %d\n", lnt, HIST_MIN);
|
||||
hst_p = 0;
|
||||
if (hst_lnt) {
|
||||
free(hst);
|
||||
@@ -3974,6 +3976,10 @@ cpu_show_hist(FILE * st, UNIT * uptr, int32 val, CONST void *desc)
|
||||
" X S F R M GH KV Flags"
|
||||
" Q Intruction IAR\n\n");
|
||||
for (k = 0; k < lnt; k++) { /* print specified */
|
||||
if (stop_cpu) { /* Control-C (SIGINT) */
|
||||
stop_cpu = FALSE;
|
||||
break; /* abandon remaining output */
|
||||
}
|
||||
h = &hst[(++di) % hst_lnt]; /* entry pointer */
|
||||
if (h->c & HIST_PC) { /* instruction? */
|
||||
int i;
|
||||
|
||||
Reference in New Issue
Block a user