Re: recursion limit exceeded in Python API, but there's only one function in traceback

Ömer Sinan Ağacan <[email protected]>
Newsgroups gmane.comp.gdb.devel
Message-ID <CAMQQO3mVQX8S7_juz2XgNQEjJWnYMWyAXMYVS93Kr2epo8a6Gw@mail.gmail.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.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.