SCP: Added a mechanism to allow debugging output to display PC values for simulators which don't have a simple register which contains the PC value.

This commit is contained in:
Mark Pizzolato 2013-11-14 10:41:49 -08:00
parent 949aa30bef
commit 600d6f5962
2 changed files with 10 additions and 1 deletions

10
scp.c
View file

@ -342,6 +342,7 @@ void (*sim_vm_post) (t_bool from_scp) = NULL;
CTAB *sim_vm_cmd = NULL;
void (*sim_vm_fprint_addr) (FILE *st, DEVICE *dptr, t_addr addr) = NULL;
t_addr (*sim_vm_parse_addr) (DEVICE *dptr, char *cptr, char **tptr) = NULL;
t_value (*sim_vm_pc_value) (void) = NULL;
/* Prototypes */
@ -1474,6 +1475,8 @@ t_stat echo_cmd (int32 flag, char *cptr)
puts (cptr);
if (sim_log)
fprintf (sim_log, "%s\n", cptr);
if (sim_deb)
fprintf (sim_deb, "\n%s\n", cptr);
return SCPE_OK;
}
@ -6934,7 +6937,12 @@ if (sim_deb_switches & SWMASK ('A')) {
sprintf(tim_t, "%lld.%03d ", (long long)(time_now.tv_sec), (int)(time_now.tv_nsec/1000000));
}
if (sim_deb_switches & SWMASK ('P')) {
t_value val = get_rval (sim_deb_PC, 0);
t_value val;
if (sim_vm_pc_value)
val = (*sim_vm_pc_value)();
else
val = get_rval (sim_deb_PC, 0);
sprintf(pc_s, "-%s:", sim_deb_PC->name);
sprint_val (&pc_s[strlen(pc_s)], val, sim_deb_PC->radix, sim_deb_PC->width, sim_deb_PC->flags & REG_FMT);
}

1
scp.h
View file

@ -201,6 +201,7 @@ extern void (*sim_vm_post) (t_bool from_scp);
extern CTAB *sim_vm_cmd;
extern void (*sim_vm_fprint_addr) (FILE *st, DEVICE *dptr, t_addr addr);
extern t_addr (*sim_vm_parse_addr) (DEVICE *dptr, char *cptr, char **tptr);
extern t_value (*sim_vm_pc_value) (void);
#endif