DebugClients/Python/DebugClientBase.py

branch
debugger speed
changeset 5041
f00a4c8bcbbd
parent 5005
684f5ba04f0b
child 5044
630b9f290a77
equal deleted inserted replaced
5012:be693f11da53 5041:f00a4c8bcbbd
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()
755 761
756 if cmd == DebugProtocol.RequestWatchIgnore: 762 if cmd == DebugProtocol.RequestWatchIgnore:
757 cond, count = arg.split(',') 763 cond, count = arg.split(',')
758 count = int(count) 764 count = int(count)
759 765
760 bp = self.mainThread.get_watch(cond) 766 bp = Watch.get_watch(cond)
761 if bp is not None: 767 if bp is not None:
762 bp.ignore = count 768 bp.ignore = count
763 769
764 return 770 return
765 771

eric ide

mercurial