From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7858 invoked by alias); 6 Aug 2014 10:25:08 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 7847 invoked by uid 89); 6 Aug 2014 10:25:07 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Wed, 06 Aug 2014 10:25:06 +0000 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s76ACb2w019226 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 6 Aug 2014 06:12:37 -0400 Received: from blade.nx (ovpn-116-90.ams2.redhat.com [10.36.116.90]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s76ACahn003147 for ; Wed, 6 Aug 2014 06:12:37 -0400 Received: from blade.nx (localhost [127.0.0.1]) by blade.nx (Postfix) with ESMTP id 318FB2640E2 for ; Wed, 6 Aug 2014 11:12:35 +0100 (BST) From: Gary Benson To: gdb-patches@sourceware.org Subject: [PATCH 5/8] Replace hardwired error handler in captured_main Date: Wed, 06 Aug 2014 10:25:00 -0000 Message-Id: <1407319948-2264-6-git-send-email-gbenson@redhat.com> In-Reply-To: <1407319948-2264-1-git-send-email-gbenson@redhat.com> References: <1407319948-2264-1-git-send-email-gbenson@redhat.com> X-IsSubscribed: yes X-SW-Source: 2014-08/txt/msg00075.txt.bz2 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 * 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