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: Paul_Koning at dell dot com
- Cc: pmuldoon at redhat dot com, gdb at sourceware dot org
- Date: Thu, 16 Oct 2014 17:55:50 +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>
Thanks for tips. I managed to blow the stack using a minimal script.
Here's the code:
import gdb
import traceback
def handler(ev):
try:
print "handling a stop"
gdb.execute("si")
gdb.execute("c")
except:
traceback.print_stack()
gdb.events.stop.connect(handler)
Output:
[...snip...]
File "/home/omer/gdb_script/stackoverflow.py", line 10, in handler
gdb.execute("si")
File "/home/omer/gdb_script/stackoverflow.py", line 10, in handler
gdb.execute("si")
File "/home/omer/gdb_script/stackoverflow.py", line 10, in handler
gdb.execute("si")
File "/home/omer/gdb_script/stackoverflow.py", line 10, in handler
gdb.execute("si")
File "/home/omer/gdb_script/stackoverflow.py", line 10, in handler
gdb.execute("si")
File "/home/omer/gdb_script/stackoverflow.py", line 10, in handler
gdb.execute("si")
File "/home/omer/gdb_script/stackoverflow.py", line 10, in handler
gdb.execute("si")
File "/home/omer/gdb_script/stackoverflow.py", line 10, in handler
gdb.execute("si")
File "/home/omer/gdb_script/stackoverflow.py", line 10, in handler
gdb.execute("si")
File "/home/omer/gdb_script/stackoverflow.py", line 10, in handler
gdb.execute("si")
File "/home/omer/gdb_script/stackoverflow.py", line 10, in handler
gdb.execute("si")
File "/home/omer/gdb_script/stackoverflow.py", line 10, in handler
gdb.execute("si")
[...snip...]
I don't understand why I'm having nested `gdb.execute("si")` calls
here. Does `gdb.execute("si")` calls itself? Otherwise how can I have
this stack?
Any ideas?