From: Gary Benson Date: Tue, 5 Aug 2014 15:12:01 +0000 (+0100) Subject: Replace all usage errors with calls to error X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=91b35fd05c777ffba9b1738711d470977779c687;p=binutils-gdb.git 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. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index dd5e080a679..3c2b1142566 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,7 @@ +2014-08-29 Gary Benson + + * main.c (captured_main): Handle usage errors with error. + 2014-08-29 Gary Benson * go32-nat.c (go32_create_inferior): Replace a fprintf/ diff --git a/gdb/main.c b/gdb/main.c index 415b9005531..d2e3d5e5be7 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;