From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14556 invoked by alias); 10 Nov 2012 17:51:00 -0000 Received: (qmail 14548 invoked by uid 22791); 10 Nov 2012 17:50:59 -0000 X-SWARE-Spam-Status: No, hits=-7.0 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,SPF_HELO_PASS,TW_BT 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; Sat, 10 Nov 2012 17:50:49 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id qAAHoZkt028446 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sat, 10 Nov 2012 12:50:35 -0500 Received: from valrhona.uglyboxes.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id qAAHoTnl022393 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Sat, 10 Nov 2012 12:50:34 -0500 Message-ID: <509E93E4.3060000@redhat.com> Date: Sat, 10 Nov 2012 17:51:00 -0000 From: Keith Seitz User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120605 Thunderbird/13.0 MIME-Version: 1.0 To: Roland Schwingel CC: insight@sourceware.org Subject: Re: Recent tracepoint changes in gdb References: <5097A647.7070203@onevision.com> <5097DD26.60802@redhat.com> In-Reply-To: <5097DD26.60802@redhat.com> Content-Type: multipart/mixed; boundary="------------010003000506050800090400" X-IsSubscribed: yes Mailing-List: contact insight-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: insight-owner@sourceware.org X-SW-Source: 2012-q4/txt/msg00013.txt.bz2 This is a multi-part message in MIME format. --------------010003000506050800090400 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit Content-length: 560 On 11/05/2012 07:37 AM, Keith Seitz wrote: > Thanks for pointing this out, I will work on a patch. Here is the patch. Let me know if there are any further difficulties. Keith ChangeLog 2012-11-10 Keith Seitz * generic/gdbtk-bp.c (breakpoint_notify): Handle tracepoints, too. (tracepoint_notify): Remove. (gdbtk_create_tracepoint): Remove. (gdbtk_delete_tracepoint): Remove. (gdbtk_modify_tracepoint): Remove. * generic/gdbtk-hooks.c: Remove deleted function extern declarations. (gdbtk_add_hooks): Remove tracepoint observers. --------------010003000506050800090400 Content-Type: text/x-patch; name="rm-tp-observers.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="rm-tp-observers.patch" Content-length: 4876 diff --git a/gdb/gdbtk/generic/gdbtk-bp.c b/gdb/gdbtk/generic/gdbtk-bp.c index 2a0e056..8e752f1 100644 --- a/gdb/gdbtk/generic/gdbtk-bp.c +++ b/gdb/gdbtk/generic/gdbtk-bp.c @@ -109,11 +109,7 @@ static int tracepoint_exists (char *args); void gdbtk_create_breakpoint (struct breakpoint *); void gdbtk_delete_breakpoint (struct breakpoint *); void gdbtk_modify_breakpoint (struct breakpoint *); -void gdbtk_create_tracepoint (int); -void gdbtk_delete_tracepoint (int); -void gdbtk_modify_tracepoint (int); static void breakpoint_notify (int, const char *); -static void tracepoint_notify (int, const char *); int Gdbtk_Breakpoint_Init (Tcl_Interp *interp) @@ -586,7 +582,7 @@ gdbtk_modify_breakpoint (struct breakpoint *b) /* This is the generic function for handling changes in * a breakpoint. It routes the information to the Tcl - * command "gdbtk_tcl_breakpoint" in the form: + * command "gdbtk_tcl_breakpoint" (or "gdbtk_tcl_tracepoint") in the form: * gdbtk_tcl_breakpoint action b_number b_address b_line b_file * On error, the error string is written to gdb_stdout. */ @@ -597,15 +593,29 @@ breakpoint_notify (int num, const char *action) struct breakpoint *b; b = get_breakpoint (num); + if (b == NULL) + { + struct tracepoint *tp; + + tp = get_tracepoint (num); + if (tp == NULL) + return; + b = &tp->base; + } if (b->number < 0 /* FIXME: should not be so restrictive... */ - || b->type != bp_breakpoint) + && b->type != bp_breakpoint + && b->type != bp_tracepoint + && b->type != bp_fast_tracepoint) return; /* We ensure that ACTION contains no special Tcl characters, so we can do this. */ - buf = xstrprintf ("gdbtk_tcl_breakpoint %s %d", action, b->number); + if (b->type == bp_breakpoint) + buf = xstrprintf ("gdbtk_tcl_breakpoint %s %d", action, b->number); + else + buf = xstrprintf ("gdbtk_tcl_tracepoint %s %d", action, b->number); if (Tcl_Eval (gdbtk_interp, buf) != TCL_OK) report_error (); @@ -854,40 +864,3 @@ gdb_tracepoint_exists_command (ClientData clientData, Tcl_SetIntObj (result_ptr->obj_ptr, tracepoint_exists (args)); return TCL_OK; } - -/* - * This section contains functions which deal with tracepoint - * events from gdb. - */ - -void -gdbtk_create_tracepoint (int num) -{ - tracepoint_notify (num, "create"); -} - -void -gdbtk_delete_tracepoint (int num) -{ - tracepoint_notify (num, "delete"); -} - -void -gdbtk_modify_tracepoint (int num) -{ - tracepoint_notify (num, "modify"); -} - -static void -tracepoint_notify (int num, const char *action) -{ - char *buf; - - /* We ensure that ACTION contains no special Tcl characters, so we - can do this. */ - buf = xstrprintf ("gdbtk_tcl_tracepoint %s %d", action, num); - - if (Tcl_Eval (gdbtk_interp, buf) != TCL_OK) - report_error (); - free(buf); -} diff --git a/gdb/gdbtk/generic/gdbtk-hooks.c b/gdb/gdbtk/generic/gdbtk-hooks.c index d27b9df..2ac6312 100644 --- a/gdb/gdbtk/generic/gdbtk-hooks.c +++ b/gdb/gdbtk/generic/gdbtk-hooks.c @@ -71,9 +71,6 @@ int gdbtk_force_detach = 0; extern void gdbtk_create_breakpoint (struct breakpoint *); extern void gdbtk_delete_breakpoint (struct breakpoint *); extern void gdbtk_modify_breakpoint (struct breakpoint *); -extern void gdbtk_create_tracepoint (int); -extern void gdbtk_delete_tracepoint (int); -extern void gdbtk_modify_tracepoint (int); static void gdbtk_architecture_changed (struct gdbarch *); static void gdbtk_trace_find (char *arg, int from_tty); @@ -126,9 +123,6 @@ gdbtk_add_hooks (void) observer_attach_breakpoint_created (gdbtk_create_breakpoint); observer_attach_breakpoint_modified (gdbtk_modify_breakpoint); observer_attach_breakpoint_deleted (gdbtk_delete_breakpoint); - observer_attach_tracepoint_created (gdbtk_create_tracepoint); - observer_attach_tracepoint_modified (gdbtk_modify_tracepoint); - observer_attach_tracepoint_deleted (gdbtk_delete_tracepoint); observer_attach_architecture_changed (gdbtk_architecture_changed); observer_attach_memory_changed (gdbtk_memory_changed); diff --git a/gdb/gdbtk/library/CVS/Entries b/gdb/gdbtk/library/CVS/Entries index 7c94873..027fe00 100644 --- a/gdb/gdbtk/library/CVS/Entries +++ b/gdb/gdbtk/library/CVS/Entries @@ -34,7 +34,6 @@ D/images2//// /gdbwin.ith/1.5/Thu Mar 29 20:19:15 2012/-ko/ /globalpref.ith/1.5/Thu Mar 29 20:19:16 2012/-ko/ /helpviewer.tcl/1.5/Thu Mar 29 20:19:15 2012// -/interface.tcl/1.60/Thu Mar 29 20:19:15 2012/-ko/ /ipc.tcl/1.2/Thu Mar 29 20:19:15 2012// /ipcpref.itb/1.2/Thu Mar 29 20:19:15 2012// /ipcpref.ith/1.2/Thu Mar 29 20:19:16 2012// @@ -80,3 +79,4 @@ D/images2//// /stackwin.itb/1.14/Wed Oct 10 15:53:33 2012/-ko/ /stackwin.ith/1.8/Wed Oct 10 15:53:33 2012/-ko/ /vartree.itb/1.10/Wed Oct 10 15:53:33 2012// +/interface.tcl/1.60/Sat Nov 10 17:39:03 2012/-ko/ --------------010003000506050800090400--