Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.7k
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
Uh oh!
There was an error while loading.Please reload this page.
Conversation
gaogaotiantian commentedJan 29, 2024
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 user |
Misc/NEWS.d/next/Library/2023-11-27-19-54-43.gh-issue-59013.chpQ0e.rst OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
Uh oh!
There was an error while loading.Please reload this page.
…on when using `break func` in pdb (python#112470)
Uh oh!
There was an error while loading.Please reload this page.
In#110582, we made
break foowork iffoois already a known function (that has an associated code object). However, iffoois 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 thedefline. 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.