This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB 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: [PATCH] Fix PR14617: New MI notification on tracepoint modified.


On 11/02/2012 04:27 AM, Tom Tromey wrote:
> Yao> +@item =tracepoint-modified,bkpt=@{number=@var{id},passcount=@var{count}@}
> 
> print_one_breakpoint_location names the field "pass".
> I think consistency would be good.  What do you think?


Tom,
Inspired by your comments, 'breakpoint-modified' notification has covered
tracepoint modification, which I didn't realize.  This version is much
simpler because we can put tracepoint object to function
observer_notify_breakpoint_modified, and "pass" field appears in the
MI notification.  On the other hand, existing observers
tracepoint_{created,deleted,modified} are useless, so they are removed
in this patch as well.

Regression tested on x86_64-linux.  Is it OK?

-- 
Yao

gdb:

2012-11-02  Yao Qi  <yao@codesourcery.com>

	Fix PR gdb/14617.
	* breakpoint.c (trace_pass_set_count): Call
	observer_notify_breakpoint_modified instead of
	observer_notify_tracepoint_modified.
	* mi/mi-cmd-break.c (mi_cmd_break_passcount): Likewise.

gdb/doc:

2012-11-02  Yao Qi  <yao@codesourcery.com>

	* observer.texi (GDB Observers): Remove observer
	'tracepoint_modified', 'tracepoint_created' and
	'tracepoint_deleted'.

gdb/testsuite:

2012-11-02  Yao Qi  <yao@codesourcery.com>

	Fix PR gdb/14617.
	* gdb.mi/mi-breakpoint-changed.exp (test_insert_delete_modify):
	Remove setup_kfail, and update test.
---
 gdb/breakpoint.c                               |    2 +-
 gdb/doc/observer.texi                          |   15 ---------------
 gdb/mi/mi-cmd-break.c                          |    2 +-
 gdb/testsuite/gdb.mi/mi-breakpoint-changed.exp |    3 +--
 4 files changed, 3 insertions(+), 19 deletions(-)

diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index 76e3e89..1d79d6a 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -15245,7 +15245,7 @@ static void
 trace_pass_set_count (struct tracepoint *tp, int count, int from_tty)
 {
   tp->pass_count = count;
-  observer_notify_tracepoint_modified (tp->base.number);
+  observer_notify_breakpoint_modified (&tp->base);
   if (from_tty)
     printf_filtered (_("Setting tracepoint %d's passcount to %d\n"),
 		     tp->base.number, count);
diff --git a/gdb/doc/observer.texi b/gdb/doc/observer.texi
index 106475b..50038ac 100644
--- a/gdb/doc/observer.texi
+++ b/gdb/doc/observer.texi
@@ -179,21 +179,6 @@ A breakpoint has been modified in some way.  The argument @var{b}
 is the modified breakpoint.
 @end deftypefun
 
-@deftypefun void tracepoint_created (int @var{tpnum})
-A new tracepoint has been created.  The argument @var{tpnum} is the
-number of the newly-created tracepoint.
-@end deftypefun
-
-@deftypefun void tracepoint_deleted (int @var{tpnum})
-A tracepoint has been destroyed.  The argument @var{tpnum} is the
-number of the newly-destroyed tracepoint.
-@end deftypefun
-
-@deftypefun void tracepoint_modified (int @var{tpnum})
-A tracepoint has been modified in some way.  The argument @var{tpnum}
-is the number of the modified tracepoint.
-@end deftypefun
-
 @deftypefun void traceframe_changed (int @var{tfnum}, int @var{tpnum})
 The trace frame is changed to @var{tfnum} (e.g., by using the
 @code{tfind} command).  If @var{tfnum} is negative, it means
diff --git a/gdb/mi/mi-cmd-break.c b/gdb/mi/mi-cmd-break.c
index 2fe84dc..487d42d 100644
--- a/gdb/mi/mi-cmd-break.c
+++ b/gdb/mi/mi-cmd-break.c
@@ -200,7 +200,7 @@ mi_cmd_break_passcount (char *command, char **argv, int argc)
   if (t)
     {
       t->pass_count = p;
-      observer_notify_tracepoint_modified (n);
+      observer_notify_breakpoint_modified (&t->base);
     }
   else
     {
diff --git a/gdb/testsuite/gdb.mi/mi-breakpoint-changed.exp b/gdb/testsuite/gdb.mi/mi-breakpoint-changed.exp
index 773f588..ec10032 100644
--- a/gdb/testsuite/gdb.mi/mi-breakpoint-changed.exp
+++ b/gdb/testsuite/gdb.mi/mi-breakpoint-changed.exp
@@ -120,10 +120,9 @@ proc test_insert_delete_modify { } {
 	{.*=breakpoint-modified,bkpt=\{number="5",.*,ignore=\"1\".*\}.*\n\^done} \
 	$test
     # 5. when modifying pass count.
-    setup_kfail gdb/14617  *-*-*
     set test "passcount 1 4"
     mi_gdb_test $test \
-	{.*=breakpoint-modified,bkpt=\{number="4",.*\}.*\n\^done} \
+	{.*=breakpoint-modified,bkpt=\{number="4",.*pass="1".*\}.*\n\^done} \
 	$test
 
     # Delete some breakpoints and verify that '=breakpoint-deleted
-- 
1.7.7.6



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