aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGary Benson <gbenson@redhat.com>2014-08-05 16:12:01 +0100
committerGary Benson <gbenson@redhat.com>2014-08-29 10:12:04 +0100
commit91b35fd05c777ffba9b1738711d470977779c687 (patch)
treeae134bd75a5a2177c92fabadb4051a9c375ab6b0
parentb1ec390e096983dea311a853c412494a4991153e (diff)
downloadgdb-91b35fd05c777ffba9b1738711d470977779c687.zip
gdb-91b35fd05c777ffba9b1738711d470977779c687.tar.gz
gdb-91b35fd05c777ffba9b1738711d470977779c687.tar.bz2
Replace all usage errors with calls to error
This commit replaces the hardwired fprintf/exit error handlers for usage errors with calls to error. gdb/ChangeLog: * main.c (captured_main): Handle usage errors with error.
-rw-r--r--gdb/ChangeLog4
-rw-r--r--gdb/main.c40
2 files changed, 14 insertions, 30 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index dd5e080..3c2b114 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,9 @@
2014-08-29 Gary Benson <gbenson@redhat.com>
+ * main.c (captured_main): Handle usage errors with error.
+
+2014-08-29 Gary Benson <gbenson@redhat.com>
+
* go32-nat.c (go32_create_inferior): Replace a fprintf/
exit pair with a call to error. Wrap the message with _().
diff --git a/gdb/main.c b/gdb/main.c
index 415b900..d2e3d5e 100644
--- a/gdb/main.c
+++ b/gdb/main.c
@@ -687,10 +687,7 @@ captured_main (void *data)
xfree (interpreter_p);
interpreter_p = xstrdup (INTERP_TUI);
#else
- fprintf_unfiltered (gdb_stderr,
- _("%s: TUI mode is not supported\n"),
- argv[0]);
- exit (1);
+ error (_("%s: TUI mode is not supported"), gdb_program_name);
#endif
break;
case OPT_WINDOWS:
@@ -756,13 +753,8 @@ captured_main (void *data)
break;
case 'D':
if (optarg[0] == '\0')
- {
- fprintf_unfiltered (gdb_stderr,
- _("%s: empty path for"
- " `--data-directory'\n"),
- argv[0]);
- exit (1);
- }
+ error (_("%s: empty path for `--data-directory'"),
+ gdb_program_name);
set_gdb_data_directory (optarg);
gdb_datadir_provided = 1;
break;
@@ -772,13 +764,8 @@ captured_main (void *data)
extern int gdbtk_test (char *);
if (!gdbtk_test (optarg))
- {
- fprintf_unfiltered (gdb_stderr,
- _("%s: unable to load "
- "tclcommand file \"%s\""),
- argv[0], optarg);
- exit (1);
- }
+ error (_("%s: unable to load tclcommand file \"%s\""),
+ gdb_program_name, optarg);
break;
}
case 'y':
@@ -851,11 +838,8 @@ captured_main (void *data)
break;
case '?':
- fprintf_unfiltered (gdb_stderr,
- _("Use `%s --help' for a "
- "complete list of options.\n"),
- argv[0]);
- exit (1);
+ error (_("Use `%s --help' for a complete list of options."),
+ gdb_program_name);
}
}
@@ -878,13 +862,9 @@ captured_main (void *data)
inferior. The first one is the sym/exec file, and the rest
are arguments. */
if (optind >= argc)
- {
- fprintf_unfiltered (gdb_stderr,
- _("%s: `--args' specified but "
- "no program specified\n"),
- argv[0]);
- exit (1);
- }
+ error (_("%s: `--args' specified but no program specified"),
+ gdb_program_name);
+
symarg = argv[optind];
execarg = argv[optind];
++optind;