Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@redhat.com>
To: Doug Evans <xdje42@gmail.com>
Cc: gdb-patches@sourceware.org, pmuldoon@redhat.com,
	palves@redhat.com,        eliz@gnu.org
Subject: Re: [PATCH, doc RFA] Allow CLI and Python conditions to be set on same breakpoint
Date: Thu, 14 Nov 2013 20:54:00 -0000	[thread overview]
Message-ID: <87bo1mwvqg.fsf@fleche.redhat.com> (raw)
In-Reply-To: <m3k3gaq3gw.fsf@seba.sebabeach.org> (Doug Evans's message of	"Thu, 14 Nov 2013 09:48:31 -0800")

>>>>> "Doug" == Doug Evans <xdje42@gmail.com> writes:

Doug> +A breakpoint may have both a normal breakpoint condition
Doug> +(@pxref{Conditions, ,Break Conditions}) and a Python
Doug> +@code{gdb.Breakpoint.stop} condition.
Doug> +Both will be evaluated and if either return @code{True} then the
Doug> +inferior will be stopped, otherwise the inferior will continue.

I'm not certain that these are the best semantics.

A motivating case for the Python "stop" method was to be able to let
Python authors write new kinds of breakpoints.

Say, for example, one wanted a breakpoint that triggered based on a
Python source file and line.  One could implement this by putting a
breakpoint in the Python interpreter with a suitable "stop" method.

In order for this to make sense, all the non-matching calls in the
interpreter must be discarded.  That is, stop returns false.

In this scenario, your proposed patch would go on to evaluate the
condition and perhaps break anyway.  But this violates the whole idea of
the new breakpoint.  Here, the CLI condition would most usefully be an
additional condition -- not a parallel one.


This particular example would be better with some other additions to the
gdb breakpoint API; and maybe those would obviate the need for this dual
purposing.  But since we don't have those additions, it remains unclear
to me that "|" is better than "&&" here.

Tom


  parent reply	other threads:[~2013-11-14 20:53 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-13  8:11 [commit] breakpoint.c (breakpoint_cond_eval): Fix and enhance comment Doug Evans
2013-11-14 17:58 ` [PATCH, doc RFA] Allow CLI and Python conditions to be set on same breakpoint Doug Evans
2013-11-14 18:44   ` Pedro Alves
2013-11-14 20:22   ` Phil Muldoon
2013-11-14 20:54   ` Tom Tromey [this message]
2013-11-14 21:21     ` Pedro Alves
2013-11-15  6:39       ` Doug Evans
2013-11-15 12:06         ` Pedro Alves
2013-11-15 16:30           ` Doug Evans
2013-11-15 16:45             ` Pedro Alves
2013-11-17 17:22               ` Doug Evans
2013-11-15 20:58         ` Tom Tromey
2013-11-17 17:59           ` Doug Evans

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=87bo1mwvqg.fsf@fleche.redhat.com \
    --to=tromey@redhat.com \
    --cc=eliz@gnu.org \
    --cc=gdb-patches@sourceware.org \
    --cc=palves@redhat.com \
    --cc=pmuldoon@redhat.com \
    --cc=xdje42@gmail.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