From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27839 invoked by alias); 31 Jul 2013 14:44:16 -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 27782 invoked by uid 89); 31 Jul 2013 14:44:16 -0000 X-Spam-SWARE-Status: No, score=-6.9 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL,RDNS_NONE,SPF_HELO_PASS,SPF_PASS autolearn=no version=3.3.1 Received: from Unknown (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Wed, 31 Jul 2013 14:44:16 +0000 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r6VEi8Xf024292 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 31 Jul 2013 10:44:08 -0400 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r6VEi6XM001498; Wed, 31 Jul 2013 10:44:07 -0400 Message-ID: <51F922B6.4090200@redhat.com> Date: Wed, 31 Jul 2013 14:44:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130625 Thunderbird/17.0.7 MIME-Version: 1.0 To: Andrew Burgess CC: gdb-patches@sourceware.org Subject: Re: [PATCH 2/4] Remove deprecated_throw_reason from mips_error. References: <51F7E51E.3070807@broadcom.com> <51F7E5A4.5090106@broadcom.com> <51F81092.4050003@redhat.com> <51F904AB.3070007@broadcom.com> In-Reply-To: <51F904AB.3070007@broadcom.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-SW-Source: 2013-07/txt/msg00821.txt.bz2 On 07/31/2013 01:35 PM, Andrew Burgess wrote: > On 30/07/2013 8:14 PM, Pedro Alves wrote: > >> I'd suggest removing or merging the earlier printf_unfiltered with >> the error message, they're a bit redundant, and having the text >> in the error is better in that a frontend usually displays errors >> in a special way (a messagebox or some such), while console prints >> end up hidden in the console... > > So, following the advice in your second paragraph I've got a new patch > below, given that it's totally different to the first I'm reposting for > a review before committing. Thanks. > The only testing I've done of this code is to compile it > (--enable-targets=all), then add in a fake call to mips_error > and check that the output looks reasonable. I think that's good enough. One would hope that whoever still uses this target tests it routinely. > I've removed the use of error_pre_print given that all the output > is now passing through throw_verror, I assume that does the "correct" > thing, though interestingly I notice that error_pre_print, and > quit_pre_print are no longer used anywhere after this patch.... Interesting. Time to garbage collect them, then. > - deprecated_throw_reason (RETURN_ERROR); > + status = asprintf (&fmt, "Ending remote MIPS debugging: %s", string); Can you add i18n/_(), while at it? Don't use asprintf, use xstrprintf instead. (The ARI would complain). But, this is just concatenating the strings, so: fmt = concat (_("Ending remote MIPS debugging: "), string, (char *) NULL); make_cleanup (xfree, fmt); ... is even simpler. concat never returns NULL. OK with that change. -- Pedro Alves