public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Doug Evans <dje@google.com>
To: Tom Tromey <tromey@redhat.com>
Cc: pmuldoon@redhat.com, gdb-patches@sourceware.org
Subject: Re: [patch] Add an evaluation function hook to Python breakpoints.
Date: Tue, 21 Dec 2010 17:33:00 -0000	[thread overview]
Message-ID: <AANLkTim_wXWA2OX1GdZ_rFVwBAr+YjO+B5SSVUN_g0vK@mail.gmail.com> (raw)
In-Reply-To: <m3ipyulpop.fsf@fleche.redhat.com>

On Wed, Dec 15, 2010 at 12:57 PM, Tom Tromey <tromey@redhat.com> wrote:
> Tom> Having two methods seems worse to me.  It is more complicated without
> Tom> any added benefits.
>
> Doug> One thought I had was that maybe one might have a situation where it'd
> Doug> be useful to run all the collect methods first, and then run all the
> Doug> stop_p methods.
>
> Could you give an example?

Nothing specific, it was just a thought.

> Doug> Plus I still like the API design of keeping data collection separate
> Doug> from stop/don't-stop.
>
> Can you say why?

They're orthogonal requests, and I've had better success with keeping
such things separate.
[But as I say, since they are orthogonal requests, one could add a
data-collection API in a separate patch.]

> Doug> Btw, if some mutex-checker or whatever detected a condition that it
> Doug> wanted to report to the user, IWBN to be able to throw an error that
> Doug> some higher level construct could recognize and deal with.
> Doug> Is a simple boolean result from stop_p (I'm only calling that for
> Doug> clarity's sake) going to be sufficient?
>
> I don't understand.  What higher level are you thinking of?
> Could you give an example of when we would want to throw an exception
> and what that would mean?

[For reference sake, this subthread isn't about an either/or choice of
stop_p or something else.  stop_p is sufficient for some uses.]

For checkers for rule violations (and such) it's nice to stop the
program and notify the user (obviously).  It's also nice for a script
driving the program (say in automated tests) to know why the program
stopped (e.g. you might want to take different actions, e.g. to
further isolate the cause).

For example, what happens after a checker employing stop_p says
"stop"?  There's nothing more in the API that helps the user know
*why* the checker said "stop".  At the moment the API doesn't provide
anything.  Checkers will have to print an error message, but I have a
feeling something more will be useful.
[Did you have something in mind, or am I missing something?]

One thought, and it's just a thought, is to treat rule violations like
segv's.  One could do that in various ways, I'm not suggesting a
particular implementation.  But some of the aspects of getting a segv
are useful here.  E.g., the program can't be resumed until the rule
violation is fixed, and the reason why the program has stopped is
encoded in the program's state.

  reply	other threads:[~2010-12-21 17:33 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-13 13:50 Phil Muldoon
2010-12-13 14:19 ` Eli Zaretskii
2010-12-13 14:47   ` Phil Muldoon
2010-12-13 15:07     ` Eli Zaretskii
2010-12-13 17:21       ` Phil Muldoon
2010-12-13 17:46         ` Eli Zaretskii
2010-12-13 14:33 ` Pedro Alves
2010-12-13 14:56   ` Phil Muldoon
2010-12-13 15:07     ` Pedro Alves
2010-12-13 20:45 ` Doug Evans
2010-12-13 21:02   ` Phil Muldoon
2010-12-14  3:31     ` Doug Evans
2010-12-14 17:18       ` Phil Muldoon
2010-12-14 17:28   ` Tom Tromey
2010-12-14 19:51     ` Phil Muldoon
2010-12-14 20:00       ` Phil Muldoon
2010-12-15 15:34     ` Phil Muldoon
2010-12-15 20:51       ` Tom Tromey
2011-01-27 12:44         ` Phil Muldoon
     [not found]           ` <AANLkTimi6ugruNAqUGHni8Kvkz+B5-s2aAkEoTY2D_gT@mail.gmail.com>
2011-01-27 21:40             ` Phil Muldoon
2011-01-28 10:42           ` Tom Tromey
2010-12-15 16:21     ` Doug Evans
2010-12-15 20:57       ` Tom Tromey
2010-12-21 17:33         ` Doug Evans [this message]
2010-12-21 20:02           ` Tom Tromey
2010-12-22 16:34             ` Doug Evans
2010-12-22 17:35               ` Tom Tromey
2010-12-28  5:53                 ` Doug Evans
2011-01-05 18:35                   ` Tom Tromey
2011-01-05 20:23                     ` Phil Muldoon
2011-01-09 20:32                       ` Doug Evans
2010-12-14 17:46   ` Pedro Alves
2010-12-14 16:35 ` Tom Tromey
2010-12-14 17:02   ` Phil Muldoon
2010-12-14 17:48     ` Tom Tromey
2010-12-14 16:42 ` Tom Tromey

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=AANLkTim_wXWA2OX1GdZ_rFVwBAr+YjO+B5SSVUN_g0vK@mail.gmail.com \
    --to=dje@google.com \
    --cc=gdb-patches@sourceware.org \
    --cc=pmuldoon@redhat.com \
    --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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).