aboutsummaryrefslogtreecommitdiff
path: root/sim/sh/interp.c
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2015-04-17 02:16:10 -0400
committerMike Frysinger <vapier@gentoo.org>2015-04-17 02:22:16 -0400
commit27b97b40bca216097d16d53fa9408a70cd281479 (patch)
treeb31d55346eb233bc7b163602fdc3339a417923b1 /sim/sh/interp.c
parent0fdc66e16e44210dd7468eb78a9c658d6f0b2b65 (diff)
downloadgdb-27b97b40bca216097d16d53fa9408a70cd281479.zip
gdb-27b97b40bca216097d16d53fa9408a70cd281479.tar.gz
gdb-27b97b40bca216097d16d53fa9408a70cd281479.tar.bz2
sim: arm/cr16/d10v/h8300/microblaze/sh: fill out sim-cpu pc fetch/store helpers
This makes the common sim-cpu logic work.
Diffstat (limited to 'sim/sh/interp.c')
-rw-r--r--sim/sh/interp.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/sim/sh/interp.c b/sim/sh/interp.c
index 13f6e65..2f02e69 100644
--- a/sim/sh/interp.c
+++ b/sim/sh/interp.c
@@ -2373,6 +2373,18 @@ sim_info (SIM_DESC sd, int verbose)
}
}
+static sim_cia
+sh_pc_get (sim_cpu *cpu)
+{
+ return saved_state.asregs.pc;
+}
+
+static void
+sh_pc_set (sim_cpu *cpu, sim_cia pc)
+{
+ saved_state.asregs.pc = pc;
+}
+
static void
free_state (SIM_DESC sd)
{
@@ -2448,6 +2460,15 @@ sim_open (SIM_OPEN_KIND kind, host_callback *cb, struct bfd *abfd, char **argv)
return 0;
}
+ /* CPU specific initialization. */
+ for (i = 0; i < MAX_NR_PROCESSORS; ++i)
+ {
+ SIM_CPU *cpu = STATE_CPU (sd, i);
+
+ CPU_PC_FETCH (cpu) = sh_pc_get;
+ CPU_PC_STORE (cpu) = sh_pc_set;
+ }
+
for (p = argv + 1; *p != NULL; ++p)
{
if (isdigit (**p))