aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sim/common/ChangeLog5
-rw-r--r--sim/common/sim-options.c21
2 files changed, 26 insertions, 0 deletions
diff --git a/sim/common/ChangeLog b/sim/common/ChangeLog
index 8c2db64..e9c399b 100644
--- a/sim/common/ChangeLog
+++ b/sim/common/ChangeLog
@@ -1,3 +1,8 @@
+Wed Sep 10 13:23:24 1997 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * sim-options.c (OPTION_ARCHITECTURE_INFO): New option.
+ (standard_option_handler): Handle --architecture-info.
+
Tue Sep 9 21:46:46 1997 Felix Lee <flee@cygnus.com>
* sim-core.h (sim_cpu_core): [WITH_XOR_ENDIAN + 1], to avoid
diff --git a/sim/common/sim-options.c b/sim/common/sim-options.c
index 8e8cb2f..17c1402 100644
--- a/sim/common/sim-options.c
+++ b/sim/common/sim-options.c
@@ -88,6 +88,7 @@ static DECLARE_OPTION_HANDLER (standard_option_handler);
#define OPTION_DO_COMMAND (OPTION_START + 2)
#define OPTION_ARCHITECTURE (OPTION_START + 3)
#define OPTION_TARGET (OPTION_START + 4)
+#define OPTION_ARCHITECTURE_INFO (OPTION_START + 5)
static const OPTION standard_options[] =
{
@@ -134,6 +135,12 @@ static const OPTION standard_options[] =
{ {"architecture", required_argument, NULL, OPTION_ARCHITECTURE},
'\0', "MACHINE", "Specify the architecture to use",
standard_option_handler },
+ { {"architecture-info", no_argument, NULL, OPTION_ARCHITECTURE_INFO},
+ '\0', NULL, "List supported architectures",
+ standard_option_handler },
+ { {"info-architecture", no_argument, NULL, OPTION_ARCHITECTURE_INFO},
+ '\0', NULL, NULL,
+ standard_option_handler },
{ {"target", required_argument, NULL, OPTION_TARGET},
'\0', "BFDNAME", "Specify the object-code format for the object files",
@@ -262,6 +269,20 @@ standard_option_handler (sd, opt, arg, is_command)
break;
}
+ case OPTION_ARCHITECTURE_INFO:
+ {
+ const char **list = bfd_arch_list();
+ const char **lp;
+ if (list == NULL)
+ abort ();
+ sim_io_printf (sd, "Valid architectures:");
+ for (lp = list; *lp != NULL; lp++)
+ sim_io_printf (sd, " %s", *lp);
+ sim_io_printf (sd, "\n");
+ free (list);
+ break;
+ }
+
case OPTION_TARGET:
{
STATE_TARGET (sd) = xstrdup (arg);