Skip to content
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

gh-127321: Avoid stopping at an opcode without an associated line number for breakpoint() #127457

Merged
merged 3 commits into from
Dec 1, 2024

Conversation

gaogaotiantian
Copy link
Member

@gaogaotiantian gaogaotiantian commented Nov 30, 2024

If we are tracing opcodes (which only happen when we do set_trace() for now), we just step instr again if there's no line number.

Copy link
Member

@iritkatriel iritkatriel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice solution.

@gaogaotiantian gaogaotiantian merged commit 1bc4f07 into python:main Dec 1, 2024
42 checks passed
@gaogaotiantian gaogaotiantian deleted the breakpoint-lineno branch December 1, 2024 16:57
@gaogaotiantian
Copy link
Member Author

Ah, @iritkatriel do you think we should backport this to 3.13? It's a bit of behavior change but only happens in rare cases. If not, we should protect all the access to f_lineno because we don't want pdb to crash when it assumes that's a number.

@iritkatriel
Copy link
Member

I think this is a bug fix, so yes.

@gaogaotiantian gaogaotiantian added the needs backport to 3.13 bugs and security fixes label Dec 1, 2024
@miss-islington-app
Copy link

Thanks @gaogaotiantian for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13.
🐍🍒⛏🤖

@miss-islington-app
Copy link

Sorry, @gaogaotiantian, I could not cleanly backport this to 3.13 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker 1bc4f076d193ad157bdc69a1d62685a15f95113f 3.13

gaogaotiantian added a commit to gaogaotiantian/cpython that referenced this pull request Dec 1, 2024
…ated line number for breakpoint() (pythonGH-127457)

(cherry picked from commit 1bc4f07)

Co-authored-by: Tian Gao <[email protected]>
@bedevere-app
Copy link

bedevere-app bot commented Dec 1, 2024

GH-127487 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.13 bugs and security fixes label Dec 1, 2024
@bedevere-app
Copy link

bedevere-app bot commented Dec 1, 2024

GH-127487 is a backport of this pull request to the 3.13 branch.

@iritkatriel iritkatriel added the type-bug An unexpected behavior, bug, or error label Dec 1, 2024
gaogaotiantian added a commit that referenced this pull request Dec 1, 2024
…ine number for breakpoint() (GH-127457) (#127487)

(cherry picked from commit 1bc4f07)
picnixz pushed a commit to picnixz/cpython that referenced this pull request Dec 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants