mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
[3.13] gh-58956: Set f_trace on frames with breakpoints after setting a new breakpoint (GH-124454) (#125548)
gh-58956: Set f_trace on frames with breakpoints after setting a new breakpoint (GH-124454)
(cherry picked from commit 12eaadc0ad
)
Co-authored-by: Tian Gao <gaogaotiantian@hotmail.com>
This commit is contained in:
parent
c5bad759f5
commit
2ded598323
3 changed files with 39 additions and 0 deletions
|
@ -439,6 +439,14 @@ class Bdb:
|
|||
return 'Line %s:%d does not exist' % (filename, lineno)
|
||||
self._add_to_breaks(filename, lineno)
|
||||
bp = Breakpoint(filename, lineno, temporary, cond, funcname)
|
||||
# After we set a new breakpoint, we need to search through all frames
|
||||
# and set f_trace to trace_dispatch if there could be a breakpoint in
|
||||
# that frame.
|
||||
frame = self.enterframe
|
||||
while frame:
|
||||
if self.break_anywhere(frame):
|
||||
frame.f_trace = self.trace_dispatch
|
||||
frame = frame.f_back
|
||||
return None
|
||||
|
||||
def _load_breaks(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue