Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Python (http://www.velocityreviews.com/forums/f43-python.html)
-   -   set pdb break condition based upon number of hits? (http://www.velocityreviews.com/forums/t704209-set-pdb-break-condition-based-upon-number-of-hits.html)

Reckoner 11-04-2009 05:59 PM

set pdb break condition based upon number of hits?
 
Is it possible to set pdb break condition based upon number of hits? I
mean something like

(Pdb) break line_number (number_of_hits_for_this_breakpoint >10)

any help appreciated.

Diez B. Roggisch 11-05-2009 01:41 AM

Re: set pdb break condition based upon number of hits?
 
Reckoner schrieb:
> Is it possible to set pdb break condition based upon number of hits? I
> mean something like
>
> (Pdb) break line_number (number_of_hits_for_this_breakpoint >10)
>
> any help appreciated.


MY_GLOBAL_COUNTER = 0

MY_GLOBAL_COUNTER += 1
if MY_GLOBAL_COUNTER >= 10:
import pdb; pdb.set_trace()

Diez


All times are GMT. The time now is 06:13 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.