8000 gh-111744: Support opcode events in bdb by gaogaotiantian · Pull Request #111834 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-111744: Support opcode events in bdb #111834

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 8 commits into from
May 4, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Rename __curframe to enterframe
  • Loading branch information
gaogaotiantian committed May 4, 2024
commit 65a3a76a47880648e4d0c6b8c4626ba11bf2f0f8
8 changes: 4 additions & 4 deletions Lib/bdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def __init__(self, skip=None):
self.frame_trace_lines_opcodes = {}
self.frame_returning = None
self.trace_opcodes = False
self.__curframe = None
self.enterframe = None

self._load_breaks()

Expand Down Expand Up @@ -88,7 +88,7 @@ def trace_dispatch(self, frame, event, arg):
The arg parameter depends on the previous event.
"""

self.__curframe = frame
self.enterframe = frame

if self.quitting:
return # None
Expand Down Expand Up @@ -298,7 +298,7 @@ def user_opcode(self, frame):
def _set_trace_opcodes(self, trace_opcodes):
if trace_opcodes != self.trace_opcodes:
self.trace_opcodes = trace_opcodes
frame = self.__curframe
frame = self.enterframe
while frame is not None:
frame.f_trace_opcodes = trace_opcodes
if frame is self.botframe:
Expand Down Expand Up @@ -370,7 +370,7 @@ def set_trace(self, frame=None):
if frame is None:
frame = sys._getframe().f_back
self.reset()
self.__curframe = frame
self.enterframe = frame
while frame:
frame.f_trace = self.trace_dispatch
self.botframe = frame
Expand Down
0