aboutsummaryrefslogtreecommitdiff
path: root/sim/d10v
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
parent9f64f00adaa7fb89b13ed291a778a262260dc409 (diff)
downloadfsf-binutils-gdb-fafce69ab16b45fb1ac6bd2ec5afc8e8dbed0374.zip
fsf-binutils-gdb-fafce69ab16b45fb1ac6bd2ec5afc8e8dbed0374.tar.gz
fsf-binutils-gdb-fafce69ab16b45fb1ac6bd2ec5afc8e8dbed0374.tar.bz2
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')
-rw-r--r--sim/d10v/ChangeLog4
-rw-r--r--sim/d10v/interp.c18
2 files changed, 15 insertions, 7 deletions
diff --git a/sim/d10v/ChangeLog b/sim/d10v/ChangeLog
index b535424..1c315db 100644
--- a/sim/d10v/ChangeLog
+++ b/sim/d10v/ChangeLog
@@ -1,6 +1,10 @@
Tue Aug 26 10:37:49 1997 Andrew Cagney <cagney@b1.cygnus.com>
* interp.c (sim_kill): Delete.
+ (sim_create_inferior): Add ABFD argument.
+ (sim_load): Move setting of PC from here.
+ (sim_create_inferior): To here.
+ (start_address): Delete variable.
Mon Aug 25 17:50:22 1997 Andrew Cagney <cagney@b1.cygnus.com>
diff --git a/sim/d10v/interp.c b/sim/d10v/interp.c
index 0add87a..5dfb100 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;
}