25 from DebugBase import setRecursionLimit, printerr # __IGNORE_WARNING__ |
25 from DebugBase import setRecursionLimit, printerr # __IGNORE_WARNING__ |
26 from AsyncFile import AsyncFile, AsyncPendingWrite |
26 from AsyncFile import AsyncFile, AsyncPendingWrite |
27 from DebugConfig import ConfigVarTypeStrings |
27 from DebugConfig import ConfigVarTypeStrings |
28 from FlexCompleter import Completer |
28 from FlexCompleter import Completer |
29 from DebugUtilities import getargvalues, formatargvalues |
29 from DebugUtilities import getargvalues, formatargvalues |
|
30 from BreakpointWatch import Breakpoint, Watch |
30 |
31 |
31 |
32 |
32 DebugClientInstance = None |
33 DebugClientInstance = None |
33 |
34 |
34 ############################################################################### |
35 ############################################################################### |
693 except SyntaxError: |
694 except SyntaxError: |
694 self.write('{0}{1},{2:d}\n'.format( |
695 self.write('{0}{1},{2:d}\n'.format( |
695 DebugProtocol.ResponseBPConditionError, |
696 DebugProtocol.ResponseBPConditionError, |
696 fn, line)) |
697 fn, line)) |
697 return |
698 return |
698 self.mainThread.set_break(fn, line, temporary, cond) |
699 Breakpoint(fn, line, temporary, cond) |
699 else: |
700 else: |
700 self.mainThread.clear_break(fn, line) |
701 Breakpoint.clear_break(fn, line) |
701 |
702 |
702 return |
703 return |
703 |
704 |
704 if cmd == DebugProtocol.RequestBreakEnable: |
705 if cmd == DebugProtocol.RequestBreakEnable: |
705 fn, line, enable = arg.split(',') |
706 fn, line, enable = arg.split(',') |
728 |
729 |
729 if cmd == DebugProtocol.RequestWatch: |
730 if cmd == DebugProtocol.RequestWatch: |
730 cond, temporary, set = arg.split('@@') |
731 cond, temporary, set = arg.split('@@') |
731 set = int(set) |
732 set = int(set) |
732 temporary = int(temporary) |
733 temporary = int(temporary) |
733 |
734 |
|
735 if cond.endswith(('??created??', '??changed??')): |
|
736 compiledCond, flag = cond.split() |
|
737 else: |
|
738 compiledCond = cond |
|
739 flag = '' |
|
740 |
|
741 try: |
|
742 compiledCond = compile(compiledCond, '<string>', 'eval') |
|
743 except SyntaxError: |
|
744 self.write('{0}{1}\n'.format( |
|
745 DebugProtocol.ResponseWPConditionError, cond)) |
|
746 return |
|
747 |
734 if set: |
748 if set: |
735 if not cond.endswith('??created??') and \ |
749 Watch(cond, compiledCond, flag, temporary) |
736 not cond.endswith('??changed??'): |
|
737 try: |
|
738 compile(cond, '<string>', 'eval') |
|
739 except SyntaxError: |
|
740 self.write('{0}{1}\n'.format( |
|
741 DebugProtocol.ResponseWPConditionError, cond)) |
|
742 return |
|
743 self.mainThread.set_watch(cond, temporary) |
|
744 else: |
750 else: |
745 self.mainThread.clear_watch(cond) |
751 Watch.clear_watch(cond) |
746 |
752 |
747 return |
753 return |
748 |
754 |
749 if cmd == DebugProtocol.RequestWatchEnable: |
755 if cmd == DebugProtocol.RequestWatchEnable: |
750 cond, enable = arg.split(',') |
756 cond, enable = arg.split(',') |
751 enable = int(enable) |
757 enable = int(enable) |
752 |
758 |
753 bp = self.mainThread.get_watch(cond) |
759 bp = Watch.get_watch(cond) |
754 if bp is not None: |
760 if bp is not None: |
755 if enable: |
761 if enable: |
756 bp.enable() |
762 bp.enable() |
757 else: |
763 else: |
758 bp.disable() |
764 bp.disable() |