DebugClients/Python/DebugBase.py

branch
debugger speed
changeset 5207
7283629b02c0
parent 5206
997064ba25d6
child 5208
aa8045780ce4
diff -r 997064ba25d6 -r 7283629b02c0 DebugClients/Python/DebugBase.py
--- a/DebugClients/Python/DebugBase.py	Tue Oct 04 22:38:29 2016 +0200
+++ b/DebugClients/Python/DebugBase.py	Thu Oct 06 22:28:12 2016 +0200
@@ -94,11 +94,6 @@
         self.returnframe = None
         self.stop_everywhere = False
         
-        # provide a hook to perform a hard breakpoint
-        # Use it like this:
-        # if hasattr(sys, 'breakpoint): sys.breakpoint()
-        sys.breakpoint = self.set_trace
-        
         self.__recursionDepth = -1
         self.setRecursionDepth(inspect.currentframe())
         
@@ -399,6 +394,26 @@
         sys.settrace(self.trace_dispatch)
         sys.setprofile(self._dbgClient.callTraceEnabled)
     
+    def bootstrap(self):
+        """
+        Public method to bootstrap the thread.
+        
+        It wraps the call to the user function to enable tracing
+        before hand.
+        """
+        try:
+            self._threadRunning = True
+            self.traceThread()
+            self._target(*self._args, **self._kwargs)
+        except SystemExit:
+            pass
+        finally:
+            self._threadRunning = False
+            self.quitting = True
+            self._dbgClient.threadTerminated(self)
+            sys.settrace(None)
+            sys.setprofile(None)
+    
     def run(self, cmd, globals=None, locals=None):
         """
         Public method to start a given command under debugger control.
@@ -668,7 +683,7 @@
             # Always show at least one stack frame, even if it's from eric.
             if stack and os.path.basename(fname).startswith(
                     ("DebugBase.py", "DebugClientBase.py",
-                    "ThreadExtension.py", "threading.py")):
+                     "ThreadExtension.py", "threading.py")):
                 break
             
             fline = fr.f_lineno

eric ide

mercurial