是否可以跳过 pdb / ipdb 中的断点?

cap*_*let 14 python pdb ipdb

有没有办法告诉 pdb 或 ipdb 跳过所有未来的断点并完成执行,就好像它们不存在一样?

Jér*_*ond 9

也许你可以尝试使用clear。

来自帮助:

(Pdb) help clear
cl(ear) filename:lineno
cl(ear) [bpnumber [bpnumber...]]
With a space separated list of breakpoint numbers, clear
those breakpoints.  Without argument, clear all breaks (but
first ask confirmation).  With a filename:lineno argument,
clear all breaks at that line in that file.

Note that the argument is different from previous versions of
the debugger (in python distributions 1.5.1 and before) where
a linenumber was used instead of either filename:lineno or
breakpoint numbers.
Run Code Online (Sandbox Code Playgroud)

还有另一个主题讨论您的问题:如何退出 pdb 并允许程序继续?