Debugging

Bruno Desthuilliers bdesth.quelquechose at free.quelquepart.fr
Tue Oct 24 18:13:23 EDT 2006


Fulvio a écrit :
> 
> On Monday 23 October 2006 19:10, Bruno Desthuilliers wrote:
> 
> 
>>condition bpnumber [condition]
>>
>>    Condition is an expression which must evaluate to true before the
>>breakpoint is honored. If condition is absent, any existing condition is
>>removed; i.e., the breakpoint is made unconditional.
> 
> 
> I did some test, but whatever comes out doesn't disable the breakpoint until 
> condition becomes true.

I'm not sure to get what you mean here... The condition is a Python 
*expression*. If this expressions evals to True, the bp will trigger, 
else it will be ignored.

given the code:

00: for x in range(10):
01:    y = x * 2
02:    print y

and the pdb commands:

(pdb) break 2
(pdb) condition 1 y >= 6

The bp #1 should only trigger if y >= 6

> Supposing to have a function on program's variables the statement like " if 
> myvar == True: break" doesn't gives power to the BP.

I definitively don't understand you. How does statements in your program 
relates to setting conditions on a bp in the debugger ?

> If I do a check on the list of BPs the condition evidently appears, but no 
> luck :-O
> Also clear statement

s/statement/command/

> does clear only all BPs, it won't let me clear the 
> choosen BP number.

Did you really bother reading the doc ? If you want to clear a given pb, 
you need to pass it's number as argument to clear.



More information about the Python-list mailing list