From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 74789 invoked by alias); 7 Jun 2016 12:53:51 -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 74771 invoked by uid 89); 7 Jun 2016 12:53:51 -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=ahh 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; Tue, 07 Jun 2016 12:53:36 +0000 Received: from EUSAAHC002.ericsson.se (Unknown_Domain [147.117.188.78]) by usplmg21.ericsson.net (Symantec Mail Security) with SMTP id 52.78.03614.593C6575; Tue, 7 Jun 2016 14:52:38 +0200 (CEST) Received: from [142.133.110.144] (147.117.188.8) by smtp-am.internal.ericsson.com (147.117.188.80) with Microsoft SMTP Server id 14.3.294.0; Tue, 7 Jun 2016 08:53:33 -0400 Subject: Re: [PATCH] Add method/format information to =record-started To: Yao Qi References: <20160603155220.22286-1-simon.marchi@ericsson.com> <86ziqywju7.fsf@gmail.com> <57557992.90908@ericsson.com> <86inxlwdhv.fsf@gmail.com> CC: "Metzger, Markus T" , "gdb-patches@sourceware.org" From: Simon Marchi Message-ID: <5756C3CD.4070202@ericsson.com> Date: Tue, 07 Jun 2016 12:53: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: <86inxlwdhv.fsf@gmail.com> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2016-06/txt/msg00130.txt.bz2 On 16-06-07 05:32 AM, Yao Qi wrote: > Simon Marchi 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?