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 <CAMQQO3=GxjGzF-9RXQsJ_9=Du3rS-UoYFA_0-friPp1nMa8yAA@mail.gmail.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?
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.