Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Nick Roberts <nickrob@snap.net.nz>
To: Joel Brobecker <brobecker@adacore.com>
Cc: gdb-patches@sourceware.org, ghost@cs.msu.su
Subject: Re: [PATCH:MI] Use observers for breakpoints
Date: Tue, 03 Jun 2008 22:48:00 -0000	[thread overview]
Message-ID: <18501.51738.226990.896238@kahikatea.snap.net.nz> (raw)
In-Reply-To: <20080603050818.GA19062@adacore.com>

 > > Following Aleksandar Ristovski's patch for catchpoints in GDB/MI,
 > > here's a patch to demonstrate the use of observers for breakpoints.
 > > This relates to earlier patches I've submitted which uses event
 > > notification to communicate a change in state rather than using
 > > command output directly.  Among other things this allows the use of
 > > CLI commands with MI.
 > 
 > I missed the earlier patch, but I think that the idea is sound.

Here's one reference:

http://sourceware.org/ml/gdb-patches/2008-04/msg00377.html

Like Daniel says, the frame-changed notification would probably fire too often,
but the thread-changed one still seems a good idea and I have submitted a patch
to do this with annotations too:

http://sourceware.org/ml/gdb-patches/2008-05/msg00611.html


 > I suggest you change the observer profile to take a breakpoint
 > rather than a breakpoint number, to avoid having going from
 > the breakpoint number back to the breakpoint itself should an
 > observer need it.

My observer just uses a function called breakpoint_query (based on
gdb_breakpoint_query) which only needs the breakpoint number.  I
think this is an internal detail which could easily be changed should
the need arise.


 > I'm wondering if it might be useful to create two specific events
 > for breakpoint created and deleted. Particularly for the "deleted"
 > event, where you end up outputing the entire description of a breakpoint
 > that is obsolete.

Sure, it's just a sketch.  There are three types of event:

breakpoint_create_event
breakpoint_modify_event
breakpoint_delete_event

I don't know if there's much to be gained in differentiating between
creating and modifying a breakpoint but it would certainly make sense
to have two observers, breakpoints_changed and breakpoints_deleted, say.

If this patch goes in we could start dismantling the events mechanism.  They're
only used in a few other places, e.g, tracepoints, and presumably observers
could be used there too.


 > Just as an aside, I don't know how others would feel about that,
 > but I wouldn't mind seeing annotate.c:breakpoints_changed being
 > renamed to annotate_breakpoints_changed.

This function was moved from breakpoint.c.  A couple of years ago I submitted
a patch to remove this and some other annotations, just keeping the level
three annotations.  If we are going to keep it, I suggest calling it
annotate_breakpoints_invalid after the name of the associated annotation
and to be consistent with annotate_frames_invalid.

-- 
Nick                                           http://www.inet.net.nz/~nickrob


  reply	other threads:[~2008-06-03 22:48 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-01  2:46 Nick Roberts
2008-06-01  3:21 ` Eli Zaretskii
2008-06-01  3:30   ` Nick Roberts
2008-06-03  5:08 ` Joel Brobecker
2008-06-03 22:48   ` Nick Roberts [this message]
2008-06-05 22:05     ` Joel Brobecker
2008-06-06  1:19       ` Nick Roberts
2008-06-04  7:31 ` Vladimir Prus
2008-06-04  8:34   ` Nick Roberts
2008-06-06  5:08     ` Vladimir Prus
2008-06-09 10:47       ` Nick Roberts
2008-06-09 16:53         ` Vladimir Prus
2008-06-10  2:46           ` Nick Roberts

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=18501.51738.226990.896238@kahikatea.snap.net.nz \
    --to=nickrob@snap.net.nz \
    --cc=brobecker@adacore.com \
    --cc=gdb-patches@sourceware.org \
    --cc=ghost@cs.msu.su \
    /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