Skip to content

Commit e34fa4a

Browse files
committed
fixed breakpoint bug
1 parent e26b124 commit e34fa4a

3 files changed

Lines changed: 518 additions & 364 deletions

File tree

‎v3/pg_logger.py‎

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -483,15 +483,6 @@ def interaction(self, frame, traceback, event_type):
483483
top_frame = tos[0]
484484
lineno = tos[1]
485485

486-
# stop at both the breakpoint line and the next executed line,
487-
# so that if you set only ONE breakpoint, OPT shows the state
488-
# before and after that line gets executed.
489-
if self.breakpoints:
490-
if not ((lineno in self.breakpoints) or (self.prev_lineno in self.breakpoints)):
491-
return
492-
493-
self.prev_lineno = lineno
494-
495486

496487
# debug ...
497488
'''
@@ -858,7 +849,18 @@ def create_encoded_stack_entry(cur_frame):
858849
exc = frame.f_locals['__exception__']
859850
trace_entry['exception_msg'] = exc[0].__name__ + ': ' + str(exc[1])
860851

861-
self.trace.append(trace_entry)
852+
853+
# append to the trace only the breakpoint line and the next
854+
# executed line, so that if you set only ONE breakpoint, OPT shows
855+
# the state before and after that line gets executed.
856+
append_to_trace = True
857+
if self.breakpoints:
858+
if not ((lineno in self.breakpoints) or (self.prev_lineno in self.breakpoints)):
859+
append_to_trace = False
860+
self.prev_lineno = lineno
861+
862+
if append_to_trace:
863+
self.trace.append(trace_entry)
862864

863865

864866
# sanity check to make sure the state of the world at a 'call' instruction

0 commit comments

Comments
 (0)