summaryrefslogtreecommitdiff
path: root/sim/ppc
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/ppc
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/ppc')
-rw-r--r--sim/ppc/ChangeLog4
-rw-r--r--sim/ppc/sim_calls.c19
2 files changed, 14 insertions, 9 deletions
diff --git a/sim/ppc/ChangeLog b/sim/ppc/ChangeLog
index 1b6ad7c64a3..9efa7a81018 100644
--- a/sim/ppc/ChangeLog
+++ b/sim/ppc/ChangeLog
@@ -11,6 +11,10 @@ Wed Aug 27 10:15:48 1997 Andrew Cagney <cagney@b1.cygnus.com>
Tue Aug 26 10:41:35 1997 Andrew Cagney <cagney@b1.cygnus.com>
* sim_calls.c (sim_kill): Delete.
+ (sim_create_inferior): Add ABFD argument.
+ (entry_point): Delete variable.
+ (sim_load): Move setting of PC from here.
+ (sim_create_inferior): To here.
Mon Aug 25 16:17:06 1997 Andrew Cagney <cagney@b1.cygnus.com>
diff --git a/sim/ppc/sim_calls.c b/sim/ppc/sim_calls.c
index 228b7c78132..7b6c4d477db 100644
--- a/sim/ppc/sim_calls.c
+++ b/sim/ppc/sim_calls.c
@@ -53,10 +53,6 @@ static device *root_device;
static const char *register_names[] = REGISTER_NAMES;
static host_callback *callbacks;
-/* For communication between sim_load and sim_create_inferior.
- This can be made to go away, please do. */
-static unsigned_word entry_point;
-
SIM_DESC
sim_open (SIM_OPEN_KIND kind,
host_callback *callback,
@@ -114,9 +110,7 @@ sim_load (SIM_DESC sd, char *prog, bfd *abfd, int from_tty)
psim_init(simulator);
/* get the start address */
- if (abfd != NULL)
- entry_point = bfd_get_start_address (abfd);
- else
+ if (abfd == NULL)
{
abfd = bfd_openr (argv[0], 0);
if (abfd == NULL)
@@ -129,7 +123,6 @@ sim_load (SIM_DESC sd, char *prog, bfd *abfd, int from_tty)
error ("psim: \"%s\" is not an object file: %s\n",
argv[0], errmsg);
}
- entry_point = bfd_get_start_address (abfd);
bfd_close (abfd);
}
@@ -199,10 +192,18 @@ sim_info (SIM_DESC sd, int verbose)
SIM_RC
-sim_create_inferior (SIM_DESC sd, char **argv, char **envp)
+sim_create_inferior (SIM_DESC sd,
+ struct _bfd *abfd,
+ char **argv,
+ char **envp)
{
+ unsigned_word entry_point;
TRACE(trace_gdb, ("sim_create_inferior(start_address=0x%x, ...)\n",
entry_point));
+ if (abfd != NULL)
+ entry_point = bfd_get_start_address (abfd);
+ else
+ entry_point = 0xfff00000; /* ??? */
psim_init(simulator);
psim_stack(simulator, argv, envp);