Hide frames belonging to the debugger at a regular breakpoint. debugger speed

Sun, 24 Jul 2016 21:13:03 +0200

author
T.Rzepka <Tobias.Rzepka@gmail.com>
date
Sun, 24 Jul 2016 21:13:03 +0200
branch
debugger speed
changeset 5063
0b5dccc8aacb
parent 5062
904225763ac0
child 5064
9f4e3914e50c

Hide frames belonging to the debugger at a regular breakpoint.

DebugClients/Python/DebugBase.py file | annotate | diff | comparison | revisions
DebugClients/Python3/DebugBase.py file | annotate | diff | comparison | revisions
--- a/DebugClients/Python/DebugBase.py	Sun Jul 24 20:59:57 2016 +0200
+++ b/DebugClients/Python/DebugBase.py	Sun Jul 24 21:13:03 2016 +0200
@@ -551,17 +551,21 @@
         
         @param frame the frame object
         """
-        line = frame.f_lineno
-
         # We never stop on line 0.
-        if line == 0:
+        if frame.f_lineno == 0:
             return
 
         # See if we are skipping at the start of a newly loaded program.
+        # Then get the complete frame stack without eric or Python supplied
+        # libraries
         if self._dbgClient.mainFrame is None:
             fr = frame
             while (fr is not None and
                     fr.f_code != self._dbgClient.handleLine.func_code):
+                if (fr.f_code.co_filename == '<string>' or
+                        os.path.dirname(fr.f_code.co_filename) == self.lib):
+                    break
+                
                 self._dbgClient.mainFrame = fr
                 fr = fr.f_back
 
--- a/DebugClients/Python3/DebugBase.py	Sun Jul 24 20:59:57 2016 +0200
+++ b/DebugClients/Python3/DebugBase.py	Sun Jul 24 21:13:03 2016 +0200
@@ -572,17 +572,21 @@
         
         @param frame the frame object
         """
-        line = frame.f_lineno
-
         # We never stop on line 0.
-        if line == 0:
+        if frame.f_lineno == 0:
             return
 
         # See if we are skipping at the start of a newly loaded program.
+        # Then get the complete frame stack without eric or Python supplied
+        # libraries
         if self._dbgClient.mainFrame is None:
             fr = frame
             while (fr is not None and
                     fr.f_code != self._dbgClient.handleLine.__code__):
+                if (fr.f_code.co_filename == '<string>' or
+                        os.path.dirname(fr.f_code.co_filename) == self.lib):
+                    break
+                
                 self._dbgClient.mainFrame = fr
                 fr = fr.f_back
 

eric ide

mercurial