Uh oh!
There was an error while loading. Please reload this page.
gh-142834: pdb commands command should use last available breakpoint - #142835
Conversation
Uh oh!
There was an error while loading. Please reload this page.
…7mHw_.rst Co-authored-by: AN Long <aisk@users.noreply.github.com>
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: AN Long <aisk@users.noreply.github.com>
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
I think it's a good idea!
Thoughts:
- Should it really be the last available breakpoint, or the last enabled breakpoint?
- Let's update the documentation to reflect the new behavior.
- In the no-arg mode, maybe print a message like
*** Commands for breakpoint X, so it is always clear to the user which exactly is the breakpoint they're writing to?
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Bartosz Sławecki <bartosz@ilikepython.com>
gaogaotiantian
left a comment
There was a problem hiding this comment.
Overall this is a good change. There are a few small items that are partially mentioned above:
- We need to update the documentation in
pdb.rst. To something likeWith no bpnumber argument, commands refers to the most recently set breakpoint that still exists. - The error message
'no breakpoints set'is a bit too concise. I think we should comply to the other error messages ofcommandsand do something likecannot set commands: no existing breakpoint. - Even though I think having a message to tell the user about which breakpoint they are setting commands to is a good idea, it's kind of a breaking change. I believe almost all of the usage would be to set commands immediately after setting breakpoints. I think we can skip that for now.
cocolato
commented
Dec 17, 2025
Documents and error messages have been updated! |
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Bartosz Sławecki <bartosz@ilikepython.com>
gaogaotiantian
commented
Dec 20, 2025
Thank you for the contribution :) |
What this PR does
When commands is invoked without an argument, pdb now finds and uses the last available (non-deleted) breakpoint instead of blindly using the last breakpoint number which might have been deleted.
main.py:
after fix: