aboutsummaryrefslogtreecommitdiff
path: root/sim/mips
diff options
context:
space:
mode:
authorBen Elliston <bje@au.ibm.com>2001-02-19 21:57:03 +0000
committerBen Elliston <bje@au.ibm.com>2001-02-19 21:57:03 +0000
commit8030f85769ed93908f16696615ed22242f861eba (patch)
tree4aa4aa6509b8538874927a2f146d5b43fe91cf83 /sim/mips
parent9b0c4aebb4416e91afb9ee6fc66d261a3f04a43c (diff)
downloadgdb-8030f85769ed93908f16696615ed22242f861eba.zip
gdb-8030f85769ed93908f16696615ed22242f861eba.tar.gz
gdb-8030f85769ed93908f16696615ed22242f861eba.tar.bz2
2001-02-19 Ben Elliston <bje@redhat.com>
* sim-main.h (sim_monitor): Return an int. * interp.c (sim_monitor): Add return values. (signal_exception): Handle error conditions from sim_monitor.
Diffstat (limited to 'sim/mips')
-rw-r--r--sim/mips/ChangeLog6
-rw-r--r--sim/mips/interp.c14
-rw-r--r--sim/mips/sim-main.h2
3 files changed, 15 insertions, 7 deletions
diff --git a/sim/mips/ChangeLog b/sim/mips/ChangeLog
index 8a3e458..f3cb609 100644
--- a/sim/mips/ChangeLog
+++ b/sim/mips/ChangeLog
@@ -1,3 +1,9 @@
+2001-02-19 Ben Elliston <bje@redhat.com>
+
+ * sim-main.h (sim_monitor): Return an int.
+ * interp.c (sim_monitor): Add return values.
+ (signal_exception): Handle error conditions from sim_monitor.
+
2001-02-08 Ben Elliston <bje@redhat.com>
* sim-main.c (load_memory): Pass cia to sim_core_read* functions.
diff --git a/sim/mips/interp.c b/sim/mips/interp.c
index 382ad7e..a032763 100644
--- a/sim/mips/interp.c
+++ b/sim/mips/interp.c
@@ -1128,7 +1128,7 @@ Recognized firmware names are: `idt', `pmon', `lsipmon', and `none'.\n",
/* Simple monitor interface (currently setup for the IDT and PMON monitors) */
-void
+int
sim_monitor (SIM_DESC sd,
sim_cpu *cpu,
address_word cia,
@@ -1358,11 +1358,10 @@ sim_monitor (SIM_DESC sd,
}
default:
- sim_io_error (sd, "TODO: sim_monitor(%d) : PC = 0x%s\n",
- reason, pr_addr(cia));
- break;
+ /* Unknown reason. */
+ return 0;
}
- return;
+ return 1;
}
/* Store a word into memory. */
@@ -1713,7 +1712,10 @@ signal_exception (SIM_DESC sd,
perform this magic. */
if ((instruction & RSVD_INSTRUCTION_MASK) == RSVD_INSTRUCTION)
{
- sim_monitor (SD, CPU, cia, ((instruction >> RSVD_INSTRUCTION_ARG_SHIFT) & RSVD_INSTRUCTION_ARG_MASK) );
+ int reason = (instruction >> RSVD_INSTRUCTION_ARG_SHIFT) & RSVD_INSTRUCTION_ARG_MASK;
+ if (!sim_monitor (SD, CPU, cia, reason))
+ sim_io_error (sd, "sim_monitor: unhandled reason = %d, pc = 0x%s\n", reason, pr_addr (cia));
+
/* NOTE: This assumes that a branch-and-link style
instruction was used to enter the vector (which is the
case with the current IDT monitor). */
diff --git a/sim/mips/sim-main.h b/sim/mips/sim-main.h
index 7db51a1..9e87fbf 100644
--- a/sim/mips/sim-main.h
+++ b/sim/mips/sim-main.h
@@ -690,7 +690,7 @@ void decode_coproc PARAMS ((SIM_DESC sd, sim_cpu *cpu, address_word cia, unsigne
#define DecodeCoproc(instruction) \
decode_coproc (SD, CPU, cia, (instruction))
-void sim_monitor (SIM_DESC sd, sim_cpu *cpu, address_word cia, unsigned int arg);
+int sim_monitor (SIM_DESC sd, sim_cpu *cpu, address_word cia, unsigned int arg);