aboutsummaryrefslogtreecommitdiff
path: root/sim/h8300
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/h8300
parent9f64f00adaa7fb89b13ed291a778a262260dc409 (diff)
downloadgdb-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/h8300')
-rw-r--r--sim/h8300/ChangeLog5
-rw-r--r--sim/h8300/compile.c16
2 files changed, 19 insertions, 2 deletions
diff --git a/sim/h8300/ChangeLog b/sim/h8300/ChangeLog
index 47b8e22..920424b 100644
--- a/sim/h8300/ChangeLog
+++ b/sim/h8300/ChangeLog
@@ -1,6 +1,11 @@
Tue Aug 26 10:38:43 1997 Andrew Cagney <cagney@b1.cygnus.com>
* compile.c (sim_kill): Delete.
+ (sim_create_inferior): Add ABFD argument.
+ (sim_load): Move setting of PC from here.
+ (sim_create_inferior): To here.
+ (sim_open, sim_load, set_h8300h): Add fixme explaining why much of
+ the sim_load code should be moved to sim_open.
Mon Aug 25 17:50:22 1997 Andrew Cagney <cagney@b1.cygnus.com>
diff --git a/sim/h8300/compile.c b/sim/h8300/compile.c
index 370fe4605..08dbbcc 100644
--- a/sim/h8300/compile.c
+++ b/sim/h8300/compile.c
@@ -2009,6 +2009,9 @@ void
set_h8300h (flag)
int flag;
{
+ /* FIXME: Much of the code in sim_load can be moved to sim_open.
+ This function being replaced by a sim_open:ARGV configuration
+ option */
h8300hmode = flag;
}
@@ -2019,6 +2022,8 @@ sim_open (kind, ptr, abfd, argv)
struct _bfd *abfd;
char **argv;
{
+ /* FIXME: Much of the code in sim_load can be moved here */
+
sim_kind = kind;
myname = argv[0];
sim_callback = ptr;
@@ -2045,6 +2050,9 @@ sim_load (sd, prog, abfd, from_tty)
{
bfd *prog_bfd;
+ /* FIXME: The code below that sets a specific variant of the h8/300
+ being simulated should be moved to sim_open(). */
+
/* See if the file is for the h8/300 or h8/300h. */
/* ??? This may not be the most efficient way. The z8k simulator
does this via a different mechanism (INIT_EXTRA_SYMTAB_INFO). */
@@ -2109,7 +2117,6 @@ sim_load (sd, prog, abfd, from_tty)
return SIM_RC_FAIL;
}
- cpu.pc = bfd_get_start_address (prog_bfd);
/* Close the bfd if we opened it. */
if (abfd == NULL && prog_bfd != NULL)
bfd_close (prog_bfd);
@@ -2117,11 +2124,16 @@ sim_load (sd, prog, abfd, from_tty)
}
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;
{
+ if (abfd != NULL)
+ cpu.pc = bfd_get_start_address (abfd);
+ else
+ cpu.pc = 0;
return SIM_RC_OK;
}