diff options
author | Tian Gao <gaogaotiantian@hotmail.com> | 2024-10-15 19:56:33 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-15 19:56:33 (GMT) |
commit | 12eaadc0ad33411bb02945d700b6ed7e758bb188 (patch) | |
tree | 48ff26ea312e15204b5bdbeaea3fe1b6518a86b0 /Lib/bdb.py | |
parent | 9c2bb7d551a695f35db953a671a2ddca89426bef (diff) | |
download | cpython-12eaadc0ad33411bb02945d700b6ed7e758bb188.zip cpython-12eaadc0ad33411bb02945d700b6ed7e758bb188.tar.gz cpython-12eaadc0ad33411bb02945d700b6ed7e758bb188.tar.bz2 |
gh-58956: Set f_trace on frames with breakpoints after setting a new breakpoint (#124454)
Diffstat (limited to 'Lib/bdb.py')
-rw-r--r-- | Lib/bdb.py | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -461,6 +461,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): |