DebugClients/Python3/DebugClientBase.py

branch
debugger speed
changeset 5041
f00a4c8bcbbd
parent 5005
684f5ba04f0b
child 5044
630b9f290a77
diff -r be693f11da53 -r f00a4c8bcbbd DebugClients/Python3/DebugClientBase.py
--- a/DebugClients/Python3/DebugClientBase.py	Sat Jul 02 21:58:09 2016 +0200
+++ b/DebugClients/Python3/DebugClientBase.py	Sun Jul 17 22:40:53 2016 +0200
@@ -27,6 +27,7 @@
 from DebugConfig import ConfigVarTypeStrings
 from FlexCompleter import Completer
 from DebugUtilities import getargvalues, formatargvalues
+from BreakpointWatch import Breakpoint, Watch
 
 
 DebugClientInstance = None
@@ -695,9 +696,9 @@
                                        DebugProtocol.ResponseBPConditionError,
                                        fn, line))
                             return
-                    self.mainThread.set_break(fn, line, temporary, cond)
+                    Breakpoint(fn, line, temporary, cond)
                 else:
-                    self.mainThread.clear_break(fn, line)
+                    Breakpoint.clear_break(fn, line)
 
                 return
             
@@ -730,19 +731,24 @@
                 cond, temporary, set = arg.split('@@')
                 set = int(set)
                 temporary = int(temporary)
-
+                
+                if cond.endswith(('??created??', '??changed??')):
+                    compiledCond, flag = cond.split()
+                else:
+                    compiledCond = cond
+                    flag = ''
+                
+                try:
+                    compiledCond = compile(compiledCond, '<string>', 'eval')
+                except SyntaxError:
+                    self.write('{0}{1}\n'.format(
+                        DebugProtocol.ResponseWPConditionError, cond))
+                    return
+                
                 if set:
-                    if not cond.endswith('??created??') and \
-                       not cond.endswith('??changed??'):
-                        try:
-                            compile(cond, '<string>', 'eval')
-                        except SyntaxError:
-                            self.write('{0}{1}\n'.format(
-                                DebugProtocol.ResponseWPConditionError, cond))
-                            return
-                    self.mainThread.set_watch(cond, temporary)
+                    Watch(cond, compiledCond, flag, temporary)
                 else:
-                    self.mainThread.clear_watch(cond)
+                    Watch.clear_watch(cond)
 
                 return
             
@@ -750,7 +756,7 @@
                 cond, enable = arg.split(',')
                 enable = int(enable)
                 
-                bp = self.mainThread.get_watch(cond)
+                bp = Watch.get_watch(cond)
                 if bp is not None:
                     if enable:
                         bp.enable()
@@ -763,7 +769,7 @@
                 cond, count = arg.split(',')
                 count = int(count)
                 
-                bp = self.mainThread.get_watch(cond)
+                bp = Watch.get_watch(cond)
                 if bp is not None:
                     bp.ignore = count
                 

eric ide

mercurial