Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: Yao Qi <yao@codesourcery.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH] Fix PR14617: New MI notification on tracepoint modified.
Date: Fri, 02 Nov 2012 15:17:00 -0000	[thread overview]
Message-ID: <5093E3EF.6080903@redhat.com> (raw)
In-Reply-To: <1350556586-12800-1-git-send-email-yao@codesourcery.com>

On 10/18/2012 11:36 AM, Yao Qi wrote:
> Hi,
> As PR gdb/14617 described, when the passcount of a tracepoint is
> modified, GDB doesn't emit any notification.  This patch adds a
> new notification '=tracepoint-modified' for the changes to
> tracepoint-specific attributes.  The reason I don't use
> '=breakpoint-modified' notification is that IMO, it is about
> changes to general breakpoints (breakpoint, tracepoint, catchpoint,
> etc), so I don't want to put tracepoint-specific stuff into
> it.

For better or worse, we call everything "breakpoint".  The number space
of tracepoints is the same as of all other "breakpoint kinds".
This didn't use to be the case.  Tracepoints used to be a separate
entity.  They were merged back as a kind of breakpoint a couple years
ago.  It was seen as a step forward.

We emit =breakpoint-created, =breakpoint-deleted for tracepoints:

trace main
&"trace main\n"
~"Note: breakpoint 6 also set at pc 0x457aab.\n"
~"Tracepoint 7 at 0x457aab: file ../../src/gdb/gdb.c, line 29.\n"
=breakpoint-created,bkpt={number="7",type="tracepoint",disp="keep",enabled="y",addr="0x0000000000457aab",func="main",file="../../src/gdb/gdb.c",fullname="/home/pedro/gdb/mygit/src/gdb/gdb.c",line="29",times="0",original-location="main"}
^done
(gdb)

delete 7
&"delete 7\n"
=breakpoint-deleted,id="7"
^done

As also emit =breakpoint-modified for tracepoints, all other kinds
of breakpoints (watchpoints, catchpoints, etc.).  E.g.,

(gdb)
condition 6 0
&"condition 6 0\n"
=breakpoint-modified,bkpt={number="6",type="tracepoint",disp="keep",enabled="y",addr="0x0000000000457aab",func="main",file="../../src/gdb/gdb.c",fullname="/home/pedro/gdb/mygit/src/gdb/gdb.c",line="29",cond="0",times="0",original-location="main"}
^done

This notification dumps the whole breakpoint, instead of trying
to second guess what might be useful for the frontend.

If you follow the tracepoint_modified observer introduction in
breakpoint.c, you'll find that it was originally moved from
tracepoint.c back into breakpoint.c, by Stan's patch that made
tracepoints be a kind of breakpoint (23d4c598):

    2009-03-30  Stan Shebs  <stan@codesourcery.com>

        Make tracepoints into a type of breakpoint.
    ...

It just seems like an oversight that this wasn't converted
that well.

For all of this, I'm against this new notification.  Just make changing
the tracepoint emit the existing =breakpoint-modified notification.
Why doesn't that work?

-- 
Pedro Alves


  parent reply	other threads:[~2012-11-02 15:17 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
2012-11-02 14:42     ` Tom Tromey
2012-11-02 15:17 ` Pedro Alves [this message]
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=5093E3EF.6080903@redhat.com \
    --to=palves@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=yao@codesourcery.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