Search code examples
pythonnetbeansdebuggingtwisted

How to step through debug twisted?


I'd like to be able to debug Punjab, a twisted python application, in Netbeans so that I can step through the code. How can I do that? Alternatively, how could I do it in a different debugger?


Solution

  • Since you're trying to debug a twisted application, you have a few options:

    1. If you're running via twistd you can use the -b command-line options:

         -b, --debug            run the application in the Python Debugger (implies
                                nodaemon), sending SIGUSR2 will drop into debugger
      
    2. You can run manhole in your twisted process - this allows you to telnet into the server and examine Python objects - http://twistedmatrix.com/documents/current/core/howto/telnet.html

    3. You can optionally run pdb manually - see: http://docs.python.org/library/pdb.html