summaryrefslogtreecommitdiffstats
path: root/Lib/bdb.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/bdb.py')
-rw-r--r--Lib/bdb.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/bdb.py b/Lib/bdb.py
index 9755d61..81bba8a 100644
--- a/Lib/bdb.py
+++ b/Lib/bdb.py
@@ -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):