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


"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

>> @@ -234,7 +235,8 @@ record_btrace_open (const char *args, int from_tty)
>>  				  NULL);
>>    record_btrace_generating_corefile = 0;
>> 
>> -  observer_notify_record_changed (current_inferior (),  1);
>> +  format = record_btrace_conf.format == BTRACE_FORMAT_PT ? "pt" : "bts";
>
> I'd use a switch here and not assume that format != pt means bts.  If we added
> another format (LBR maybe?) we might miss this.

I agree, otherwise, the patch is good to me.

-- 
Yao (éå)


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