This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Add method/format information to =record-started
- From: Simon Marchi <simon dot marchi at ericsson dot com>
- To: Yao Qi <qiyaoltc at gmail dot com>
- Cc: "Metzger, Markus T" <markus dot t dot metzger at intel dot com>, "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>
- Date: Tue, 7 Jun 2016 08:53:33 -0400
- Subject: Re: [PATCH] Add method/format information to =record-started
- Authentication-results: sourceware.org; auth=none
- References: <20160603155220 dot 22286-1-simon dot marchi at ericsson dot com> <A78C989F6D9628469189715575E55B23332EAEF5 at IRSMSX104 dot ger dot corp dot intel dot com> <86ziqywju7 dot fsf at gmail dot com> <57557992 dot 90908 at ericsson dot com> <86inxlwdhv dot fsf at gmail dot com>
On 16-06-07 05:32 AM, Yao Qi wrote:
> Simon Marchi <simon.marchi@ericsson.com> writes:
>
>> Just to be clear, the inner if/else doesn't need them, but the outer one does.
>>
>
> No, it is not "GDB C Coding Standard" compliant, IMO. In the quoted url
> I gave,
>
> "Any two or more lines in code should be wrapped in braces, even if they
> are comments, as they look like separate statements:"
Ahh ok, I thought braces were only needed in the case where you added a comment.
> so...
>
>> Here's the result:
>>
>>
>> if (started)
>> {
>> if (format != NULL)
>
> brace is needed here...
>
>> fprintf_unfiltered (
>> mi->event_channel,
>> "record-started,thread-group=\"i%d\",method=\"%s\",format=\"%s\"",
>> inferior->num, method, format);
>
> and here
>
>> else
>> fprintf_unfiltered (
>> mi->event_channel,
>> "record-started,thread-group=\"i%d\",method=\"%s\"",
>> inferior->num, method);
>> }
>> else
>> fprintf_unfiltered (mi->event_channel,
>> "record-stopped,thread-group=\"i%d\"", inferior->num);
I suppose here too?