gh-142834: pdb commands command should use last available breakpoint#142835
Merged
gaogaotiantian merged 11 commits intopython:mainfrom Dec 20, 2025
Merged
gh-142834: pdb commands command should use last available breakpoint#142835gaogaotiantian merged 11 commits intopython:mainfrom
gaogaotiantian merged 11 commits intopython:mainfrom
Conversation
aisk
reviewed
Dec 16, 2025
Misc/NEWS.d/next/Library/2025-12-16-15-32-41.gh-issue-142834.g7mHw_.rst
Outdated
Show resolved
Hide resolved
…7mHw_.rst Co-authored-by: AN Long <aisk@users.noreply.github.com>
aisk
reviewed
Dec 16, 2025
Co-authored-by: AN Long <aisk@users.noreply.github.com>
aisk
reviewed
Dec 16, 2025
johnslavik
requested changes
Dec 16, 2025
Member
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?
aisk
reviewed
Dec 16, 2025
johnslavik
reviewed
Dec 16, 2025
johnslavik
reviewed
Dec 16, 2025
Co-authored-by: Bartosz Sławecki <bartosz@ilikepython.com>
Member
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.
Contributor
Author
|
Documents and error messages have been updated! |
Co-authored-by: Bartosz Sławecki <bartosz@ilikepython.com>
aisk
approved these changes
Dec 20, 2025
gaogaotiantian
approved these changes
Dec 20, 2025
Member
|
Thank you for the contribution :) |
cocolato
added a commit
to cocolato/cpython
that referenced
this pull request
Dec 22, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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: