Thanks to visit codestin.com
Credit goes to github.com

Skip to content
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
Next Next commit
Disable the CALL event when possible to achieve zero overhead pdb
  • Loading branch information
gaogaotiantian committed Mar 18, 2025
commit 046b7b5f6603084d648f8978520b3a6fded5a10d
7 changes: 6 additions & 1 deletion Lib/bdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,12 @@ def dispatch_call(self, frame, arg):
self.botframe = frame.f_back # (CT) Note that this may also be None!
return self.trace_dispatch
if not (self.stop_here(frame) or self.break_anywhere(frame)):
# No need to trace this function
# We already know there's no breakpoint in this function
# If it's a next/until/return command, we don't need any CALL event
# and we don't need to set the f_trace on any new frame.
# If it's a step command, it must either hit stop_here, or skip the
# whole module. Either way, we don't need the CALL event here.
self.disable_current_event()
return # None
# Ignore call events in generator except when stepping.
if self.stopframe and frame.f_code.co_flags & GENERATOR_AND_COROUTINE_FLAGS:
Expand Down
Loading