DebugClients/Python/DebugClientBase.py

branch
debugger speed
changeset 5005
684f5ba04f0b
parent 4944
d4709f4818bb
child 5041
f00a4c8bcbbd
--- a/DebugClients/Python/DebugClientBase.py	Thu Jun 23 19:24:09 2016 +0200
+++ b/DebugClients/Python/DebugClientBase.py	Sun Jun 26 16:32:01 2016 +0200
@@ -194,8 +194,8 @@
         # dictionary of all threads running
         self.threads = {}
         
-        # the "current" thread, basically the thread we are at a
-        # breakpoint for.
+        # the "current" thread, basically the thread we are at a breakpoint
+        # for.
         self.currentThread = self
         
         # special objects representing the main scripts thread and frame
@@ -295,9 +295,6 @@
         If mainThread is non-zero, then we are attaching to the already
         started mainthread of the app and the rest of the args are ignored.
         
-        This is just an empty function and is overridden in the threaded
-        debugger.
-        
         @param target the start function of the target thread (i.e. the user
             code)
         @param args arguments to pass to target
@@ -512,7 +509,6 @@
                     os.chdir(sys.path[1])
                 else:
                     os.chdir(wd)
-                tracePython = int(tracePython)
                 self.running = sys.argv[0]
                 self.mainFrame = None
                 self.inRawMode = 0
@@ -526,11 +522,11 @@
                 sys.excepthook = self.__unhandled_exception
                 self.__interceptSignals()
                 
-                # clear all old breakpoints, they'll get set after we
-                # have started
+                # clear all old breakpoints, they'll get set after we have
+                # started
                 self.mainThread.clear_all_breaks()
                 
-                self.mainThread.tracePython = tracePython
+                self.mainThread.tracePythonLibs(int(tracePython))
                 
                 # This will eventually enter a local event loop.
                 # Note the use of backquotes to cause a repr of self.running.
@@ -573,7 +569,7 @@
                 sys.excepthook = self.__unhandled_exception
                 self.__interceptSignals()
                 
-                self.mainThread.tracePython = 0
+                self.mainThread.tracePythonLibs(0)
                 
                 self.debugMod.__dict__['__file__'] = sys.argv[0]
                 sys.modules['__main__'] = self.debugMod
@@ -770,7 +766,8 @@
             if cmd == DebugProtocol.RequestEval:
                 try:
                     value = eval(
-                        arg, self.currentThread.getCurrentFrame().f_globals,
+                        arg,
+                        self.currentThread.getCurrentFrame().f_globals,
                         self.currentThread.getFrameLocals(self.framenr))
                     self.currentThread.storeFrameLocals(self.framenr)
                 except Exception:
@@ -1337,8 +1334,8 @@
         @param frmnr distance of frame reported on. 0 is the current frame
             (int)
         @param scope 1 to report global variables, 0 for local variables (int)
-        @param filter the indices of variable types to be filtered (list of
-            int)
+        @param filter the indices of variable types to be filtered
+            (list of int)
         """
         if self.currentThread is None:
             return
@@ -1489,7 +1486,7 @@
                             oaccess = ''
                         try:
                             exec 'mdict = dict%s.__dict__' % access
-                            ndict.update(mdict)     # __IGNORE_WARNING__
+                            ndict.update(mdict)
                             exec 'obj = dict%s' % access
                             if "PyQt4." in str(type(obj)) or \
                                     "PyQt5." in str(type(obj)):
@@ -1501,8 +1498,8 @@
                             pass
                         try:
                             exec 'mcdict = dict%s.__class__.__dict__' % access
-                            ndict.update(mcdict)     # __IGNORE_WARNING__
-                            if mdict and "sipThis" not in mdict.keys():  # __IGNORE_WARNING__
+                            ndict.update(mcdict)
+                            if mdict and "sipThis" not in mdict.keys():
                                 del rvar[0:2]
                                 access = ""
                         except Exception:
@@ -1628,9 +1625,9 @@
         
     def __formatQtVariable(self, value, vtype):
         """
-        Private method to produce a formated output of a simple Qt4/Qt5 type.
+        Private method to produce a formatted output of a simple Qt4/Qt5 type.
         
-        @param value variable to be formated
+        @param value variable to be formatted
         @param vtype type of the variable to be formatted (string)
         @return A tuple consisting of a list of formatted variables. Each
             variable entry is a tuple of three elements, the variable name,
@@ -1977,7 +1974,7 @@
         self.debugging = 1
         
         self.attachThread(mainThread=1)
-        self.mainThread.tracePython = tracePython
+        self.mainThread.tracePythonLibs(tracePython)
         
         # set the system exception handling function to ensure, that
         # we report on all unhandled exceptions
@@ -2035,7 +2032,7 @@
         self.__interact()
         
         self.attachThread(mainThread=1)
-        self.mainThread.tracePython = tracePython
+        self.mainThread.tracePythonLibs(tracePython)
         
         # set the system exception handling function to ensure, that
         # we report on all unhandled exceptions

eric ide

mercurial