Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to skip breakpoints in pdb / ipdb?

Tags:

python

pdb

ipdb

Is there a way to tell pdb or ipdb to skip all future break-points and just finish execution as if they weren't there?

like image 810
capybaralet Avatar asked Oct 18 '22 02:10

capybaralet


2 Answers

If you want to keep your breakpoints rather than clearing them, but also want them not to be reached, you can use pdb's disable command. I don't see a convenient way to disable all breakpoints in a concise way, but you can list their numbers in the disable command. You can also be selective about this, and disable some breakpoints and leave others enabled. You can undo the effect of a disable command with pdbs enable command. The break command (or just b) with no parameters shows, for each breakpoint, whether it is enabled.

like image 189
Eirik Fuller Avatar answered Oct 21 '22 07:10

Eirik Fuller


Maybe you can try with clear.

From help:

(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.

There is another topic which discuss of your question: How to exit pdb and allow program to continue?

like image 29
Jérèm Le Blond Avatar answered Oct 21 '22 06:10

Jérèm Le Blond