From 03800ae7253d4bda58cee700bb659dbda3bfc610 Mon Sep 17 00:00:00 2001 From: Mark Pizzolato Date: Tue, 16 Dec 2014 09:02:57 -0800 Subject: [PATCH] SCP: Stop calls VM-provided address printer for PC without REG_VMAD from Dave Bryan OBSERVATION: For a simulator stop, sim_vm_fprint_addr (if defined) is called to print the value of the program counter, regardless of whether or not the register was defined with REG_VMAD. However, displaying the PC value with "examine" calls sim_vm_fprint_addr only if the REG_VMAD flag is present. The displayed value of the PC should be the same in both cases. --- scp.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scp.c b/scp.c index e2a6fcfc..c8dc1c14 100644 --- a/scp.c +++ b/scp.c @@ -5950,7 +5950,7 @@ printf ("\n"); if (unechoed_cmdline) sim_printf("%s> %s\n", do_position(), unechoed_cmdline); fprint_stopped (stdout, r); /* print msg */ -if (sim_log && (sim_log != stdout))) /* log if enabled */ +if (sim_log && (sim_log != stdout)) /* log if enabled */ fprint_stopped (sim_log, r); if (sim_deb && (sim_deb != stdout)) /* log if enabled */ fprint_stopped (sim_deb, r); @@ -5986,10 +5986,10 @@ if (v >= SCPE_BASE) else fprintf (st, "\n%s, %s: ", sim_stop_messages[v], pc->name); pcval = get_rval (pc, 0); -if (sim_vm_fprint_addr) - sim_vm_fprint_addr (st, dptr, (t_addr) pcval); -else fprint_val (st, pcval, pc->radix, pc->width, - pc->flags & REG_FMT); +if ((pc->flags & REG_VMAD) && sim_vm_fprint_addr) /* if reg wants VM-specific printer */ + sim_vm_fprint_addr (st, dptr, (t_addr) pcval); /* call it to print the PC address */ +else fprint_val (st, pcval, pc->radix, pc->width, /* otherwise, print as a numeric value */ + pc->flags & REG_FMT); /* with the radix and formatting specified */ if ((dptr != NULL) && (dptr->examine != NULL)) { for (i = 0; i < sim_emax; i++) sim_eval[i] = 0;