aboutsummaryrefslogtreecommitdiff
path: root/sim
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>1997-05-20 00:05:27 +0000
committerAndrew Cagney <cagney@redhat.com>1997-05-20 00:05:27 +0000
commit24aa2b57afc51bb0d47d8a3cfa470ad40a36cc6b (patch)
tree85c51478ecca1050b7fe9f99011a5ede31cdc5ba /sim
parent8c5b6ead7d2880ce708ee185ce3506cda1aeff4d (diff)
downloadgdb-24aa2b57afc51bb0d47d8a3cfa470ad40a36cc6b.zip
gdb-24aa2b57afc51bb0d47d8a3cfa470ad40a36cc6b.tar.gz
gdb-24aa2b57afc51bb0d47d8a3cfa470ad40a36cc6b.tar.bz2
Depreciate sim_set_callbacks() function. Set simulator callbacks
during sim_open().
Diffstat (limited to 'sim')
-rw-r--r--sim/common/run.c22
-rw-r--r--sim/tic80/ChangeLog5
-rw-r--r--sim/tic80/sim-calls.c10
3 files changed, 19 insertions, 18 deletions
diff --git a/sim/common/run.c b/sim/common/run.c
index 9728a32..dff278d 100644
--- a/sim/common/run.c
+++ b/sim/common/run.c
@@ -56,9 +56,6 @@ extern host_callback default_callback;
static char *myname;
-/* bfd descriptor of the executable. Same name as gdb uses. */
-bfd *exec_bfd;
-
/* NOTE: sim_size() and sim_trace() are going away */
extern void sim_size PARAMS ((int i));
@@ -102,8 +99,10 @@ main (ac, av)
/* The first element of sim_open's argv is the program name. */
no_args[0] = av[0];
+#ifdef SIM_HAVE_BIENDIAN
no_args[1] = "-E";
no_args[2] = "set-later";
+#endif
/* FIXME: This is currently being rewritten to have each simulator
do all argv processing. */
@@ -120,10 +119,13 @@ main (ac, av)
{
int len = strlen (av[0]) + strlen (optarg);
char *argbuf = (char *) alloca (len + 2 + 50);
+ sprintf (argbuf, "%s %s", av[0], optarg);
+#ifdef SIM_HAVE_BIENDIAN
/* The desired endianness must be passed to sim_open.
The value for "set-later" is set when we know what it is.
- -e support isn't yet part of the published interface. */
- sprintf (argbuf, "%s %s -E set-later", av[0], optarg);
+ -E support isn't yet part of the published interface. */
+ strcat (argbuf, " -E set-later");
+#endif
sim_argv = buildargv (argbuf);
}
break;
@@ -179,10 +181,7 @@ main (ac, av)
printf ("%s %s\n", myname, name);
}
- sim_set_callbacks (NULL, &default_callback);
- default_callback.init (&default_callback);
-
- exec_bfd = abfd = bfd_openr (name, 0);
+ abfd = bfd_openr (name, 0);
if (!abfd)
{
fprintf (stderr, "%s: can't open %s: %s\n",
@@ -197,6 +196,7 @@ main (ac, av)
exit (1);
}
+#ifdef SIM_HAVE_BIENDIAN
/* The endianness must be passed to sim_open because one may wish to
examine/set registers before calling sim_load [which is the other
place where one can determine endianness]. We previously passed the
@@ -208,10 +208,12 @@ main (ac, av)
sim_argv[i] = "big";
else
sim_argv[i] = "little";
+#endif
/* Ensure that any run-time initialisation that needs to be
performed by the simulator can occur. */
- sd = sim_open (SIM_OPEN_STANDALONE, sim_argv);
+ default_callback.init (&default_callback);
+ sd = sim_open (SIM_OPEN_STANDALONE, &default_callback, sim_argv);
if (sd == 0)
exit (1);
diff --git a/sim/tic80/ChangeLog b/sim/tic80/ChangeLog
index ac4fd96..bd62e58 100644
--- a/sim/tic80/ChangeLog
+++ b/sim/tic80/ChangeLog
@@ -1,3 +1,8 @@
+Tue May 20 09:33:31 1997 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * sim-calls.c (sim_set_callback): Delete.
+ (sim_open): Add/install callback argument.
+
Mon May 19 18:59:33 1997 Mike Meissner <meissner@cygnus.com>
* configure.in: Check for getpid, kill functions.
diff --git a/sim/tic80/sim-calls.c b/sim/tic80/sim-calls.c
index 192d4c4..e62ca13 100644
--- a/sim/tic80/sim-calls.c
+++ b/sim/tic80/sim-calls.c
@@ -50,11 +50,12 @@ struct sim_state simulation = { 0 };
SIM_DESC
-sim_open (SIM_OPEN_KIND kind, char **argv)
+sim_open (SIM_OPEN_KIND kind, struct host_callback_struct *callback, char **argv)
{
SIM_DESC sd = &simulation;
STATE_OPEN_KIND (sd) = kind;
STATE_MAGIC (sd) = SIM_MAGIC_NUMBER;
+ STATE_CALLBACK (&simulation) = callback;
if (sim_pre_argv_init (sd, argv[0]) != SIM_RC_OK)
return 0;
@@ -241,10 +242,3 @@ sim_do_command (SIM_DESC sd, char *cmd)
if (sim_args_command (sd, cmd) != SIM_RC_OK)
sim_io_eprintf (sd, "Unknown command `%s'\n", cmd);
}
-
-
-void
-sim_set_callbacks (SIM_DESC sd, host_callback *callback)
-{
- STATE_CALLBACK (sd) = callback;
-}