Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(5)

Delta Between Two Patch Sets: Lib/bdb.py

Issue 13183: pdb skips frames after hitting a breakpoint and running step
Left Patch Set: Created 8 years, 5 months ago
Right Patch Set: Created 8 years, 5 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « no previous file | Lib/test/test_pdb.py » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 """Debugger basics""" 1 """Debugger basics"""
2 2
3 import fnmatch 3 import fnmatch
4 import sys 4 import sys
5 import os 5 import os
6 6
7 __all__ = ["BdbQuit", "Bdb", "Breakpoint"] 7 __all__ = ["BdbQuit", "Bdb", "Breakpoint"]
8 8
9 class BdbQuit(Exception): 9 class BdbQuit(Exception):
10 """Exception to give up completely.""" 10 """Exception to give up completely."""
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 def set_until(self, frame, lineno=None): 182 def set_until(self, frame, lineno=None):
183 """Stop when the line with the line no greater than the current one is 183 """Stop when the line with the line no greater than the current one is
184 reached or when returning from current frame""" 184 reached or when returning from current frame"""
185 # the name "until" is borrowed from gdb 185 # the name "until" is borrowed from gdb
186 if lineno is None: 186 if lineno is None:
187 lineno = frame.f_lineno + 1 187 lineno = frame.f_lineno + 1
188 self._set_stopinfo(frame, frame, lineno) 188 self._set_stopinfo(frame, frame, lineno)
189 189
190 def set_step(self): 190 def set_step(self):
191 """Stop after one line of code.""" 191 """Stop after one line of code."""
192 # Issue #XXX: pdb skips frames after hitting a breakpoint and running 192 # Issue #13183: pdb skips frames after hitting a breakpoint and running
193 # step commands. 193 # step commands.
194 # Restore the trace function in the caller (that may not have been set 194 # Restore the trace function in the caller (that may not have been set
195 # for performance reasons) when returning from the current frame. 195 # for performance reasons) when returning from the current frame.
196 if self.frame_returning: 196 if self.frame_returning:
197 caller_frame = self.frame_returning.f_back 197 caller_frame = self.frame_returning.f_back
198 if caller_frame and not caller_frame.f_trace: 198 if caller_frame and not caller_frame.f_trace:
199 caller_frame.f_trace = self.trace_dispatch 199 caller_frame.f_trace = self.trace_dispatch
200 self._set_stopinfo(None, None) 200 self._set_stopinfo(None, None)
201 201
202 def set_next(self, frame): 202 def set_next(self, frame):
(...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after
636 x = bar(n*10) 636 x = bar(n*10)
637 print('bar returned', x) 637 print('bar returned', x)
638 638
639 def bar(a): 639 def bar(a):
640 print('bar(', a, ')') 640 print('bar(', a, ')')
641 return a/2 641 return a/2
642 642
643 def test(): 643 def test():
644 t = Tdb() 644 t = Tdb()
645 t.run('import bdb; bdb.foo(10)') 645 t.run('import bdb; bdb.foo(10)')
LEFTRIGHT

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+