aboutsummaryrefslogtreecommitdiff
path: root/sim/common/sim-options.c
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>1997-08-28 09:44:42 +0000
committerAndrew Cagney <cagney@redhat.com>1997-08-28 09:44:42 +0000
commit18c319ae59d5d09bbb31a90b97b8dc03c1761014 (patch)
treed29718d6a31bb9ea8d7dc60b3ae94f3c255e815b /sim/common/sim-options.c
parent88117054103306a68d7879d6f5534bb49a0cffa8 (diff)
downloadgdb-18c319ae59d5d09bbb31a90b97b8dc03c1761014.zip
gdb-18c319ae59d5d09bbb31a90b97b8dc03c1761014.tar.gz
gdb-18c319ae59d5d09bbb31a90b97b8dc03c1761014.tar.bz2
Add --target=BFDTARGET and --architecture=MACHINE options.
Diffstat (limited to 'sim/common/sim-options.c')
-rw-r--r--sim/common/sim-options.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/sim/common/sim-options.c b/sim/common/sim-options.c
index 8ed5f63..8ace37a 100644
--- a/sim/common/sim-options.c
+++ b/sim/common/sim-options.c
@@ -36,6 +36,8 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "sim-io.h"
#include "sim-assert.h"
+#include "bfd.h"
+
/* Add a set of options to the simulator.
TABLE is an array of OPTIONS terminated by a NULL `opt.name' entry.
This is intended to be called by modules in their `install' handler. */
@@ -84,6 +86,8 @@ static DECLARE_OPTION_HANDLER (standard_option_handler);
#define OPTION_DEBUG_INSN (OPTION_START + 0)
#define OPTION_DEBUG_FILE (OPTION_START + 1)
#define OPTION_DO_COMMAND (OPTION_START + 2)
+#define OPTION_ARCHITECTURE (OPTION_START + 3)
+#define OPTION_TARGET (OPTION_START + 4)
static const OPTION standard_options[] =
{
@@ -127,6 +131,14 @@ static const OPTION standard_options[] =
'H', NULL, "Print help information",
standard_option_handler },
+ { {"architecture", required_argument, NULL, OPTION_ARCHITECTURE},
+ '\0', "MACHINE", "Specify the architecture to use",
+ standard_option_handler },
+
+ { {"target", required_argument, NULL, OPTION_TARGET},
+ '\0', "BFDNAME", "Specify the object-code format for the object files",
+ standard_option_handler },
+
{ {NULL, no_argument, NULL, 0}, '\0', NULL, NULL, NULL }
};
@@ -238,6 +250,24 @@ standard_option_handler (sd, opt, arg, is_command)
sim_do_command (sd, arg);
break;
+ case OPTION_ARCHITECTURE:
+ {
+ const struct bfd_arch_info *ap = bfd_scan_arch (arg);
+ if (ap == NULL)
+ {
+ sim_io_eprintf (sd, "Architecture `%s' unknown\n", arg);
+ return SIM_RC_FAIL;
+ }
+ STATE_ARCHITECTURE (sd) = ap;
+ break;
+ }
+
+ case OPTION_TARGET:
+ {
+ STATE_TARGET (sd) = strdup (arg);
+ break;
+ }
+
case 'H':
sim_print_help (sd, is_command);
if (STATE_OPEN_KIND (sd) == SIM_OPEN_STANDALONE)