aboutsummaryrefslogtreecommitdiff
path: root/sim/msp430/msp430-sim.c
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2016-01-04 00:25:46 -0500
committerMike Frysinger <vapier@gentoo.org>2016-01-05 14:37:46 -0500
commit402cf0534665db83e19c00f130184e94552a75fb (patch)
tree6397611a1989598ec1822383cfcd78f508a0c6ca /sim/msp430/msp430-sim.c
parent1a846c62626357f9e966ef50917dca3a357c9644 (diff)
downloadgdb-402cf0534665db83e19c00f130184e94552a75fb.zip
gdb-402cf0534665db83e19c00f130184e94552a75fb.tar.gz
gdb-402cf0534665db83e19c00f130184e94552a75fb.tar.bz2
sim: msp430: drop duplicate sim_load_file call
There's no need, or desire, to call sim_load_file from sim_open. The higher levels (gdb/run) take care of calling sim_load for us already.
Diffstat (limited to 'sim/msp430/msp430-sim.c')
-rw-r--r--sim/msp430/msp430-sim.c33
1 files changed, 7 insertions, 26 deletions
diff --git a/sim/msp430/msp430-sim.c b/sim/msp430/msp430-sim.c
index a074587..74a600d 100644
--- a/sim/msp430/msp430-sim.c
+++ b/sim/msp430/msp430-sim.c
@@ -32,16 +32,6 @@
#include "sim-syscall.h"
#include "targ-vals.h"
-static int
-loader_write_mem (SIM_DESC sd,
- SIM_ADDR taddr,
- const unsigned char *buf,
- int bytes)
-{
- SIM_CPU *cpu = MSP430_CPU (sd);
- return sim_core_write_buffer (sd, cpu, write_map, buf, taddr, bytes);
-}
-
static sim_cia
msp430_pc_fetch (SIM_CPU *cpu)
{
@@ -62,6 +52,9 @@ lookup_symbol (SIM_DESC sd, const char *name)
long number_of_symbols = STATE_NUM_SYMBOLS (sd);
long i;
+ if (abfd == NULL)
+ return -1;
+
if (symbol_table == NULL)
{
long storage_needed;
@@ -148,7 +141,6 @@ sim_open (SIM_OPEN_KIND kind,
{
SIM_DESC sd = sim_state_alloc (kind, callback);
char c;
- struct bfd *prog_bfd;
/* Initialise the simulator. */
@@ -198,14 +190,6 @@ sim_open (SIM_OPEN_KIND kind,
return 0;
}
- prog_bfd = sim_load_file (sd, argv[0], callback,
- "the program",
- STATE_PROG_BFD (sd),
- 0 /* verbose */,
- 1 /* use LMA instead of VMA */,
- loader_write_mem);
- /* Allow prog_bfd to be NULL - this is needed by the GDB testsuite. */
-
/* Establish any remaining configuration options. */
if (sim_config (sd) != SIM_RC_OK)
{
@@ -223,13 +207,10 @@ sim_open (SIM_OPEN_KIND kind,
assert (MAX_NR_PROCESSORS == 1);
msp430_initialize_cpu (sd, MSP430_CPU (sd));
- if (prog_bfd != NULL)
- {
- MSP430_CPU (sd)->state.cio_breakpoint = lookup_symbol (sd, "C$$IO$$");
- MSP430_CPU (sd)->state.cio_buffer = lookup_symbol (sd, "__CIOBUF__");
- if (MSP430_CPU (sd)->state.cio_buffer == -1)
- MSP430_CPU (sd)->state.cio_buffer = lookup_symbol (sd, "_CIOBUF_");
- }
+ MSP430_CPU (sd)->state.cio_breakpoint = lookup_symbol (sd, "C$$IO$$");
+ MSP430_CPU (sd)->state.cio_buffer = lookup_symbol (sd, "__CIOBUF__");
+ if (MSP430_CPU (sd)->state.cio_buffer == -1)
+ MSP430_CPU (sd)->state.cio_buffer = lookup_symbol (sd, "_CIOBUF_");
return sd;
}