From: Yao Qi <yao@codesourcery.com>
To: Tom Tromey <tromey@redhat.com>
Cc: <gdb-patches@sourceware.org>
Subject: Re: [PATCH] Fix PR14617: New MI notification on tracepoint modified.
Date: Fri, 02 Nov 2012 06:38:00 -0000 [thread overview]
Message-ID: <50936A39.8080804@codesourcery.com> (raw)
In-Reply-To: <87txt9qdbf.fsf@fleche.redhat.com>
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
next prev parent reply other threads:[~2012-11-02 6:38 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-18 10:36 Yao Qi
2012-10-18 17:33 ` Eli Zaretskii
2012-10-30 7:03 ` Yao Qi
2012-10-30 17:23 ` Eli Zaretskii
2012-11-01 20:27 ` Tom Tromey
2012-11-02 6:38 ` Yao Qi [this message]
2012-11-02 14:42 ` Tom Tromey
2012-11-02 15:17 ` Pedro Alves
2012-11-02 15:22 ` Yao Qi
2012-11-02 15:25 ` Pedro Alves
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=50936A39.8080804@codesourcery.com \
--to=yao@codesourcery.com \
--cc=gdb-patches@sourceware.org \
--cc=tromey@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox