From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 127469 invoked by alias); 6 Jun 2016 13:24:48 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 127460 invoked by uid 89); 6 Jun 2016 13:24:48 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.9 required=5.0 tests=BAYES_00,KAM_LAZY_DOMAIN_SECURITY autolearn=no version=3.3.2 spammy= X-HELO: usplmg21.ericsson.net Received: from usplmg21.ericsson.net (HELO usplmg21.ericsson.net) (198.24.6.65) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Mon, 06 Jun 2016 13:24:38 +0000 Received: from EUSAAHC001.ericsson.se (Unknown_Domain [147.117.188.75]) by usplmg21.ericsson.net (Symantec Mail Security) with SMTP id 91.F4.03614.B5975575; Mon, 6 Jun 2016 15:23:39 +0200 (CEST) Received: from [142.133.110.144] (147.117.188.8) by smtp-am.internal.ericsson.com (147.117.188.77) with Microsoft SMTP Server id 14.3.294.0; Mon, 6 Jun 2016 09:24:34 -0400 Subject: Re: [PATCH] Add method/format information to =record-started To: Yao Qi , "Metzger, Markus T" References: <20160603155220.22286-1-simon.marchi@ericsson.com> <86ziqywju7.fsf@gmail.com> CC: "gdb-patches@sourceware.org" From: Simon Marchi Message-ID: <57557992.90908@ericsson.com> Date: Mon, 06 Jun 2016 13:24:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.8.0 MIME-Version: 1.0 In-Reply-To: <86ziqywju7.fsf@gmail.com> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2016-06/txt/msg00084.txt.bz2 On 16-06-06 09:03 AM, Yao Qi wrote: > "Metzger, Markus T" 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);