aboutsummaryrefslogtreecommitdiff
path: root/sim/tic80/interp.c
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>1997-04-24 12:06:27 +0000
committerAndrew Cagney <cagney@redhat.com>1997-04-24 12:06:27 +0000
commitabe293a0c6db0ad1cff41f857248832324d36f67 (patch)
tree3670ef8760b69101a9515e0fa612859a98f0f6bb /sim/tic80/interp.c
parente5b9ee95f68d936443776321c2260c8d2e5604f9 (diff)
downloadgdb-abe293a0c6db0ad1cff41f857248832324d36f67.zip
gdb-abe293a0c6db0ad1cff41f857248832324d36f67.tar.gz
gdb-abe293a0c6db0ad1cff41f857248832324d36f67.tar.bz2
Enable more instructions.
Diffstat (limited to 'sim/tic80/interp.c')
-rw-r--r--sim/tic80/interp.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/sim/tic80/interp.c b/sim/tic80/interp.c
index 5845e06..fe9b98d 100644
--- a/sim/tic80/interp.c
+++ b/sim/tic80/interp.c
@@ -40,6 +40,7 @@ engine_init (SIM_DESC sd)
void
engine_error (SIM_DESC sd,
+ sim_cpu *cpu,
instruction_address cia,
const char *fmt,
...)
@@ -52,7 +53,7 @@ engine_error (SIM_DESC sd,
if (sd->halt_ok)
{
sim_io_printf (sd, "\n");
- engine_halt (sd, cia, sim_signalled, SIGABRT);
+ engine_halt (sd, cpu, cia, sim_signalled, SIGABRT);
}
else
sim_io_error (sd, " - aborting simulation");
@@ -60,6 +61,7 @@ engine_error (SIM_DESC sd,
void
engine_halt (SIM_DESC sd,
+ sim_cpu *cpu,
instruction_address cia,
enum sim_stop reason,
int siggnal)
@@ -70,18 +72,20 @@ engine_halt (SIM_DESC sd,
sd->siggnal = siggnal;
sd->halt_ok = 0;
sd->restart_ok = 0;
- sd->cpu.cia = cia;
+ if (cpu != NULL)
+ cpu->cia = cia;
longjmp (sd->path_to_halt, 1);
}
void
engine_restart (SIM_DESC sd,
+ sim_cpu *cpu,
instruction_address cia)
{
if (!sd->restart_ok)
sim_io_error (sd, "engine_restart - bad longjmp");
sd->restart_ok = 0;
- sd->cpu.cia = cia;
+ cpu->cia = cia;
longjmp(sd->path_to_restart, 1);
}
@@ -93,10 +97,11 @@ engine_run_until_stop (SIM_DESC sd,
if (!setjmp (sd->path_to_halt))
{
instruction_address cia;
+ sim_cpu *cpu = STATE_CPU (sd, 0);
sd->halt_ok = 1;
setjmp (sd->path_to_restart);
sd->restart_ok = 1;
- cia = STATE_CPU (sd, 0)->cia;
+ cia = cpu->cia;
do
{
if (cia.ip == -1)
@@ -112,6 +117,6 @@ engine_run_until_stop (SIM_DESC sd,
}
}
while (*keep_running);
- engine_halt (sd, cia, sim_stopped, SIGINT);
+ engine_halt (sd, cpu, cia, sim_stopped, SIGINT);
}
}