[PATCH] Add method/format information to =record-started

Simon Marchi simon.marchi@ericsson.com
Tue Jun 7 12:53:00 GMT 2016


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?








More information about the Gdb-patches mailing list