This is the mail archive of the insight@sourceware.org mailing list for the Insight project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Recent tracepoint changes in gdb


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  <keiths@redhat.com>

	* 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.
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/

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]