From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30831 invoked by alias); 7 Nov 2012 18:13:40 -0000 Received: (qmail 30820 invoked by uid 22791); 7 Nov 2012 18:13:38 -0000 X-SWARE-Spam-Status: No, hits=-7.7 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_SPAMHAUS_DROP,KHOP_THREADED,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,RP_MATCHES_RCVD,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 07 Nov 2012 18:13:29 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id qA7IDSrL025429 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 7 Nov 2012 13:13:28 -0500 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id qA7IDQtL005330; Wed, 7 Nov 2012 13:13:27 -0500 Message-ID: <509AA4C6.2030102@redhat.com> Date: Wed, 07 Nov 2012 18:13:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20121016 Thunderbird/16.0.1 MIME-Version: 1.0 To: Yao Qi CC: gdb-patches@sourceware.org Subject: Re: [PATCH] Add breakpoint_created observer to update tracepoint_count. References: <1352249397-15044-1-git-send-email-yao@codesourcery.com> In-Reply-To: <1352249397-15044-1-git-send-email-yao@codesourcery.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 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-11/txt/msg00160.txt.bz2 On 11/07/2012 12:49 AM, Yao Qi wrote: > Hi, > I noticed a bug that 'tracepoint_count' is out of date if tracepoint > is created by MI command '-break-insert -a'. This patch is to > install 'update_tracepoint_count' to observer 'breakpoint_created', > and 'update_tracepoint_count' can update 'tracepoint_count' if B > is a tracepoint. > > Regression tested on x86_64-linux. Is it OK? > No need to install an observer for a notification that is emitted in the same module the new observer is in. This is internals of the breakpoints module. All set_breakpoint_count's calls are centralized in install_breakpoint, through set_breakpoint_number. All but break-range's, that is. I don't recall why that doesn't use install_breakpoint. Maybe it should. We should be able to put 'if (is_tracepoint) set_tracepoint_count()' in install_breakpoint too. -- Pedro Alves