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

Ömer Sinan Ağacan
2014-10-17T10:53:01Z

> 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.