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-59013: Set breakpoint on the first executable line in pdb when usingbreak func#112470

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

Merged
iritkatriel merged 6 commits intopython:mainfromgaogaotiantian:pdb-break-function
Jan 31, 2024

Conversation

@gaogaotiantian
Copy link
Member

@gaogaotiantiangaogaotiantian commentedNov 27, 2023
edited by bedevere-appbot
Loading

In#110582, we madebreak foo work iffoo is already a known function (that has an associated code object). However, iffoo is in another module or it's not defined yet, we still use regular expression to find the definition, which will still set the breakpoint on thedef line. This is an inconsistent behavior and will confuse users because the actual break will be on the first executable line.

This PR solves the issue by trying to compile the head of function to find the first executable line. As long as the first couple of lines are compilable, we should be able to find the first executable line of the function and set the break point on it. This skips comments, empty lines well (and not using pure strings to figure it out).

Notably, this is a breaking change - because the previous behavior is confusing.

Equationzhao and fjqz177 reacted with heart emoji
@gaogaotiantian
Copy link
MemberAuthor

Hi@iritkatriel , do you have some time to take a look at this PR? Basically this tries to locate the first line of the function when the userbreak on a function that is not complied yet so the line number of the breakpoint would be correct.

gaogaotiantianand others added2 commitsJanuary 30, 2024 13:21
Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
@iritkatrieliritkatriel merged commit765b9ce intopython:mainJan 31, 2024
@gaogaotiantiangaogaotiantian deleted the pdb-break-function branchFebruary 2, 2024 03:44
aisk pushed a commit to aisk/cpython that referenced this pull requestFeb 11, 2024
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@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@JelleZijlstra

[8]ページ先頭

©2009-2025 Movatter.jp