aboutsummaryrefslogtreecommitdiff
path: root/sim/ppc/psim.c
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2008-06-07 01:31:27 +0000
committerJoseph Myers <joseph@codesourcery.com>2008-06-07 01:31:27 +0000
commit6efef468bed94a730bb0ae60a36ebead70c97f4e (patch)
treec81eb269a4d526f464e8999e1ae3ca030fce662c /sim/ppc/psim.c
parentbf37b8e8125cd1126cdc52e6bb411d70a6bae82b (diff)
downloadgdb-6efef468bed94a730bb0ae60a36ebead70c97f4e.zip
gdb-6efef468bed94a730bb0ae60a36ebead70c97f4e.tar.gz
gdb-6efef468bed94a730bb0ae60a36ebead70c97f4e.tar.bz2
sim:
2008-06-06 Vladimir Prus <vladimir@codesourcery.com> Daniel Jacobowitz <dan@codesourcery.com> Joseph Myers <joseph@codesourcery.com> * cris/configure: Regenerate. sim/common: 2008-06-06 Vladimir Prus <vladimir@codesourcery.com> Daniel Jacobowitz <dan@codesourcery.com> Joseph Myers <joseph@codesourcery.com> * aclocal.m4: Include ../../config/acx.m4. * common.m4: Use ACX_PKGVERSION and ACX_BUGURL. * configure, config.in: Regenerate. * Make-common.in (LIB_OBJS): Add version.o. (version.c, version.o): New rules. * run.c: Include version.h. (usage): Add help parameter. Print output either to stdout or stderr depending on that parameter. (print_version): New. (main): Check for --help and --version. * run-sim.h (sim_target_display_usage): Add help parameter. * version.h: New. sim/arm: 2008-06-06 Vladimir Prus <vladimir@codesourcery.com> Daniel Jacobowitz <dan@codesourcery.com> Joseph Myers <joseph@codesourcery.com> * configure: Regenerate. * wrapper.c (sim_target_display_usage): Add help parameter. sim/cr16: 2008-06-06 Vladimir Prus <vladimir@codesourcery.com> Daniel Jacobowitz <dan@codesourcery.com> Joseph Myers <joseph@codesourcery.com> * configure: Regenerate. sim/d10v: 2008-06-06 Vladimir Prus <vladimir@codesourcery.com> Daniel Jacobowitz <dan@codesourcery.com> Joseph Myers <joseph@codesourcery.com> * configure: Regenerate. sim/erc32: 2008-06-06 Vladimir Prus <vladimir@codesourcery.com> Daniel Jacobowitz <dan@codesourcery.com> Joseph Myers <joseph@codesourcery.com> * configure: Regenerate. sim/frv: 2008-06-06 Vladimir Prus <vladimir@codesourcery.com> Daniel Jacobowitz <dan@codesourcery.com> Joseph Myers <joseph@codesourcery.com> * configure: Regenerate. sim/h8300: 2008-06-06 Vladimir Prus <vladimir@codesourcery.com> Daniel Jacobowitz <dan@codesourcery.com> Joseph Myers <joseph@codesourcery.com> * configure: Regenerate. sim/iq2000: 2008-06-06 Vladimir Prus <vladimir@codesourcery.com> Daniel Jacobowitz <dan@codesourcery.com> Joseph Myers <joseph@codesourcery.com> * configure: Regenerate. sim/m32c: 2008-06-06 Vladimir Prus <vladimir@codesourcery.com> Daniel Jacobowitz <dan@codesourcery.com> Joseph Myers <joseph@codesourcery.com> * configure: Regenerate. sim/m32r: 2008-06-06 Vladimir Prus <vladimir@codesourcery.com> Daniel Jacobowitz <dan@codesourcery.com> Joseph Myers <joseph@codesourcery.com> * configure: Regenerate. sim/m68hc11: 2008-06-06 Vladimir Prus <vladimir@codesourcery.com> Daniel Jacobowitz <dan@codesourcery.com> Joseph Myers <joseph@codesourcery.com> * configure: Regenerate. sim/mcore: 2008-06-06 Vladimir Prus <vladimir@codesourcery.com> Daniel Jacobowitz <dan@codesourcery.com> Joseph Myers <joseph@codesourcery.com> * configure: Regenerate. sim/mips: 2008-06-06 Vladimir Prus <vladimir@codesourcery.com> Daniel Jacobowitz <dan@codesourcery.com> Joseph Myers <joseph@codesourcery.com> * configure: Regenerate. sim/mn10300: 2008-06-06 Vladimir Prus <vladimir@codesourcery.com> Daniel Jacobowitz <dan@codesourcery.com> Joseph Myers <joseph@codesourcery.com> * configure: Regenerate. sim/ppc: 2008-06-06 Vladimir Prus <vladimir@codesourcery.com> Daniel Jacobowitz <dan@codesourcery.com> Joseph Myers <joseph@codesourcery.com> * configure.ac: Use ACX_PKGVERSION and ACX_BUGURL. * configure, config.in: Regenerated. * Makefile.in (LIB_OBJ): Add version.o. (version.c, version.o): New rules. * psim.c (psim_usage): Add help parameter. Print the bug URL. Exit with code 0 for help. (psim_options): Update calls to psim_usage. Handle --help and --version. * psim.h (psim_usage): Update prototype. * main.c (main): Update psim_usage call. sim/sh: 2008-06-06 Vladimir Prus <vladimir@codesourcery.com> Daniel Jacobowitz <dan@codesourcery.com> Joseph Myers <joseph@codesourcery.com> * configure: Regenerate. sim/sh64: 2008-06-06 Vladimir Prus <vladimir@codesourcery.com> Daniel Jacobowitz <dan@codesourcery.com> Joseph Myers <joseph@codesourcery.com> * configure: Regenerate. sim/v850: 2008-06-06 Vladimir Prus <vladimir@codesourcery.com> Daniel Jacobowitz <dan@codesourcery.com> Joseph Myers <joseph@codesourcery.com> * configure: Regenerate.
Diffstat (limited to 'sim/ppc/psim.c')
-rw-r--r--sim/ppc/psim.c23
1 files changed, 17 insertions, 6 deletions
diff --git a/sim/ppc/psim.c b/sim/ppc/psim.c
index be9d076..c311794 100644
--- a/sim/ppc/psim.c
+++ b/sim/ppc/psim.c
@@ -119,7 +119,7 @@ find_arg(char *err_msg,
INLINE_PSIM\
(void)
-psim_usage(int verbose)
+psim_usage(int verbose, int help)
{
printf_filtered("Usage:\n");
printf_filtered("\n");
@@ -217,7 +217,10 @@ psim_usage(int verbose)
printf_filtered("\n");
print_options();
}
- error("");
+
+ if (REPORT_BUGS_TO[0])
+ printf ("Report bugs to %s\n", REPORT_BUGS_TO);
+ exit (help ? 0 : 1);
}
/* Test "string" for containing a string of digits that form a number
@@ -258,7 +261,7 @@ psim_options(device *root,
while (*p != '\0') {
switch (*p) {
default:
- psim_usage(0);
+ psim_usage(0, 0);
error ("");
break;
case 'c':
@@ -279,7 +282,7 @@ psim_options(device *root,
else
{
printf_filtered ("Invalid <endian> option for -E (target-endian)\n");
- psim_usage (0);
+ psim_usage (0, 0);
}
break;
case 'f':
@@ -288,10 +291,10 @@ psim_options(device *root,
break;
case 'h':
case '?':
- psim_usage(1);
+ psim_usage(1, 1);
break;
case 'H':
- psim_usage(2);
+ psim_usage(2, 1);
break;
case 'i':
if (isdigit(p[1])) {
@@ -352,6 +355,14 @@ psim_options(device *root,
p = argv[argp] + strlen(argv[argp]) - 1;
printf_filtered("Warning - architecture parameter ignored\n");
}
+ else if (strcmp (argv[argp], "--help") == 0)
+ psim_usage (0, 1);
+ else if (strcmp (argv[argp], "--version") == 0)
+ {
+ extern const char version[];
+ printf ("GNU simulator %s%s\n", PKGVERSION, version);
+ exit (0);
+ }
else
error("Unrecognized option");
break;