/* Model support.
- Copyright (C) 1996, 1997, 1998, 2007, 2008, 2009
- Free Software Foundation, Inc.
+ Copyright (C) 1996-1998, 2007-2012 Free Software Foundation, Inc.
Contributed by Cygnus Support.
This file is part of GDB, the GNU debugger.
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "sim-main.h"
+#include "sim-model.h"
#include "libiberty.h"
#include "sim-options.h"
#include "sim-io.h"
static MODULE_INIT_FN sim_model_init;
-#define OPTION_MODEL (OPTION_START + 0)
+enum {
+ OPTION_MODEL = OPTION_START,
+ OPTION_MODEL_INFO,
+};
static const OPTION model_options[] = {
{ {"model", required_argument, NULL, OPTION_MODEL},
'\0', "MODEL", "Specify model to simulate",
- model_option_handler },
- { {NULL, no_argument, NULL, 0}, '\0', NULL, NULL, NULL }
+ model_option_handler, NULL },
+
+ { {"model-info", no_argument, NULL, OPTION_MODEL_INFO},
+ '\0', NULL, "List selectable models",
+ model_option_handler, NULL },
+ { {"info-model", no_argument, NULL, OPTION_MODEL_INFO},
+ '\0', NULL, NULL,
+ model_option_handler, NULL },
+
+ { {NULL, no_argument, NULL, 0}, '\0', NULL, NULL, NULL, NULL }
};
static SIM_RC
sim_model_set (sd, cpu, model);
break;
}
+
+ case OPTION_MODEL_INFO :
+ {
+ const MACH **machp;
+ const MODEL *model;
+ for (machp = & sim_machs[0]; *machp != NULL; ++machp)
+ {
+ sim_io_printf (sd, "Models for architecture `%s':\n",
+ MACH_NAME (*machp));
+ for (model = MACH_MODELS (*machp); MODEL_NAME (model) != NULL;
+ ++model)
+ sim_io_printf (sd, " %s", MODEL_NAME (model));
+ sim_io_printf (sd, "\n");
+ }
+ break;
+ }
}
return SIM_RC_OK;