Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Doug Evans <xdje42@gmail.com>
To: Pedro Alves <palves@redhat.com>
Cc: Tom Tromey <tromey@redhat.com>,
	gdb-patches@sourceware.org, 	Phil Muldoon <pmuldoon@redhat.com>,
	eliz@gnu.org
Subject: Re: [PATCH, doc RFA] Allow CLI and Python conditions to be set on same breakpoint
Date: Fri, 15 Nov 2013 16:30:00 -0000	[thread overview]
Message-ID: <CAP9bCMQH1-GOQarTVojULQMh2y4hUPDgpqp1E1uFB+8kSmNy6w@mail.gmail.com> (raw)
In-Reply-To: <5286078F.8090700@redhat.com>

On Fri, Nov 15, 2013 at 3:37 AM, Pedro Alves <palves@redhat.com> wrote:
> On 11/15/2013 05:34 AM, Doug Evans wrote:
>> On Thu, Nov 14, 2013 at 1:15 PM, Pedro Alves <palves@redhat.com> wrote:
>
>>> That does make sense.  In that scenario, it then sounds like it's
>>> best to think of the "stop" method more like a ops->check_status
>>> implementation/extension, than a breakpoint condition.
>>
>> Need More Data.
>> In this scenario, when would one typically add a CLI condition to such
>> a Python interpreter breakpoint?
>
> Not exactly sure what you're asking, but say, you're debugging a C program
> that uses Python as extension language, like e.g., GDB, and you have
> something buggy in the extension support, only triggered on a particular
> path of this Python script, but of all the 2000000 calls to the
> script, you can tell that only those for a certain condition in
> the C side of the program not exposed to Python would be interesting, as
> they're the ones that seem to trigger the bug.  You'd use the fictitious
> "python-interp-breakpoint" command to set a breakpoint in the Python
> script, and do:
>
>  (gdb) python-interp-breakpoint some-other-cool-extention.py:30
>  (gdb) condition $bpnum global_in_the_C_code_of_the_program==0xf00
>
> That is, please ignore all hits of the python breakpoint unless
> this particular condition in my program is true.

That's really just the "It's more useful to combine them as &&" view
(which I agree is a good point).
Same thing can apply to other functionality implemented as a Python
breakpoint with "stop".
I can think of a couple of other ways to achieve it, but && makes it easy.


  reply	other threads:[~2013-11-15 15:54 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
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 [this message]
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=CAP9bCMQH1-GOQarTVojULQMh2y4hUPDgpqp1E1uFB+8kSmNy6w@mail.gmail.com \
    --to=xdje42@gmail.com \
    --cc=eliz@gnu.org \
    --cc=gdb-patches@sourceware.org \
    --cc=palves@redhat.com \
    --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