From: Pedro Alves <palves@redhat.com>
To: Doug Evans <xdje42@gmail.com>
Cc: Tom Tromey <tromey@redhat.com>,
gdb-patches@sourceware.org, 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 12:06:00 -0000 [thread overview]
Message-ID: <5286078F.8090700@redhat.com> (raw)
In-Reply-To: <CAP9bCMRMZGrBgpToFp4RzA0f9TthKy8Kg9hqL_ENX=6B0yUdzg@mail.gmail.com>
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.
I imagine that such a thing would be useful for debugging the
Python interpreter itself too.
> Plus if this is really a check_status thing then I wonder if
> gdb.Breakpoint is going down the wrong path and we should be providing
> a class where users can override breakpoint_ops.
Yeah, I meant it only in the abstract. My view is that breakpoint_ops
is messy at places, and exposing it in full directly at least in its
current state would be a bad idea.
>>> 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.
>>
>> Yeah, it does sound like && is more useful. To get "|", the user can
>> set another breakpoint at the same address/whatever with a cli condition.
>
> That's a good point.
--
Pedro Alves
next prev parent reply other threads:[~2013-11-15 11:39 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 [this message]
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=5286078F.8090700@redhat.com \
--to=palves@redhat.com \
--cc=eliz@gnu.org \
--cc=gdb-patches@sourceware.org \
--cc=pmuldoon@redhat.com \
--cc=tromey@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