Debugger/DebuggerInterfaceRuby.py

changeset 481
ad71812ba395
parent 465
c20e25deb33a
child 482
4650a72c307a
equal deleted inserted replaced
480:793552e39173 481:ad71812ba395
703 # or stderr, but not line terminated and we stepped over the 703 # or stderr, but not line terminated and we stepped over the
704 # write call, in that case the >line< will not be the first 704 # write call, in that case the >line< will not be the first
705 # string read from the socket... 705 # string read from the socket...
706 boc = line.find('>') 706 boc = line.find('>')
707 if boc > 0 and eoc > boc: 707 if boc > 0 and eoc > boc:
708 self.debugServer.clientOutput(line[:boc]) 708 self.debugServer.signalClientOutput(line[:boc])
709 line = line[boc:] 709 line = line[boc:]
710 eoc = line.find('<') + 1 710 eoc = line.find('<') + 1
711 boc = line.find('>') 711 boc = line.find('>')
712 712
713 if boc >= 0 and eoc > boc: 713 if boc >= 0 and eoc > boc:
720 cf = stack[0] 720 cf = stack[0]
721 if self.__autoContinue: 721 if self.__autoContinue:
722 self.__autoContinue = False 722 self.__autoContinue = False
723 QTimer.singleShot(0, self.remoteContinue) 723 QTimer.singleShot(0, self.remoteContinue)
724 else: 724 else:
725 self.debugServer.clientLine(cf[0], int(cf[1])) 725 self.debugServer.signalClientLine(cf[0], int(cf[1]))
726 self.debugServer.clientStack(stack) 726 self.debugServer.signalClientStack(stack)
727 continue 727 continue
728 728
729 if resp == ResponseVariables: 729 if resp == ResponseVariables:
730 vlist = eval(line[eoc:-1]) 730 vlist = eval(line[eoc:-1])
731 scope = vlist[0] 731 scope = vlist[0]
732 try: 732 try:
733 variables = vlist[1:] 733 variables = vlist[1:]
734 except IndexError: 734 except IndexError:
735 variables = [] 735 variables = []
736 self.debugServer.clientVariables(scope, variables) 736 self.debugServer.signalClientVariables(scope, variables)
737 continue 737 continue
738 738
739 if resp == ResponseVariable: 739 if resp == ResponseVariable:
740 vlist = eval(line[eoc:-1]) 740 vlist = eval(line[eoc:-1])
741 scope = vlist[0] 741 scope = vlist[0]
742 try: 742 try:
743 variables = vlist[1:] 743 variables = vlist[1:]
744 except IndexError: 744 except IndexError:
745 variables = [] 745 variables = []
746 self.debugServer.clientVariable(scope, variables) 746 self.debugServer.signalClientVariable(scope, variables)
747 continue 747 continue
748 748
749 if resp == ResponseOK: 749 if resp == ResponseOK:
750 self.debugServer.clientStatement(False) 750 self.debugServer.signalClientStatement(False)
751 continue 751 continue
752 752
753 if resp == ResponseContinue: 753 if resp == ResponseContinue:
754 self.debugServer.clientStatement(True) 754 self.debugServer.signalClientStatement(True)
755 continue 755 continue
756 756
757 if resp == ResponseException: 757 if resp == ResponseException:
758 exc = line[eoc:-1] 758 exc = line[eoc:-1]
759 exc = self.translate(exc, True) 759 exc = self.translate(exc, True)
764 stack = exclist[2:] 764 stack = exclist[2:]
765 except (IndexError, ValueError, SyntaxError): 765 except (IndexError, ValueError, SyntaxError):
766 exctype = None 766 exctype = None
767 excmessage = '' 767 excmessage = ''
768 stack = [] 768 stack = []
769 self.debugServer.clientException(exctype, excmessage, stack) 769 self.debugServer.signalClientException(exctype, excmessage, stack)
770 continue 770 continue
771 771
772 if resp == ResponseSyntax: 772 if resp == ResponseSyntax:
773 exc = line[eoc:-1] 773 exc = line[eoc:-1]
774 exc = self.translate(exc, True) 774 exc = self.translate(exc, True)
779 except (IndexError, ValueError): 779 except (IndexError, ValueError):
780 message = None 780 message = None
781 fn = '' 781 fn = ''
782 ln = 0 782 ln = 0
783 cn = 0 783 cn = 0
784 self.debugServer.clientSyntaxError(message, fn, ln, cn) 784 self.debugServer.signalClientSyntaxError(message, fn, ln, cn)
785 continue 785 continue
786 786
787 if resp == ResponseExit: 787 if resp == ResponseExit:
788 self.debugServer.clientExit(line[eoc:-1]) 788 self.debugServer.signalClientExit(line[eoc:-1])
789 continue 789 continue
790 790
791 if resp == ResponseClearBreak: 791 if resp == ResponseClearBreak:
792 fn, lineno = line[eoc:-1].split(',') 792 fn, lineno = line[eoc:-1].split(',')
793 lineno = int(lineno) 793 lineno = int(lineno)
794 fn = self.translate(fn, True) 794 fn = self.translate(fn, True)
795 self.debugServer.clientClearBreak(fn, lineno) 795 self.debugServer.signalClientClearBreak(fn, lineno)
796 continue 796 continue
797 797
798 if resp == ResponseClearWatch: 798 if resp == ResponseClearWatch:
799 cond = line[eoc:-1] 799 cond = line[eoc:-1]
800 self.debugServer.clientClearWatch(cond) 800 self.debugServer.signalClientClearWatch(cond)
801 continue 801 continue
802 802
803 if resp == ResponseBanner: 803 if resp == ResponseBanner:
804 version, platform, dbgclient = eval(line[eoc:-1]) 804 version, platform, dbgclient = eval(line[eoc:-1])
805 self.debugServer.clientBanner(version, platform, dbgclient) 805 self.debugServer.signalClientBanner(version, platform, dbgclient)
806 continue 806 continue
807 807
808 if resp == ResponseCapabilities: 808 if resp == ResponseCapabilities:
809 cap, clType = eval(line[eoc:-1]) 809 cap, clType = eval(line[eoc:-1])
810 self.clientCapabilities = cap 810 self.clientCapabilities = cap
811 self.debugServer.clientCapabilities(cap, clType) 811 self.debugServer.signalClientCapabilities(cap, clType)
812 continue 812 continue
813 813
814 if resp == ResponseCompletion: 814 if resp == ResponseCompletion:
815 clstring, text = line[eoc:-1].split('||') 815 clstring, text = line[eoc:-1].split('||')
816 cl = eval(clstring) 816 cl = eval(clstring)
817 self.debugServer.clientCompletionList(cl, text) 817 self.debugServer.signalClientCompletionList(cl, text)
818 continue 818 continue
819 819
820 if resp == PassiveStartup: 820 if resp == PassiveStartup:
821 fn, exc = line[eoc:-1].split('|') 821 fn, exc = line[eoc:-1].split('|')
822 exc = bool(exc) 822 exc = bool(exc)
823 fn = self.translate(fn, True) 823 fn = self.translate(fn, True)
824 self.debugServer.passiveStartUp(fn, exc) 824 self.debugServer.passiveStartUp(fn, exc)
825 continue 825 continue
826 826
827 self.debugServer.clientOutput(line) 827 self.debugServer.signalClientOutput(line)
828 828
829 def __sendCommand(self, cmd): 829 def __sendCommand(self, cmd):
830 """ 830 """
831 Private method to send a single line command to the client. 831 Private method to send a single line command to the client.
832 832

eric ide

mercurial