From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13866 invoked by alias); 28 Aug 2012 11:57:01 -0000 Received: (qmail 13736 invoked by uid 22791); 28 Aug 2012 11:56:59 -0000 X-SWARE-Spam-Status: No, hits=-3.4 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED X-Spam-Check-By: sourceware.org Received: from lvk-gate.cmc.msu.ru (HELO mail.lvk.cs.msu.su) (188.44.42.233) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 28 Aug 2012 11:56:41 +0000 Received: from mail.lvk.cs.msu.su (localhost [127.0.0.1]) by mail.lvk.cs.msu.su (Postfix) with ESMTP id 7A6311C2CD; Tue, 28 Aug 2012 15:56:32 +0400 (MSK) X-Spam-ASN: Received: from [192.168.131.141] (gate.lvknet [192.168.128.254]) by mail.lvk.cs.msu.su (Postfix) with ESMTPSA id 62ABE119C4; Tue, 28 Aug 2012 15:56:32 +0400 (MSK) Message-ID: <503CB1F0.3020009@cs.msu.su> Date: Tue, 28 Aug 2012 11:57:00 -0000 From: Vladimir Prus User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120714 Thunderbird/14.0 MIME-Version: 1.0 To: Yao Qi CC: gdb-patches@sources.redhat.com Subject: Re: [PATCH 3/3] suppress notification References: <1346060757-30130-1-git-send-email-yao@codesourcery.com> <1346060757-30130-4-git-send-email-yao@codesourcery.com> <503C7A1D.6040909@codesourcery.com> In-Reply-To: <503C7A1D.6040909@codesourcery.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-AV-Checked: ClamAV using ClamSMTP 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 X-SW-Source: 2012-08/txt/msg00827.txt.bz2 On 28.08.2012 11:58, Yao Qi wrote: > On 08/28/2012 05:00 AM, Vladimir Prus wrote: >>> + /* If non-null, the pointer to a flag indicates that this function >>> is being >>> + called. */ >>> + int *called; >> >> But in practice, this is pointer that points to notification that must >> be supressed when this >> command is running. So, at least the comment is misleading. And if some >> other code will >> want to check whether the current command is A, it would have to look at >> notification >> flags. >> > > Although field 'called' is added for notification suppressing, but I don't couple this field to notification suppressing. Ideally, field > 'called' is set to 1 when the command/function is called, as comment says, and set back to 0 when it is done. At this point, it has nothing > to do with notification suppressing, and we use this field to do something else in a free way. > > When we want to suppress notification, we make use of the feature of field 'called'. I am not sure it is misleading. Well, the problem is that this is not a generic mechanism to everybody to know whether command X is presently running -- because this mechanism can set only one variable, and for some commands that variable is already notification flag. > If you still think it is misleading, I'd like to rename variable 'mi_suppress_notification' to 'mi_cmd_called'. WDYT? Would that be any better than just storing the name of current command and check it with strcmp? Yeah, we're back to where we've started. What is the problem we're trying to solve? That strcmp is ugly to type and not entirely efficient? Thanks, Volodya