This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


On 16-06-06 09:03 AM, Yao Qi wrote:
> "Metzger, Markus T" <markus.t.metzger@intel.com> writes:
> 
> Hi Markus,
> Thanks for reviewing the patch....
> 
>>> +      if (format != NULL)
>>> +	{
>>
>> Do we really need braces, here...
>>
> 
> Yes, two or more lines in code should be wrapped in braces.
> https://sourceware.org/gdb/wiki/Internals%20GDB-C-Coding-Standards

Just to be clear, the inner if/else doesn't need them, but the outer one does.

Here's the result:


  if (started)
    {
      if (format != NULL)
	fprintf_unfiltered (
	  mi->event_channel,
	  "record-started,thread-group=\"i%d\",method=\"%s\",format=\"%s\"",
	  inferior->num, method, format);
      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);


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]