You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Pdb "commands" command with no bpnumber should use last available breakpoint #142834
With no bpnumber argument, commands refers to the last breakpoint set.
I think the intended meaning should be the last available breakpoint. However, when using the commands command without specifying a breakpoint number, if the most recently created breakpoint has been deleted, the current behavior throws an error stating "Breakpoint N already deleted".
main.py:
foo=1bar=2
➜ ./python-mpdbmain.py>/cpython/main.py(2)<module>()
->foo=1
(Pdb) b3Breakpoint1at/cpython/main.py:3
(Pdb) b2Breakpoint2at/cpython/main.py:2
(Pdb) clear2Deletedbreakpoint2at/cpython/main.py:2
(Pdb) commands# should set command on breakpoint 1***cannotsetcommands: Breakpoint2alreadydeleted
Should it really be the last available breakpoint, or the last enabled breakpoint?
I think it should be the last available breakpoint because it's totally valid to set commands on a disabled breakpoint. However, this is a very rare case already. I believe commands is used mostly either immediately after breakpoint, or explicitly on a numbered breakpoint. This specific difference won't be noticable to the majority of the users.
Activity
johnslavik commentedon Dec 16, 2025
@ZeroIntensity
stdlibjohnslavik commentedon Dec 16, 2025
Good idea! Should it really be the last available breakpoint, or the last enabled breakpoint?
johnslavik commentedon Dec 17, 2025
cc @gaogaotiantian
gaogaotiantian commentedon Dec 17, 2025
I think it should be the last available breakpoint because it's totally valid to set commands on a disabled breakpoint. However, this is a very rare case already. I believe
commandsis used mostly either immediately after breakpoint, or explicitly on a numbered breakpoint. This specific difference won't be noticable to the majority of the users.gh-142834: pdb commands command should use last available breakpoint (#…
pythongh-142834: pdb commands command should use last available break…