From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9139 invoked by alias); 4 Dec 2012 04:45:38 -0000 Received: (qmail 8925 invoked by uid 22791); 4 Dec 2012 04:45:32 -0000 X-SWARE-Spam-Status: No, hits=-4.5 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, 04 Dec 2012 04:45:18 +0000 Received: from svr-orw-fem-01.mgc.mentorg.com ([147.34.98.93]) by relay1.mentorg.com with esmtp id 1TfkNh-0006ru-PK from Yao_Qi@mentor.com for gdb-patches@sourceware.org; Mon, 03 Dec 2012 20:45:17 -0800 Received: from SVR-ORW-FEM-02.mgc.mentorg.com ([147.34.96.206]) by svr-orw-fem-01.mgc.mentorg.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Mon, 3 Dec 2012 20:45:17 -0800 Received: from qiyao.dyndns.org.dyndns.org (147.34.91.1) by svr-orw-fem-02.mgc.mentorg.com (147.34.96.168) with Microsoft SMTP Server id 14.1.289.1; Mon, 3 Dec 2012 20:45:16 -0800 From: Yao Qi To: Subject: [PATCH 3/6] Notify breakpoint-modified when tracepoints are downloaded. Date: Tue, 04 Dec 2012 04:45:00 -0000 Message-ID: <1354596282-32526-4-git-send-email-yao@codesourcery.com> In-Reply-To: <1354596282-32526-1-git-send-email-yao@codesourcery.com> References: <1354596282-32526-1-git-send-email-yao@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain 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-12/txt/msg00051.txt.bz2 When any location of a tracepoint is downloaded, notify 'breakpoint-modified' observer. gdb: 2012-12-03 Yao Qi * breakpoint.c (download_tracepoint_locations): Notify 'breakpoint-modified' observer if any tracepoint location is downloaded. * tracepoint.c (start_tracing): Likewise. --- gdb/breakpoint.c | 4 ++++ gdb/tracepoint.c | 5 +++++ 2 files changed, 9 insertions(+), 0 deletions(-) diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index 3f2f0c9..56eeb35 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -12090,6 +12090,7 @@ download_tracepoint_locations (void) { struct bp_location *bl; struct tracepoint *t; + int bp_location_downloaded = 0; if ((b->type == bp_fast_tracepoint ? !may_insert_fast_tracepoints @@ -12109,9 +12110,12 @@ download_tracepoint_locations (void) target_download_tracepoint (bl); bl->inserted = 1; + bp_location_downloaded = 1; } t = (struct tracepoint *) b; t->number_on_target = b->number; + if (bp_location_downloaded) + observer_notify_breakpoint_modified (b); } do_cleanups (old_chain); diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c index 912341a..c467b9c 100644 --- a/gdb/tracepoint.c +++ b/gdb/tracepoint.c @@ -1767,6 +1767,7 @@ start_tracing (char *notes) { struct tracepoint *t = (struct tracepoint *) b; struct bp_location *loc; + int bp_location_downloaded = 0; /* Clear `inserted' flag. */ for (loc = b->loc; loc; loc = loc->next) @@ -1788,6 +1789,7 @@ start_tracing (char *notes) target_download_tracepoint (loc); loc->inserted = 1; + bp_location_downloaded = 1; } t->number_on_target = b->number; @@ -1795,6 +1797,9 @@ start_tracing (char *notes) for (loc = b->loc; loc; loc = loc->next) if (loc->probe != NULL) loc->probe->pops->set_semaphore (loc->probe, loc->gdbarch); + + if (bp_location_downloaded) + observer_notify_breakpoint_modified (b); } VEC_free (breakpoint_p, tp_vec); -- 1.7.7.6