aboutsummaryrefslogtreecommitdiff
path: root/sim/sh/interp.c
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>1997-08-25 23:14:25 +0000
committerAndrew Cagney <cagney@redhat.com>1997-08-25 23:14:25 +0000
commit247fccdeb54a09a14287b2e829511803ad9d7cc1 (patch)
treec992df7132ca0c315cbcfd5ad81bbc4f16675936 /sim/sh/interp.c
parent04f295b64859a6c6b01739fc4dd7fddce42db8d9 (diff)
downloadbinutils-247fccdeb54a09a14287b2e829511803ad9d7cc1.zip
binutils-247fccdeb54a09a14287b2e829511803ad9d7cc1.tar.gz
binutils-247fccdeb54a09a14287b2e829511803ad9d7cc1.tar.bz2
Add ABFD argument to sim_open call. Pass through to sim_config so
that image properties such as endianness can be checked. More strongly document the expected behavour of each of the sim_* interfaces. Add default endian argument to simulator config macro SIM_AC_OPTION_ENDIAN. Use in sim_config.
Diffstat (limited to 'sim/sh/interp.c')
-rw-r--r--sim/sh/interp.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/sim/sh/interp.c b/sim/sh/interp.c
index 97c95dc..37e4487 100644
--- a/sim/sh/interp.c
+++ b/sim/sh/interp.c
@@ -1173,19 +1173,32 @@ sim_set_profile_size (n)
}
SIM_DESC
-sim_open (kind,argv)
+sim_open (kind, cb, abfd, argv)
SIM_OPEN_KIND kind;
+ host_callback *cb;
+ struct _bfd *abfd;
char **argv;
{
char **p;
sim_kind = kind;
myname = argv[0];
+ callback = cb;
for (p = argv + 1; *p != NULL; ++p)
{
if (strcmp (*p, "-E") == 0)
- little_endian_p = strcmp (*++p, "big") != 0;
+ {
+ ++p;
+ if (*p == NULL)
+ {
+ /* FIXME: This doesn't use stderr, but then the rest of the
+ file doesn't either. */
+ callback->printf_filtered (callback, "Missing argument to `-E'.\n");
+ return 0;
+ }
+ little_endian_p = strcmp (*p, "big") != 0;
+ }
else if (isdigit (**p))
parse_and_set_memory_size (*p);
}
@@ -1282,8 +1295,7 @@ sim_do_command (sd, cmd)
}
void
-sim_set_callbacks (sd, p)
- SIM_DESC sd;
+sim_set_callbacks (p)
host_callback *p;
{
callback = p;