diff options
author | Mike Frysinger <vapier@gentoo.org> | 2015-04-15 01:22:34 -0400 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2015-04-15 01:25:32 -0400 |
commit | f95f4ed2c4680fea68399691481b277ece11570e (patch) | |
tree | 748d1545cd42a16b83339b64bd02327252079e85 /sim/h8300/compile.c | |
parent | 0ce398f106dac65c3a1d2f7d254213fa652af089 (diff) | |
download | gdb-f95f4ed2c4680fea68399691481b277ece11570e.zip gdb-f95f4ed2c4680fea68399691481b277ece11570e.tar.gz gdb-f95f4ed2c4680fea68399691481b277ece11570e.tar.bz2 |
sim: cris/frv/h8300/iq2000/lm32/m32r/sh64: standardize cpu state
This sets up the sim_state structure and the cpu member to match what we
do in most other sims, and what the common code suggests. This is a step
to unifying on the sim-cpu.o object.
Diffstat (limited to 'sim/h8300/compile.c')
-rw-r--r-- | sim/h8300/compile.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/sim/h8300/compile.c b/sim/h8300/compile.c index 2574168..e14c3ab 100644 --- a/sim/h8300/compile.c +++ b/sim/h8300/compile.c @@ -34,6 +34,7 @@ #include "gdb/sim-h8300.h" #include "sys/stat.h" #include "sys/types.h" +#include "sim-options.h" #ifndef SIGTRAP # define SIGTRAP 5 @@ -4886,7 +4887,14 @@ sim_open (SIM_OPEN_KIND kind, sim_cpu *cpu; sd = sim_state_alloc (kind, callback); - sd->cpu = sim_cpu_alloc (sd, 0); + + /* The cpu data is kept in a separately allocated chunk of memory. */ + if (sim_cpu_alloc_all (sd, 1, /*cgen_cpu_max_extra_bytes ()*/0) != SIM_RC_OK) + { + free_state (sd); + return 0; + } + cpu = STATE_CPU (sd, 0); SIM_ASSERT (STATE_MAGIC (sd) == SIM_MAGIC_NUMBER); sim_state_initialize (sd, cpu); |