Add option architecture-info to list supported architectures.

This commit is contained in:
Andrew Cagney 1997-09-10 05:16:34 +00:00
parent 318b499d8e
commit d0b59aa593
2 changed files with 26 additions and 0 deletions

View File

@ -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

View File

@ -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);