python:在pdb中是否可以在n个命中计数之后启用断点? [英] python: in pdb is it possible to enable a breakpoint only after n hit counts?
本文介绍了python:在pdb中是否可以在n个命中计数之后启用断点?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在eclipse(还有其他几个IDE)中,只有在一定数量的命中之后才能打开断点。在Python的 pdb
中有一个断点的命中数,有条件
命令。如何连接它们?
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 count for breakpoints and there is the condition
command. How do I connect them?
推荐答案
我找到答案。实际上很简单,有一个命令叫做 ignore
假设你想在1000次点击之后,在第9行的断点上打破:
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
Breakpoint 2 at ...
ignore 1 1000
Will ignore next 1000 crossings of breakpoint 1.
c
这篇关于python:在pdb中是否可以在n个命中计数之后启用断点?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文