From d0b59aa593a44c20fcaedfb42e895395af696cd2 Mon Sep 17 00:00:00 2001 From: Andrew Cagney Date: Wed, 10 Sep 1997 05:16:34 +0000 Subject: [PATCH] Add option architecture-info to list supported architectures. --- sim/common/ChangeLog | 5 +++++ sim/common/sim-options.c | 21 +++++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/sim/common/ChangeLog b/sim/common/ChangeLog index 8c2db64141..e9c399b61d 100644 --- a/sim/common/ChangeLog +++ b/sim/common/ChangeLog @@ -1,3 +1,8 @@ +Wed Sep 10 13:23:24 1997 Andrew Cagney + + * sim-options.c (OPTION_ARCHITECTURE_INFO): New option. + (standard_option_handler): Handle --architecture-info. + Tue Sep 9 21:46:46 1997 Felix Lee * 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 8e8cb2fa7e..17c14025a4 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); -- 2.34.1