From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27861 invoked by alias); 28 Aug 2012 13:50:06 -0000 Received: (qmail 27849 invoked by uid 22791); 28 Aug 2012 13:50:04 -0000 X-SWARE-Spam-Status: No, hits=-4.4 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL X-Spam-Check-By: sourceware.org Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 28 Aug 2012 13:49:49 +0000 Received: from svr-orw-exc-10.mgc.mentorg.com ([147.34.98.58]) by relay1.mentorg.com with esmtp id 1T6MAr-0005pz-Vm from Yao_Qi@mentor.com ; Tue, 28 Aug 2012 06:49:46 -0700 Received: from SVR-ORW-FEM-03.mgc.mentorg.com ([147.34.97.39]) by SVR-ORW-EXC-10.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.4675); Tue, 28 Aug 2012 06:49:45 -0700 Received: from qiyao.dyndns.org (147.34.91.1) by svr-orw-fem-03.mgc.mentorg.com (147.34.97.39) with Microsoft SMTP Server id 14.1.289.1; Tue, 28 Aug 2012 06:49:44 -0700 Message-ID: <503CCC7A.8040805@codesourcery.com> Date: Tue, 28 Aug 2012 13:50:00 -0000 From: Yao Qi User-Agent: Mozilla/5.0 (X11; Linux i686; rv:14.0) Gecko/20120717 Thunderbird/14.0 MIME-Version: 1.0 To: Pedro Alves CC: Vladimir Prus , 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> <503CB1F0.3020009@cs.msu.su> <503CC302.8060900@codesourcery.com> <503CCA27.7070607@redhat.com> In-Reply-To: <503CCA27.7070607@redhat.com> Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes 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/msg00830.txt.bz2 On 08/28/2012 09:39 PM, Pedro Alves wrote: > > Alternatively, set the notification suppression down in the command callback itself. > I mention it for completeness. Maybe you've considered it, and decided against it. > Are you suggesting that we can set breakpoint suppression flag in each breakpoint related CLI commands, such as "delete breakpoint", "disable breakpoint", and so forth? >> > >> >Ideally, we can do this in a more-OO'ed manner, >> > >> > 1 add a new field 'int called' in 'struct mi_cmd', >> > 2 set 'parse->cmd->called' in mi_cmd_execute to 1 and set it back to 0 when it is done. >> > 3 pass 'struct mi_cmd *' to each MI command function, for example change function mi_breakpoint_created to >> > >> > mi_breakpoint_created (struct mi_cmd *self, struct breakpoint *b) >> > >> > 4 inside each MI command function, return early if self->called is 1. Then, we can get rid of mi_suppress_notification completely. > Confused. mi_breakpoint_created is not a MI command function, but rather a > notification observer. Whoever calls the observers (observer_notify_breakpoint_created) > is disconnected from commands, and I don't see that the coupling would be a good idea. > Oops, my brain stopped working at that moment. Sorry for the confusion, and please ignore it. -- Yao