25 import DebugClientCapabilities |
25 import DebugClientCapabilities |
26 from DebugBase import setRecursionLimit, printerr # __IGNORE_WARNING__ |
26 from DebugBase import setRecursionLimit, printerr # __IGNORE_WARNING__ |
27 from AsyncFile import AsyncFile, AsyncPendingWrite |
27 from AsyncFile import AsyncFile, AsyncPendingWrite |
28 from DebugConfig import ConfigVarTypeStrings |
28 from DebugConfig import ConfigVarTypeStrings |
29 from FlexCompleter import Completer |
29 from FlexCompleter import Completer |
|
30 from BreakpointWatch import Breakpoint, Watch |
30 |
31 |
31 |
32 |
32 DebugClientInstance = None |
33 DebugClientInstance = None |
33 |
34 |
34 ############################################################################### |
35 ############################################################################### |
685 self.write( |
686 self.write( |
686 '%s%s,%d\n' % |
687 '%s%s,%d\n' % |
687 (DebugProtocol.ResponseBPConditionError, |
688 (DebugProtocol.ResponseBPConditionError, |
688 fn, line)) |
689 fn, line)) |
689 return |
690 return |
690 self.mainThread.set_break(fn, line, temporary, cond) |
691 Breakpoint(fn, line, temporary, cond) |
691 else: |
692 else: |
692 self.mainThread.clear_break(fn, line) |
693 Breakpoint.clear_break(fn, line) |
693 |
694 |
694 return |
695 return |
695 |
696 |
696 if cmd == DebugProtocol.RequestBreakEnable: |
697 if cmd == DebugProtocol.RequestBreakEnable: |
697 fn, line, enable = arg.split(',') |
698 fn, line, enable = arg.split(',') |
722 |
723 |
723 if cmd == DebugProtocol.RequestWatch: |
724 if cmd == DebugProtocol.RequestWatch: |
724 cond, temporary, set = arg.split('@@') |
725 cond, temporary, set = arg.split('@@') |
725 set = int(set) |
726 set = int(set) |
726 temporary = int(temporary) |
727 temporary = int(temporary) |
727 |
728 |
|
729 if cond.endswith(('??created??', '??changed??')): |
|
730 compiledCond, flag = cond.split() |
|
731 else: |
|
732 compiledCond = cond |
|
733 flag = '' |
|
734 |
|
735 try: |
|
736 compiledCond = compile(compiledCond, '<string>', 'eval') |
|
737 except SyntaxError: |
|
738 self.write('%s%s\n' % ( |
|
739 DebugProtocol.ResponseWPConditionError, cond)) |
|
740 return |
|
741 |
728 if set: |
742 if set: |
729 if not cond.endswith('??created??') and \ |
743 Watch(cond, compiledCond, flag, temporary) |
730 not cond.endswith('??changed??'): |
|
731 try: |
|
732 compile(cond, '<string>', 'eval') |
|
733 except SyntaxError: |
|
734 self.write('%s%s\n' % ( |
|
735 DebugProtocol.ResponseWPConditionError, cond)) |
|
736 return |
|
737 self.mainThread.set_watch(cond, temporary) |
|
738 else: |
744 else: |
739 self.mainThread.clear_watch(cond) |
745 Watch.clear_watch(cond) |
740 |
746 |
741 return |
747 return |
742 |
748 |
743 if cmd == DebugProtocol.RequestWatchEnable: |
749 if cmd == DebugProtocol.RequestWatchEnable: |
744 cond, enable = arg.split(',') |
750 cond, enable = arg.split(',') |
745 enable = int(enable) |
751 enable = int(enable) |
746 |
752 |
747 bp = self.mainThread.get_watch(cond) |
753 bp = Watch.get_watch(cond) |
748 if bp is not None: |
754 if bp is not None: |
749 if enable: |
755 if enable: |
750 bp.enable() |
756 bp.enable() |
751 else: |
757 else: |
752 bp.disable() |
758 bp.disable() |