Debugging Python in blender 2.5 (it works) with GUI

I see on August 19, 2010 Winpdb 1.4.8 was released
It support python 3.x
It is very good news :wink:

Step by step:

  1. Download Winpdb 1.4.8 http://winpdb.org/download/

  2. Unpack it

  3. Copy rpdb2.py to blender to your bundled python
    for example E:\BLENDENDER\2.54\python\lib

  4. Run blender 2.5x

  5. Open some python file from disk

  6. In head your python file write line (and save it):
    import rpdb2; rpdb2.start_embedded_debugger(“asdf”)

  7. Press “Run script”

When your application gets to that line, it will “hang” as the debugger runs. Now it’s time to fire up Winpdb and attach (File --> Attach) to the process. The password is “asdf”. After it loads, you will be able to do debug the application like normal.

8)Run winpdb.py (it is GUI for debugger, you need python with wxPython but wxPython works only in python 2.5, 2.6 or 2.7 )
9) File -> Attach (password: asdf)
10) Select your file from list and press OK
11) end.

This metod only work with python files at disk
if python file exists in blender file rpdb2 can debug it but can’t display source code
It is small bug in rpdb2.py

Failed to load source file xxx est_light.py’ from debuggee.
You may continue to debug, but you will not see
source lines from this file.

I’m personally looking into debugging Python with Visual Studio 2013, Blender source code loaded in and Visual Studio Python addon installed. It looks promising so far. At this point you can remote debug Python in Blender with VS13, and run code in VS interactive debug interpreter when the execution is halted on the Blender side. There is also an option to jump between C, C++ and Python code with VS but I’m yet to experiment with it.

I will try it later. Thanks.