summaryrefslogtreecommitdiff
path: root/sim/d10v/interp.c
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>1997-08-27 04:44:41 +0000
committerAndrew Cagney <cagney@redhat.com>1997-08-27 04:44:41 +0000
commitfafce69ab16b45fb1ac6bd2ec5afc8e8dbed0374 (patch)
treeeaab2b03e17f79cd61e73a0b510942da3f20dcc3 /sim/d10v/interp.c
parent9f64f00adaa7fb89b13ed291a778a262260dc409 (diff)
downloadbinutils-gdb-fafce69ab16b45fb1ac6bd2ec5afc8e8dbed0374.tar.gz
Add ABFD argument to sim_create_inferior. Document.
Add file sim-hload.c - generic load for hardware only simulators. Review each simulators sim_open, sim_load, sim_create_inferior so that they more closely match required behavour.
Diffstat (limited to 'sim/d10v/interp.c')
-rw-r--r--sim/d10v/interp.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/sim/d10v/interp.c b/sim/d10v/interp.c
index 0add87a598f..5dfb100ab26 100644
--- a/sim/d10v/interp.c
+++ b/sim/d10v/interp.c
@@ -14,7 +14,6 @@ enum _leftright { LEFT_FIRST, RIGHT_FIRST };
static char *myname;
static SIM_OPEN_KIND sim_kind;
-static bfd_vma start_address;
int d10v_debug;
host_callback *d10v_callback;
unsigned long ins_type_counters[ (int)INS_MAX ];
@@ -797,20 +796,26 @@ sim_info (sd, verbose)
}
SIM_RC
-sim_create_inferior (sd, argv, env)
+sim_create_inferior (sd, abfd, argv, env)
SIM_DESC sd;
+ struct _bfd *abfd;
char **argv;
char **env;
{
-#ifdef DEBUG
- if (d10v_debug)
- (*d10v_callback->printf_filtered) (d10v_callback, "sim_create_inferior: PC=0x%x\n", start_address);
-#endif
+ bfd_vma start_address;
/* reset all state information */
memset (&State.regs, 0, (int)&State.imem - (int)&State.regs[0]);
/* set PC */
+ if (abfd != NULL)
+ start_address = bfd_get_start_address (prog_bfd);
+ else
+ start_address = 0xffc0 << 2;
+#ifdef DEBUG
+ if (d10v_debug)
+ (*d10v_callback->printf_filtered) (d10v_callback, "sim_create_inferior: PC=0x%lx\n", (long) start_address);
+#endif
PC = start_address >> 2;
/* cpu resets imap0 to 0 and imap1 to 0x7f, but D10V-EVA board */
@@ -924,7 +929,6 @@ sim_load (sd, prog, abfd, from_tty)
sim_kind == SIM_OPEN_DEBUG);
if (prog_bfd == NULL)
return SIM_RC_FAIL;
- start_address = bfd_get_start_address (prog_bfd);
prog_bfd_was_opened_p = abfd == NULL;
return SIM_RC_OK;
}