diff options
author | David Edelsohn <dje.gcc@gmail.com> | 1997-04-18 21:32:07 +0000 |
---|---|---|
committer | David Edelsohn <dje.gcc@gmail.com> | 1997-04-18 21:32:07 +0000 |
commit | e65bd1d84394b9739192470f05f742cc2aa196f7 (patch) | |
tree | 1e1fd1a0b84e536a5491ba11eb734aed1e8d85a1 /sim/common/sim-options.c | |
parent | d90f7aa552698f735244940c9d0de6dfebaac049 (diff) | |
download | gdb-e65bd1d84394b9739192470f05f742cc2aa196f7.zip gdb-e65bd1d84394b9739192470f05f742cc2aa196f7.tar.gz gdb-e65bd1d84394b9739192470f05f742cc2aa196f7.tar.bz2 |
* sim-options.c (standard_options): Add --endian.
(standard_option_handler): Likewise.
Diffstat (limited to 'sim/common/sim-options.c')
-rw-r--r-- | sim/common/sim-options.c | 49 |
1 files changed, 47 insertions, 2 deletions
diff --git a/sim/common/sim-options.c b/sim/common/sim-options.c index 7daa498..b4f7d30 100644 --- a/sim/common/sim-options.c +++ b/sim/common/sim-options.c @@ -70,6 +70,17 @@ static DECLARE_OPTION_HANDLER (standard_option_handler); options to another table or use a HAVE_FOO macro to ifdef out unavailable options. */ +/* ??? One might want to conditionally compile out the entries that + aren't enabled. There's a distinction, however, between options a + simulator can't support and options that haven't been configured in. + Certainly options a simulator can't support shouldn't appear in the + output of --help. Whether the same thing applies to options that haven't + been configured in or not isn't something I can get worked up over. + [Note that conditionally compiling them out might simply involve moving + the option to another table.] + If you decide to conditionally compile them out as well, delete this + comment and add a comment saying that that is the rule. */ + #define OPTION_DEBUG_INSN (OPTION_START + 0) #define OPTION_DEBUG_FILE (OPTION_START + 1) #define OPTION_TRACE_INSN (OPTION_START + 2) @@ -92,6 +103,12 @@ static const OPTION standard_options[] = 'v', NULL, "Verbose output", standard_option_handler }, +#if defined (SIM_HAVE_BIENDIAN) /* ??? && WITH_TARGET_BYTE_ORDER == 0 */ + { {"endian", required_argument, NULL, 'E'}, + 'E', "big|little", "Set endianness", + standard_option_handler }, +#endif + { {"debug", no_argument, NULL, 'D'}, 'D', NULL, "Print debugging messages", standard_option_handler }, @@ -138,7 +155,7 @@ static const OPTION standard_options[] = #ifdef SIM_HAVE_SIMCACHE { {"simcache-size", required_argument, NULL, 'c'}, - 'c', "SIM CACHE SIZE", "Specify size of simulator instruction cache", + 'c', "SIM CACHE SIZE", "Specify size of simulator execution cache", standard_option_handler }, #endif @@ -150,7 +167,7 @@ static const OPTION standard_options[] = #ifdef SIM_HAVE_MAX_INSNS { {"max-insns", required_argument, NULL, 'M'}, - 'M', "MAX INSNS", "Specify maximum instructions to execute", + 'M', "MAX INSNS", "Specify maximum number of instructions to execute", standard_option_handler }, #endif @@ -205,6 +222,34 @@ standard_option_handler (sd, opt, arg) STATE_VERBOSE_P (sd) = 1; break; +#ifdef SIM_HAVE_BIENDIAN + case 'E' : + if (strcmp (arg, "big") == 0) + { + if (WITH_TARGET_BYTE_ORDER == LITTLE_ENDIAN) + { + sim_io_eprintf (sd, "Simulator compiled for little endian only.\n"); + return SIM_RC_FAIL; + } + /* FIXME:wip: Need to set something in STATE_CONFIG. */ + } + else if (strcmp (arg, "little") == 0) + { + if (WITH_TARGET_BYTE_ORDER == BIG_ENDIAN) + { + sim_io_eprintf (sd, "Simulator compiled for big endian only.\n"); + return SIM_RC_FAIL; + } + /* FIXME:wip: Need to set something in STATE_CONFIG. */ + } + else + { + sim_io_eprintf (sd, "Invalid endian specification `%s'\n", arg); + return SIM_RC_FAIL; + } + break; +#endif + case 'D' : if (! WITH_DEBUG) sim_io_eprintf (sd, "Debugging not compiled in, `-D' ignored\n"); |