DebugClients/Python/DebugClientBase.py

branch
debugger speed
changeset 5041
f00a4c8bcbbd
parent 5005
684f5ba04f0b
child 5044
630b9f290a77
diff -r be693f11da53 -r f00a4c8bcbbd DebugClients/Python/DebugClientBase.py
--- a/DebugClients/Python/DebugClientBase.py	Sat Jul 02 21:58:09 2016 +0200
+++ b/DebugClients/Python/DebugClientBase.py	Sun Jul 17 22:40:53 2016 +0200
@@ -27,6 +27,7 @@
 from AsyncFile import AsyncFile, AsyncPendingWrite
 from DebugConfig import ConfigVarTypeStrings
 from FlexCompleter import Completer
+from BreakpointWatch import Breakpoint, Watch
 
 
 DebugClientInstance = None
@@ -687,9 +688,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
             
@@ -724,19 +725,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('%s%s\n' % (
+                        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('%s%s\n' % (
-                                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
             
@@ -744,7 +750,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()
@@ -757,7 +763,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