This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 2/4] Remove deprecated_throw_reason from mips_error.
- From: "Andrew Burgess" <aburgess at broadcom dot com>
- To: gdb-patches at sourceware dot org
- Cc: "Pedro Alves" <palves at redhat dot com>
- Date: Wed, 31 Jul 2013 16:37:43 +0100
- Subject: Re: [PATCH 2/4] Remove deprecated_throw_reason from mips_error.
- References: <51F7E51E dot 3070807 at broadcom dot com> <51F7E5A4 dot 5090106 at broadcom dot com> <51F81092 dot 4050003 at redhat dot com> <51F904AB dot 3070007 at broadcom dot com> <51F922B6 dot 4090200 at redhat dot com>
On 31/07/2013 3:44 PM, Pedro Alves wrote:
> 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.
Committed with the changes you requested.
Thanks,
Andrew