This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: recursion limit exceeded in Python API, but there's only one function in traceback
- From: Ãmer Sinan AÄacan <omeragacan at gmail dot com>
- To: Phil Muldoon <pmuldoon at redhat dot com>
- Cc: paul_koning <Paul_Koning at dell dot com>, gdb <gdb at sourceware dot org>
- Date: Fri, 17 Oct 2014 13:52:15 +0300
- Subject: Re: recursion limit exceeded in Python API, but there's only one function in traceback
- Authentication-results: sourceware.org; auth=none
- References: <CAMQQO3knCrj=7dQNV1NEJofLhm7gZzvzG55K66uDOJt7qYrjGg at mail dot gmail dot com> <543FBDFF dot 3050709 at redhat dot com> <104DEFBD-D686-4290-8E3C-725A51C165E6 at dell dot com> <CAMQQO3=GxjGzF-9RXQsJ_9=Du3rS-UoYFA_0-friPp1nMa8yAA at mail dot gmail dot com> <7BB30632-15BE-4EF8-B84F-D35A27772F18 at dell dot com> <CAMQQO3kAPanS0uPPjUjiTFjpkOKUR5CiV55BJMbbA2p_J7d3nQ at mail dot gmail dot com> <CAMQQO3kehAHCMQkEOsU8kak5j=CdwZqKEy6_nHubWJF4F3A+Lg at mail dot gmail dot com> <5440EB39 dot 2060305 at redhat dot com>
> Right. gdb.execute won't return until the command has completed. Also the
> Python GIL has been acquired (as this is coming from the Python interpreter)
> and so now Python is also blocked too. So in effect the only thing running
> at this point is the gdb.execute command that was invoked (in your case, the
> continue command). That will return, and then the Python GIL will be released
> and the rest of the script will continue.
>
> I have a patch I need to upstream that adds a release_gil keyword to
> gdb.execute. This optionally releases the GIL before executing the command.
> But I have not got around to that yet.
IMO, something like dont_block would be more useful for me. What I would expect
from that argument is that when it's True then `gdb.execute` would return
immediately after GDB starts running the command.
> A workaround would be to post any gdb.execute statements into the GDB event
> loop. See gdb.post_event. That will return immediately and the gdb.execute
> function will be scheduled to be called in the event loop. Note there is no
> guarantee when this is. But as long as GDB is not busy processing other
> events it usually means right away.
Thanks for the tip. I'll try that.
Do you think adding something like `dont_block` would be hard? Maybe I can hack
on that this weekend.