diff options
author | Andrew Cagney <cagney@redhat.com> | 1997-08-27 04:44:41 +0000 |
---|---|---|
committer | Andrew Cagney <cagney@redhat.com> | 1997-08-27 04:44:41 +0000 |
commit | fafce69ab16b45fb1ac6bd2ec5afc8e8dbed0374 (patch) | |
tree | eaab2b03e17f79cd61e73a0b510942da3f20dcc3 /sim/m32r/sim-if.c | |
parent | 9f64f00adaa7fb89b13ed291a778a262260dc409 (diff) | |
download | gdb-fafce69ab16b45fb1ac6bd2ec5afc8e8dbed0374.zip gdb-fafce69ab16b45fb1ac6bd2ec5afc8e8dbed0374.tar.gz 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/m32r/sim-if.c')
-rw-r--r-- | sim/m32r/sim-if.c | 30 |
1 files changed, 6 insertions, 24 deletions
diff --git a/sim/m32r/sim-if.c b/sim/m32r/sim-if.c index 7f4e102..a273347 100644 --- a/sim/m32r/sim-if.c +++ b/sim/m32r/sim-if.c @@ -100,31 +100,9 @@ sim_close (sd, quitting) } SIM_RC -sim_load (sd, prog, abfd, from_tty) - SIM_DESC sd; - char *prog; - bfd *abfd; - int from_tty; -{ - extern bfd *sim_load_file (); /* ??? Don't know where this should live. */ - bfd *prog_bfd; - - prog_bfd = sim_load_file (sd, STATE_MY_NAME (sd), - STATE_CALLBACK (sd), - prog, - /* pass NULL for abfd, we always open our own */ - NULL, - STATE_OPEN_KIND (sd) == SIM_OPEN_DEBUG); - if (prog_bfd == NULL) - return SIM_RC_FAIL; - sim_analyze_program (sd, prog_bfd); - STATE_CPU_CPU (sd, 0)->pc = STATE_START_ADDR (sd); - return SIM_RC_OK; -} - -SIM_RC -sim_create_inferior (sd, argv, envp) +sim_create_inferior (sd, abfd, argv, envp) SIM_DESC sd; + struct _bfd *abfd; char **argv; char **envp; { @@ -132,6 +110,10 @@ sim_create_inferior (sd, argv, envp) STATE_ARGV (sd) = sim_copy_argv (argv); STATE_ENVP (sd) = sim_copy_argv (envp); #endif + if (abfd != NULL) + STATE_CPU_CPU (sd, 0)->pc = bfd_get_start_address (abfd); + else + STATE_CPU_CPU (sd, 0)->pc = 0; return SIM_RC_OK; } |