FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-93696: Fixed the breakpoint display error for frozen modules by gaogaotiantian · Pull Request #132862 · python/cpython · GitHub

/ cpython Public

gh-93696: Fixed the breakpoint display error for frozen modules - #132862

Merged
gaogaotiantian merged 3 commits into
python:mainfrom
gaogaotiantian:fix-frozen-bp-display
Apr 24, 2025
Merged

gh-93696: Fixed the breakpoint display error for frozen modules#132862
gaogaotiantian merged 3 commits into
python:mainfrom
gaogaotiantian:fix-frozen-bp-display

Conversation

gaogaotiantian commented Apr 24, 2025
edited
Loading

Copy link
Copy Markdown
Member

#93697 attempted to extract the actual file of a frozen module, but it only did it for list, not longlist or where. With #131638, we can get source code of frozen modules without any extra efforts, so we should remove this piece of code now.

Also, this code introduced a small error - it does not show breakpoints correctly. When we set breakpoints, we use the co_filename (<frozen XXX>) as the key. Breakpoints can't be found if the filename is converted to real file, so the B indicator will not be there.

Some extra tests were added.

Comment thread Lib/test/test_pdb.py Outdated
stdout, _ = self._run_pdb(["gh93696_host.py"], commands_longlist)
self.assertIn('x = "Sentinel string for gh-93696"', stdout, "Sentinel statement not found")
self.assertIn('4 B', stdout, "breakpoint not found")
self.assertIn('-> def func():', stdout, "stack entry not found")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

These two tests look identical as l. Make a loop?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Good point! I used loop for it.

gaogaotiantian merged commit eef49c3 into python:main Apr 24, 2025
gaogaotiantian deleted the fix-frozen-bp-display branch April 24, 2025 20:07
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.

2 participants


Back | FazBrowse Home | New Git URL