[PATCH 5/8] Replace hardwired error handler in captured_main

Gary Benson gbenson@redhat.com
Wed Aug 6 10:25:00 GMT 2014


If the requested interpreter cannot be set captured_main reports the
error with a hardwired fprintf/exit pair.  A fprintf/exit pair on the
previous line was replaced with a call to error in March 2003
(https://sourceware.org/ml/gdb-patches/2003-03/msg00444.html) but I
found no documentation as to why this particular hardwired handler
was left untouched.  I was also unable to come up with a situation
where error would not be suitable, so I have replaced it with a call
to error.

gdb/
2014-08-05  Gary Benson  <gbenson@redhat.com>

	* main.c (captured_main): Replace a fprintf/exit
	pair with a call to error.  Wrap the message with _().
---
 gdb/ChangeLog |    5 +++++
 gdb/main.c    |    7 +------
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/gdb/main.c b/gdb/main.c
index 06b3c90..2f99157 100644
--- a/gdb/main.c
+++ b/gdb/main.c
@@ -986,12 +986,7 @@ captured_main (void *data)
       error (_("Interpreter `%s' unrecognized"), interpreter_p);
     /* Install it.  */
     if (!interp_set (interp, 1))
-      {
-        fprintf_unfiltered (gdb_stderr,
-			    "Interpreter `%s' failed to initialize.\n",
-                            interpreter_p);
-        exit (1);
-      }
+      error (_("Interpreter `%s' failed to initialize."), interpreter_p);
   }
 
   /* FIXME: cagney/2003-02-03: The big hack (part 2 of 2) that lets
-- 
1.7.1



More information about the Gdb-patches mailing list