Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > set pdb break condition based upon number of hits?

Reply
Thread Tools

set pdb break condition based upon number of hits?

 
 
Reckoner
Guest
Posts: n/a
 
      11-04-2009
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.
 
Reply With Quote
 
 
 
 
Diez B. Roggisch
Guest
Posts: n/a
 
      11-05-2009
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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Palm::PDB: How to compose a PDB? Josef Moellers Perl Misc 0 08-16-2007 02:29 PM
Disable the image used as button upon certain condition avrootshell Java 0 03-13-2007 04:16 PM
Can pdb be set to break on warnings? LorcanM Python 6 10-14-2006 03:27 AM
Why can I still hit the break point without the pdb file =?Utf-8?B?SmF6eg==?= ASP .Net 1 06-13-2004 02:46 PM
staying inside pdb.py upon an exception in a program run via it Jon Perez Python 0 06-06-2004 09:24 PM



Advertisments