-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
gh-142834: pdb commands command should use last available breakpoint #142835
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
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 <[email protected]>
Co-authored-by: AN Long <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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?
Co-authored-by: Bartosz Sławecki <[email protected]>
gaogaotiantian
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
|
Documents and error messages have been updated! |
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: