Don't step into print statements. debugger fine grinding

Thu, 02 Mar 2017 22:18:17 +0100

author
T.Rzepka <Tobias.Rzepka@gmail.com>
date
Thu, 02 Mar 2017 22:18:17 +0100
branch
debugger fine grinding
changeset 5573
4f85c1de060d
parent 5572
c6eec77019d2
child 5574
bc56ec8d6f44

Don't step into print statements.

DebugClients/Python/DebugBase.py file | annotate | diff | comparison | revisions
changelog file | annotate | diff | comparison | revisions
--- a/DebugClients/Python/DebugBase.py	Tue Feb 28 19:11:33 2017 +0100
+++ b/DebugClients/Python/DebugBase.py	Thu Mar 02 22:18:17 2017 +0100
@@ -307,7 +307,12 @@
         
         if event == 'line':
             if self.stop_here(frame) or self.break_here(frame):
-                self.user_line(frame)
+                if (self.stop_everywhere and
+                        frame.f_back.f_code.co_name == "prepareJsonCommand"):
+                    # Just stepped into print statement, so skip these frames
+                    self._set_stopinfo(None, frame.f_back)
+                else:
+                    self.user_line(frame)
             return self.trace_dispatch
         
         if event == 'call':
@@ -320,6 +325,10 @@
                 return
         
         if event == 'return':
+            if frame == self.returnframe:
+                # Only true if we didn't stopped in this frame, because it's
+                # belonging to the eric debugger.
+                self._set_stopinfo(None, frame.f_back)
             return
         
         if event == 'exception':
@@ -469,6 +478,9 @@
         """
         self.stopframe = stopframe
         self.returnframe = returnframe
+        if returnframe is not None:
+            # Ensure to be able to stop on the return frame
+            returnframe.f_trace = self.trace_dispatch
         self.stop_everywhere = False
 
     def set_continue(self, special):
@@ -502,7 +514,6 @@
         @type frame object
         """
         self._set_stopinfo(frame, frame.f_back)
-        frame.f_back.f_trace = self.trace_dispatch
         frame.f_trace = self.trace_dispatch
 
     def set_return(self, frame):
--- a/changelog	Tue Feb 28 19:11:33 2017 +0100
+++ b/changelog	Thu Mar 02 22:18:17 2017 +0100
@@ -6,6 +6,8 @@
   -- upgraded pycodestyle to version 2.3.1
   -- upgraded pyflakes to version 1.5.0
 - Debugger
+  -- prevent stepping into print statements if checkbox for debugging into
+     interpreter libraries is checked
   -- catch unhandled exceptions again
   -- support for PySide2 added
   -- atexit handling works as specified in any condition

eric ide

mercurial