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?
Use this dialog to create a run/debug configuration for Twisted trial tests. Click one of the radio-buttons to choose the possible target.: Module name: by using a Python module name and a test class instance. Script path: by using a path to a Python file. Custom: by using an arbitrary combination of paths, modules, and test class instances.
If the current line contains a function call, Step Over runs the code and then suspends execution at the first line of code after the called function returns. Step Out continues running code and suspends execution when the current function returns. The debugger skips through the current function.
The debugger step commands help you inspect your app state or find out more about its execution flow. To stop on each statement when you're debugging, use Debug > Step Into, or select F11. The debugger steps through code statements, not physical lines. For example, an if clause can be written on one line:
On a nested function call, Step Into steps into the most deeply nested function. For example, if you use Step Into on a call like Func1 (Func2 ()), the debugger steps into the function Func2. As you run each line of code, you can hover over variables to see their values, or use the Locals and Watch windows to watch the values change.
Since you're trying to debug a twisted application, you have a few options:
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
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
You can optionally run pdb manually - see: http://docs.python.org/library/pdb.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With