aboutsummaryrefslogtreecommitdiff
path: root/sim/common
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2002-05-20 14:32:50 +0000
committerNick Clifton <nickc@redhat.com>2002-05-20 14:32:50 +0000
commitde4112fa387b662c7c7a1dd3e334a1274ca54d28 (patch)
tree438cdf28ea4a963c3ee792627ccbd191ed8f0a7a /sim/common
parentc862ae314db936536aea21a7b854c03e6a59431d (diff)
downloadgdb-de4112fa387b662c7c7a1dd3e334a1274ca54d28.zip
gdb-de4112fa387b662c7c7a1dd3e334a1274ca54d28.tar.gz
gdb-de4112fa387b662c7c7a1dd3e334a1274ca54d28.tar.bz2
Add support for target specific command line switches to old-style simualtors.
Make use of this support in the ARM simulator to add a --swi-support= switch to select whcih SWI protocols to emulate.
Diffstat (limited to 'sim/common')
-rw-r--r--sim/common/ChangeLog10
-rw-r--r--sim/common/run-sim.h32
-rw-r--r--sim/common/run.c11
3 files changed, 52 insertions, 1 deletions
diff --git a/sim/common/ChangeLog b/sim/common/ChangeLog
index ee6bd71..65aa6b1 100644
--- a/sim/common/ChangeLog
+++ b/sim/common/ChangeLog
@@ -1,3 +1,13 @@
+2002-05-20 Nick Clifton <nickc@cambridge.redhat.com>
+
+ * run-sim.h: New header. Provide prototypes for functions used
+ between run() and libsim.a which are not used by GDB.
+ * run.c: Include run-sim.h.
+ (main): If SIM_TARGET_SWITCHES is defined call
+ sim_target_parse_command_line.
+ (usage): If SIM_TARGET_SWITCHES is defined call
+ sim_target_display_usage.
+
2002-05-17 Andrey Volkov <avolkov@transas.com>
* run.c: Made h8300s as new target, not h8300h alias.
diff --git a/sim/common/run-sim.h b/sim/common/run-sim.h
new file mode 100644
index 0000000..7792373
--- /dev/null
+++ b/sim/common/run-sim.h
@@ -0,0 +1,32 @@
+/* This file defines the part of the interface between the standalone
+ simaulator program - run - and simulator library - libsim.a - that
+ is not used by GDB. The GDB part is described in include/remote-sim.h.
+
+ Copyright 2002 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#ifdef SIM_TARGET_SWITCHES
+ /* Parse the command line, extracting any target specific switches
+ before the generic simulator code gets a chance to complain
+ about them. Returns the adjusted value of argc. */
+int sim_target_parse_command_line PARAMS ((int, char **));
+
+ /* Display a list of target specific switches supported by this
+ target. */
+void sim_target_display_usage PARAMS ((void));
+#endif
diff --git a/sim/common/run.c b/sim/common/run.c
index 6a21586..874f4b3 100644
--- a/sim/common/run.c
+++ b/sim/common/run.c
@@ -1,5 +1,5 @@
/* run front end support for all the simulators.
- Copyright (C) 1992, 93-96, 1997 Free Software Foundation, Inc.
+ Copyright (C) 1992, 93-96, 1997, 2002 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -46,6 +46,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "callback.h"
#include "remote-sim.h"
#include "ansidecl.h"
+#include "run-sim.h"
static void usage PARAMS ((void));
extern int optind;
@@ -111,6 +112,10 @@ main (ac, av)
default_callback.init (&default_callback);
sim_set_callbacks (&default_callback);
+#ifdef SIM_TARGET_SWITCHES
+ ac = sim_target_parse_command_line (ac, av);
+#endif
+
/* FIXME: This is currently being rewritten to have each simulator
do all argv processing. */
@@ -338,5 +343,9 @@ usage ()
fprintf (stderr, "\n");
fprintf (stderr, "program args Arguments to pass to simulated program.\n");
fprintf (stderr, " Note: Very few simulators support this.\n");
+#ifdef SIM_TARGET_SWITCHES
+ fprintf (stderr, "\nTarget specific options:\n");
+ sim_target_display_usage ();
+#endif
exit (1);
}