Breakpoints
Valid Line Breakpoints
Winpdb is the first python debugger that allows you to set breakpoints to valid lines only. In python, some source lines are never executed, so setting a breakpoint to such lines results in the debugger ignoring them. With Winpdb you don’t have to guess which lines are valid since the debugger knows that for you, and sets the breakpoint to the nearest previous valid line.
Persistent Breakpoints
Winpdb automatically saves breakpoints when you end a debug session. Next time you start a debug session to the same script the saved breakpoints will be loaded. You can even save and load breakpoints manually and have more than one set of breakpoints by specifying a breakpoints file name.
Sticky Breakpoints
Breakpoints in Winpdb stick to their scope. You can change a script considerably and yet, next time you debug it and load the saved breakpoints, they will probably remain in the correct source lines.
Console Commands:
bp – Set a breakpoint.
bl, bd, be, bc – List, disable, enable, and clear breakpoints respectively.
load, save – Load and save breakpoints respectively.
For more information type ‘help bp’ in the debugger console.
Examples
bp 28 - Set a breakpoint to line 28 in the current file. bp 28, a == 5 - Set a conditional breakpoint to line 28 in the current file. bp myscript.py:28 - Set to line 28 in file myscript.py. bp myscript.py:CMyClass.my_method - Set to first line of method my_method of class CMyClass bp foo, i > 100 - Set a conditional breakpoint to the first line of function foo. bd * - Disable all breakpoints. bl - List all breakpoints. save - Save breakpoints to the default session file. save my_breakpoint_file - Save breakpoints to a file named 'ny_breakpoint_file.bpl'.
GUI control:
Toggle a Breakpoint
To toggle a breakpoint in the current line in the current file, click Breakpoints->Toggle or F9
Another option is to click on the left margin of a source line in the source viewer.
Breakpoint Color
Breakpoints are represented in the source viewer as a colored background for a line with a breakpoint. The colors are RED for an enabled breakpoint and YELLOW for a disable breakpoint. When a breakpoint is hit its color is LIGHT BLUE.
Winpdb - A Platform Independent Python Debugger 
Is there documentation on the format of the .bpl files?
They look pretty cryptic to me.
I\’d love to be able to create them by hand or script.
The file is a pickle of a dictionary that maps breakpoint ids to breakpoint objects. You can follow the code to see how it is created. Start from save_breakpoints()
When I try to toggle a breakpoint at a particular line, the breakpoint is selected at the top of the file. I’m pretty sure that the line I’m trying to select is a valid line.
What could this mean? I don’t get an error message at the console.
Hi Sid,
Please open a bug report at http://sourceforge.net/tracker/?group_id=145018&atid=760559
Don’t forget to specify The platform you are using and the versions of Winpdb, Python, etc… Also a file that demonstrated the problem would be helpful.
Thanks,
Nir
I need to set a conditional breakpoint but to ANY line. That is, I don’t know where this condition may be set and want to find out quickly. Is there a way to set a conditional breakpoint without specifying the line number?
Thanks
Currently you can only specify a breakpoint to a specific location.