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 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


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