Python debugger PDB request, "c LINENUM"

Is this the right place to put a request for the pdb debugger?

I have Python 3.11.9 on Windows 10 and 11, and use the PDB debugger all the time. Currently in the debugger, the “c” command continues only to a previously set breakpoint. I would like the option to do “c 135” to set a one-time breakpoint at line 135, continue execution until line 135, just like Perl has.

Can this be done?

Or is there another Python debugger that can do “c LINENUM”? I normally debug Python in Windows Terminal.

Are you looking for the until command?

until looks buggy. If I start a program, and without executing any lines, and do until 835, and line 835 is several executable lines inside a function updskuoldfmt, it does not take me to line 835, it takes me to the line that defines updskuoldfmt.

I guess that’s why I don’t use until.

After some other tests, until only seems to work if you are inside a function, to go to a line within that function.

I had the same requirement before. Here is the way I handle it in .pdbrc file:
alias go tbreak %1;;cont

1 Like

tbreak 835;;c

It turns out I can redefine the c command like this:

alias c tbreak %1;;cont

which is a bad idea when I just want to type c. Oh well.

Thanks for the help though!