set pdb break condition based upon number of hits?

Discussion in 'Python' started by Reckoner, Nov 4, 2009.

  1. Reckoner

    Reckoner Guest

    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.
    Reckoner, Nov 4, 2009
    #1
    1. Advertising

  2. 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
    Diez B. Roggisch, Nov 5, 2009
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?SmF6eg==?=
    Replies:
    1
    Views:
    478
    Trevor Benedict R
    Jun 13, 2004
  2. Dos-Man
    Replies:
    5
    Views:
    1,230
    Augustus
    Mar 4, 2004
  3. Jon Perez
    Replies:
    0
    Views:
    271
    Jon Perez
    Jun 6, 2004
  4. LorcanM
    Replies:
    6
    Views:
    346
    R. Bernstein
    Oct 14, 2006
  5. Josef Moellers

    Palm::PDB: How to compose a PDB?

    Josef Moellers, Aug 16, 2007, in forum: Perl Misc
    Replies:
    0
    Views:
    130
    Josef Moellers
    Aug 16, 2007
Loading...

Share This Page