python: in pdb is it possible to enable a breakpoint only after n hit counts?

后端 未结 2 545
眼角桃花
眼角桃花 2020-12-31 00:40

In eclipse (and several other IDE\'s as well) there is an option to turn on the breakpoint only after a certain number of hits. In Python\'s pdb there is a hit

2条回答
  •  被撕碎了的回忆
    2020-12-31 01:42

    I found the answer. It's pretty easy actually, there's a command called ignore let's say you want to break at breakpoint in line 9 after 1000 hits:

    b 9
    

    Output: Breakpoint 2 at ...

    ignore 1 1000
    

    Output: Will ignore next 1000 crossings of breakpoint 1.

     c
    

提交回复
热议问题