Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-82987: Stop on calling frame unconditionally for inline breakpoints#130493

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation

@gaogaotiantian
Copy link
Member

@gaogaotiantiangaogaotiantian commentedFeb 24, 2025
edited by bedevere-appbot
Loading

The testing code

importpdbdeffoo():x=40+2pdb.Pdb(skip=['__main__']).set_trace()foo()

seems a bit silly, but this is a real issue because we use thelast instance of pdb for inline breakpoints now.

So if we instantiate a debugger likep = pdb.Pdb(skip=["django.*"]) somewhere, and we set an inline breakpoint in Django with an innocentbreakpoint(), it still won't stop inside Django modules.

Overall I think it's reasonable that wealways stop for inline breakpoints. The implementation I chose is to remove the condition foropcode events which also makes sense. For now that event is exclusively used by inline breakpoints. Even if we add instruction level debugging in the future, I think the only useful command is "step instruction". It's hard to imagine instruction level breakpoints or something likeuntil instruction. Always trigger user function for opcode seems like an okay solution.

Co-authored-by: Tomas R. <tomas.roun8@gmail.com>
@@ -0,0 +1 @@
:mod:`pdb` will always stop on calling frames when inline breakpoints like:func:`breakpoint` or:func:`pdb.set_trace` are used, regardless of whether the module matches ``skip`` pattern.
Copy link
Member

Choose a reason for hiding this comment

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

This is probably worth a what's new entry.

Copy link
Member

Choose a reason for hiding this comment

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

And a versionchange comment in the doc?

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Done

gaogaotiantianand others added2 commitsMarch 3, 2025 17:37
…fQlG.rstCo-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
Added the *mode* argument.

..versionchanged::3.14
*skip* will be ignored if inline breakpoints like:func:`breakpoint` or:func:`set_trace` are used.
Copy link
Member

Choose a reason for hiding this comment

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

"if ... are used" could be misunderstood to mean that skip willalways be ignored if those areever used.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Will changing it to "when ... are used" better? Or we should just use the longer version from the news entry?

Copy link
Member

Choose a reason for hiding this comment

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

I think "when .. are used" has the same problem, as does the longer version from the news entry.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Inline breakpoints like :func:`breakpoint` or :func:`pdb.set_trace` will always stop the program at calling frame, ignoring the ``skip`` pattern (if any).

Is this better?

Copy link
Member

Choose a reason for hiding this comment

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

Yes.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Then I'll use this for all 3 places :)

@gaogaotiantiangaogaotiantian merged commit63b6ec3 intopython:mainMar 4, 2025
43 checks passed
@gaogaotiantiangaogaotiantian deleted the breakpoint-stop-unconditionally branchMarch 4, 2025 16:58
seehwan pushed a commit to seehwan/cpython that referenced this pull requestApr 16, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@tomasr8tomasr8tomasr8 left review comments

@iritkatrieliritkatrieliritkatriel approved these changes

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@gaogaotiantian@iritkatriel@tomasr8

[8]ページ先頭

©2009-2025 Movatter.jp