if (sim_create_inferior (sd, abfd, prog_args, NULL) == SIM_RC_FAIL)
exit (1);
- prev_sigint = signal (SIGINT, cntrl_c);
if (trace)
{
int done = 0;
+ prev_sigint = signal (SIGINT, cntrl_c);
while (!done)
{
done = sim_trace (sd);
}
+ signal (SIGINT, prev_sigint);
}
else
{
- sim_resume (sd, 0, 0);
+ do
+ {
+ prev_sigint = signal (SIGINT, cntrl_c);
+ sim_resume (sd, 0, sigrc);
+ signal (SIGINT, prev_sigint);
+ sim_stop_reason (sd, &reason, &sigrc);
+ }
+ while (reason == sim_stopped && sigrc != SIGINT);
}
- signal (SIGINT, prev_sigint);
if (verbose)
sim_info (sd, 0);
-
- sim_stop_reason (sd, &reason, &sigrc);
-
sim_close (sd, 0);
/* If reason is sim_exited, then sigrc holds the exit code which we want
return val;
}
-/* Modify registers according to an AE - address exception. */
-static void
-address_exception (void)
-{
- SET_BPC (PC);
- SET_BPSW (PSW);
- SET_HW_PSW ((PSW & (PSW_F0_BIT | PSW_F1_BIT | PSW_C_BIT)));
- JMP (AE_VECTOR_START);
-}
-
#ifdef DEBUG
static void trace_input_func PARAMS ((char *name,
enum op_types in1,
trace_input ("ld", OP_REG_OUTPUT, OP_MEMREF2, OP_VOID);
if ((addr & 1))
{
- address_exception ();
+ State.exception = SIG_D10V_BUS;
+ State.pc_changed = 1; /* Don't increment the PC. */
trace_output_void ();
return;
}
trace_input ("ld", OP_REG_OUTPUT, OP_POSTDEC, OP_VOID);
if ((addr & 1))
{
- address_exception ();
+ State.exception = SIG_D10V_BUS;
+ State.pc_changed = 1; /* Don't increment the PC. */
trace_output_void ();
return;
}
trace_input ("ld", OP_REG_OUTPUT, OP_POSTINC, OP_VOID);
if ((addr & 1))
{
- address_exception ();
+ State.exception = SIG_D10V_BUS;
+ State.pc_changed = 1; /* Don't increment the PC. */
trace_output_void ();
return;
}
trace_input ("ld", OP_REG_OUTPUT, OP_MEMREF, OP_VOID);
if ((addr & 1))
{
- address_exception ();
+ State.exception = SIG_D10V_BUS;
+ State.pc_changed = 1; /* Don't increment the PC. */
trace_output_void ();
return;
}
trace_input ("ld", OP_REG_OUTPUT, OP_MEMREF3, OP_VOID);
if ((addr & 1))
{
- address_exception ();
+ State.exception = SIG_D10V_BUS;
+ State.pc_changed = 1; /* Don't increment the PC. */
trace_output_void ();
return;
}
trace_input ("ld2w", OP_REG_OUTPUT, OP_MEMREF2, OP_VOID);
if ((addr & 1))
{
- address_exception ();
+ State.exception = SIG_D10V_BUS;
+ State.pc_changed = 1; /* Don't increment the PC. */
trace_output_void ();
return;
}
trace_input ("ld2w", OP_REG_OUTPUT, OP_POSTDEC, OP_VOID);
if ((addr & 1))
{
- address_exception ();
+ State.exception = SIG_D10V_BUS;
+ State.pc_changed = 1; /* Don't increment the PC. */
trace_output_void ();
return;
}
trace_input ("ld2w", OP_REG_OUTPUT, OP_POSTINC, OP_VOID);
if ((addr & 1))
{
- address_exception ();
+ State.exception = SIG_D10V_BUS;
+ State.pc_changed = 1; /* Don't increment the PC. */
trace_output_void ();
return;
}
trace_input ("ld2w", OP_REG_OUTPUT, OP_MEMREF, OP_VOID);
if ((addr & 1))
{
- address_exception ();
+ State.exception = SIG_D10V_BUS;
+ State.pc_changed = 1; /* Don't increment the PC. */
trace_output_void ();
return;
}
trace_input ("ld2w", OP_REG_OUTPUT, OP_MEMREF3, OP_VOID);
if ((addr & 1))
{
- address_exception ();
+ State.exception = SIG_D10V_BUS;
+ State.pc_changed = 1; /* Don't increment the PC. */
trace_output_void ();
return;
}
trace_input ("st", OP_REG, OP_MEMREF2, OP_VOID);
if ((addr & 1))
{
- address_exception ();
+ State.exception = SIG_D10V_BUS;
+ State.pc_changed = 1; /* Don't increment the PC. */
trace_output_void ();
return;
}
trace_input ("st", OP_REG, OP_MEMREF, OP_VOID);
if ((addr & 1))
{
- address_exception ();
+ State.exception = SIG_D10V_BUS;
+ State.pc_changed = 1; /* Don't increment the PC. */
trace_output_void ();
return;
}
}
if ((addr & 1))
{
- address_exception ();
+ State.exception = SIG_D10V_BUS;
+ State.pc_changed = 1; /* Don't increment the PC. */
trace_output_void ();
return;
}
trace_input ("st", OP_REG, OP_POSTINC, OP_VOID);
if ((addr & 1))
{
- address_exception ();
+ State.exception = SIG_D10V_BUS;
+ State.pc_changed = 1; /* Don't increment the PC. */
trace_output_void ();
return;
}
}
if ((addr & 1))
{
- address_exception ();
+ State.exception = SIG_D10V_BUS;
+ State.pc_changed = 1; /* Don't increment the PC. */
trace_output_void ();
return;
}
trace_input ("st", OP_REG, OP_MEMREF3, OP_VOID);
if ((addr & 1))
{
- address_exception ();
+ State.exception = SIG_D10V_BUS;
+ State.pc_changed = 1; /* Don't increment the PC. */
trace_output_void ();
return;
}
trace_input ("st2w", OP_DREG, OP_MEMREF2, OP_VOID);
if ((addr & 1))
{
- address_exception ();
+ State.exception = SIG_D10V_BUS;
+ State.pc_changed = 1; /* Don't increment the PC. */
trace_output_void ();
return;
}
trace_input ("st2w", OP_DREG, OP_MEMREF, OP_VOID);
if ((addr & 1))
{
- address_exception ();
+ State.exception = SIG_D10V_BUS;
+ State.pc_changed = 1; /* Don't increment the PC. */
trace_output_void ();
return;
}
}
if ((addr & 1))
{
- address_exception ();
+ State.exception = SIG_D10V_BUS;
+ State.pc_changed = 1; /* Don't increment the PC. */
trace_output_void ();
return;
}
trace_input ("st2w", OP_DREG, OP_POSTINC, OP_VOID);
if ((addr & 1))
{
- address_exception ();
+ State.exception = SIG_D10V_BUS;
+ State.pc_changed = 1; /* Don't increment the PC. */
trace_output_void ();
return;
}
}
if ((addr & 1))
{
- address_exception ();
+ State.exception = SIG_D10V_BUS;
+ State.pc_changed = 1; /* Don't increment the PC. */
trace_output_void ();
return;
}
trace_input ("st2w", OP_DREG, OP_MEMREF3, OP_VOID);
if ((addr & 1))
{
- address_exception ();
+ State.exception = SIG_D10V_BUS;
+ State.pc_changed = 1; /* Don't increment the PC. */
trace_output_void ();
return;
}