Skip to content

gh-80675: Set f_trace_lines = True on all frames upon pdb.set_trace() #110881

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

Merged
merged 4 commits into from
Nov 4, 2023

Conversation

gaogaotiantian
Copy link
Member

@gaogaotiantian gaogaotiantian commented Oct 14, 2023

If the f_trace_lines = False is set on the frame (for example, by coverage.py), pdb won't work properly as line events will not trigger. We set f_trace_lines = True on all frames and reset it when debugger is detached.

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
@gaogaotiantian
Copy link
Member Author

Makes sense! Applied the review suggestion.

@gaogaotiantian
Copy link
Member Author

Hi @iritkatriel , just fixed the merge conflict. Let me know if you have more feedback, thanks!

@iritkatriel iritkatriel merged commit cd6b2ce into python:main Nov 4, 2023
@gaogaotiantian
Copy link
Member Author

Do we consider this as a bug (as it's reported by coverage.py) and backport it? The impact would be fairly minimal.

@gaogaotiantian gaogaotiantian deleted the pdb-frame-traceline branch November 4, 2023 20:17
@iritkatriel
Copy link
Member

Do we consider this as a bug (as it's reported by coverage.py) and backport it? The impact would be fairly minimal.

@nedbat do you think this should be backported?

@nedbat
Copy link
Member

nedbat commented Nov 4, 2023

This is the first I've heard of it. It wasn't reported by coverage.py. The original PR description says that coverage.py does a thing that makes pdb stop working. Backporting would be a decision for the pdb people, I don't have an opinion.

@gaogaotiantian
Copy link
Member Author

Sorry my bad, it is NOT reported by coverage.py, but @nedbat did ask for moving this forward in #80675 (comment) . Like I said, this matters when being used with another tracer, and the most common candidate is coverage.py.

aisk pushed a commit to aisk/cpython that referenced this pull request Feb 11, 2024
Glyphack pushed a commit to Glyphack/cpython that referenced this pull request Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants