How to set condition breakpoints?

Christopher J. Bottaro cjbottaro at alumni.cs.utexas.edu
Fri Dec 10 12:45:19 EST 2004


Colin J. Williams wrote:

> Christopher J. Bottaro wrote:
>> I have a script with a class in it:
>> class Class:
>>         def f(x, y):
>>                 # do something
>> 
>> I start up the debugger like this:
>> python /usr/lib/python2.3/pdb.py myscript.py
>> 
>> I want to set a conditional breakpoint:
>> b Class.f, x == 1 and y == 2
>> 
>> ....but that doesn't work.  How can I do what I want?
>> 
>> Thank you.
>> 
> You might consider boa-constructor, implemented for Windows and Linux.
> 
> I believe that it provides this functionality.  Of course it provides a
> lot more.

Hmm, thanks for the suggestions.  One more quick question.  Is it even
possible to set a breakpoint in a class method in pdb.py?  I can't even say
"break Class.f" without the condition.  I don't think the documentation for
pdb is very good...=(

Thanks.




More information about the Python-list mailing list