From: Doug Evans <xdje42@gmail.com>
To: "Ömer Sinan Ağacan" <omeragacan@gmail.com>
Cc: paul_koning <Paul_Koning@dell.com>,
pmuldoon <pmuldoon@redhat.com>, gdb <gdb@sourceware.org>
Subject: Re: recursion limit exceeded in Python API, but there's only one function in traceback
Date: Fri, 17 Oct 2014 16:41:00 -0000 [thread overview]
Message-ID: <CAP9bCMQA30LhOz58UNGvF78kShnLGK33=i6rHjhLmO8mP2D3Qg@mail.gmail.com> (raw)
In-Reply-To: <CAMQQO3kehAHCMQkEOsU8kak5j=CdwZqKEy6_nHubWJF4F3A+Lg@mail.gmail.com>
On Fri, Oct 17, 2014 at 2:30 AM, Ömer Sinan Ağacan <omeragacan@gmail.com> wrote:
> I'm still having this problem. I just tried this:
>
> def handler():
> gdb.execute("continue")
> print "continue returned"
>
> This doesn't print anything, until the script fails with "maximum
> recursion depth". Then it prints lots of "continue returned" lines.
>
> So the problem is `gdb.execute` doesn't immediately return and that's
> causing Python stack to grow, because GDB is calling this function
> without returning anything to previous calls.
One thing to keep in mind here is that gdb.execute is akin to typing
the command in at the (gdb) prompt.
IOW, if you as a user typed "continue" at the (gdb) prompt what would
you want to happen?
The definition of the "continue" command is that the inferior is
resumed until it stops and then the "continue" command completes.
> I think I need a version of `gdb.execute` that returns immediately.
> ie. async version or something like that. Is such a thing possible?
There is "continue &" for the case at hand.
There is no async version of gdb.execute itself.
Alas there is no corresponding "wait" command for "continue &" (I have
one in a sandbox that I get to when I'm able).
So once the inferior is running you've kinda lost programmatic control.
There is the "interrupt" command but it is broken in the sense that it
is implicitly async (the "&" is implicitly present).
I have a sandbox that fixes this too (getting this submitted tripped
over another gdb bug which I'm needing to fix first - a not uncommon
occurrence in gdb-land).
Other things come into play here like all-stop vs non-stop
https://sourceware.org/gdb/current/onlinedocs/gdb/Thread-Stops.html#Thread-Stops
but the async version of gdb.execute("continue") is gdb.execute("continue &").
Also note that resuming the inferior in a breakpoint handler is
supported, but further commands after the continue are not.
This isn't enforced in the python API, so I'm not sure what might
happen. Some things may work, others may not.
https://sourceware.org/gdb/current/onlinedocs/gdb/Break-Commands.html#Break-Commands
next prev parent reply other threads:[~2014-10-17 16:41 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-16 10:46 Ömer Sinan Ağacan
2014-10-16 12:45 ` Phil Muldoon
2014-10-16 14:28 ` Paul_Koning
[not found] ` <CAMQQO3=GxjGzF-9RXQsJ_9=Du3rS-UoYFA_0-friPp1nMa8yAA@mail.gmail.com>
2014-10-16 15:04 ` Paul_Koning
2014-10-16 15:15 ` Ömer Sinan Ağacan
2014-10-16 15:18 ` Ömer Sinan Ağacan
2014-10-17 9:31 ` Ömer Sinan Ağacan
2014-10-17 10:11 ` Phil Muldoon
2014-10-17 10:53 ` Ömer Sinan Ağacan
2014-10-17 14:20 ` Phil Muldoon
2014-10-17 14:27 ` Ömer Sinan Ağacan
2014-10-17 15:02 ` Phil Muldoon
2014-10-17 15:04 ` Paul_Koning
2014-10-17 17:31 ` Phil Muldoon
2014-10-17 16:41 ` Doug Evans [this message]
2014-10-17 17:35 ` Phil Muldoon
2014-10-17 16:45 ` Doug Evans
[not found] ` <543FE072.6040507@redhat.com>
2014-10-16 15:16 ` Ömer Sinan Ağacan
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='CAP9bCMQA30LhOz58UNGvF78kShnLGK33=i6rHjhLmO8mP2D3Qg@mail.gmail.com' \
--to=xdje42@gmail.com \
--cc=Paul_Koning@dell.com \
--cc=gdb@sourceware.org \
--cc=omeragacan@gmail.com \
--cc=pmuldoon@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