This is the mail archive of the
mailing list for the GDB project.
Re: [PATCH, doc RFA] Allow CLI and Python conditions to be set on same breakpoint
- From: Doug Evans <xdje42 at gmail dot com>
- To: Pedro Alves <palves at redhat dot com>
- Cc: Tom Tromey <tromey at redhat dot com>, gdb-patches at sourceware dot org, Phil Muldoon <pmuldoon at redhat dot com>, eliz at gnu dot org
- Date: Fri, 15 Nov 2013 07:54:30 -0800
- Subject: Re: [PATCH, doc RFA] Allow CLI and Python conditions to be set on same breakpoint
- Authentication-results: sourceware.org; auth=none
- References: <m3siv0q29h dot fsf at seba dot sebabeach dot org> <m3k3gaq3gw dot fsf at seba dot sebabeach dot org> <87bo1mwvqg dot fsf at fleche dot redhat dot com> <52853D8A dot 5070908 at redhat dot com> <CAP9bCMRMZGrBgpToFp4RzA0f9TthKy8Kg9hqL_ENX=6B0yUdzg at mail dot gmail dot com> <5286078F dot 8090700 at redhat dot com>
On Fri, Nov 15, 2013 at 3:37 AM, Pedro Alves <email@example.com> wrote:
> On 11/15/2013 05:34 AM, Doug Evans wrote:
>> On Thu, Nov 14, 2013 at 1:15 PM, Pedro Alves <firstname.lastname@example.org> 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.