Debugger/DebugServer.py

changeset 892
754efacb0fbb
parent 795
917f1945355c
child 893
5907b8d05b46
equal deleted inserted replaced
890:b4736e256f8c 892:754efacb0fbb
150 self.listen(hostAddress) 150 self.listen(hostAddress)
151 self.passive = False 151 self.passive = False
152 152
153 self.debuggerInterface = None 153 self.debuggerInterface = None
154 self.debugging = False 154 self.debugging = False
155 self.running = False
155 self.clientProcess = None 156 self.clientProcess = None
156 self.clientType = \ 157 self.clientType = \
157 Preferences.Prefs.settings.value('DebugClient/Type', 'Python3') 158 Preferences.Prefs.settings.value('DebugClient/Type', 'Python3')
158 self.lastClientType = '' 159 self.lastClientType = ''
159 self.__autoClearShell = False 160 self.__autoClearShell = False
665 self.remoteEnvironment(env) 666 self.remoteEnvironment(env)
666 667
667 self.debuggerInterface.remoteLoad(fn, argv, wd, tracePython, autoContinue, 668 self.debuggerInterface.remoteLoad(fn, argv, wd, tracePython, autoContinue,
668 autoFork, forkChild) 669 autoFork, forkChild)
669 self.debugging = True 670 self.debugging = True
671 self.running = True
670 self.__restoreBreakpoints() 672 self.__restoreBreakpoints()
671 self.__restoreWatchpoints() 673 self.__restoreWatchpoints()
672 674
673 def remoteRun(self, fn, argv, wd, env, autoClearShell = True, 675 def remoteRun(self, fn, argv, wd, env, autoClearShell = True,
674 forProject = False, runInConsole = False, 676 forProject = False, runInConsole = False,
704 706
705 self.remoteEnvironment(env) 707 self.remoteEnvironment(env)
706 708
707 self.debuggerInterface.remoteRun(fn, argv, wd, autoFork, forkChild) 709 self.debuggerInterface.remoteRun(fn, argv, wd, autoFork, forkChild)
708 self.debugging = False 710 self.debugging = False
711 self.running = True
709 712
710 def remoteCoverage(self, fn, argv, wd, env, autoClearShell = True, 713 def remoteCoverage(self, fn, argv, wd, env, autoClearShell = True,
711 erase = False, forProject = False, runInConsole = False, 714 erase = False, forProject = False, runInConsole = False,
712 clientType = ""): 715 clientType = ""):
713 """ 716 """
740 743
741 self.remoteEnvironment(env) 744 self.remoteEnvironment(env)
742 745
743 self.debuggerInterface.remoteCoverage(fn, argv, wd, erase) 746 self.debuggerInterface.remoteCoverage(fn, argv, wd, erase)
744 self.debugging = False 747 self.debugging = False
748 self.running = True
745 749
746 def remoteProfile(self, fn, argv, wd, env, autoClearShell = True, 750 def remoteProfile(self, fn, argv, wd, env, autoClearShell = True,
747 erase = False, forProject = False, 751 erase = False, forProject = False,
748 runInConsole = False, 752 runInConsole = False,
749 clientType = ""): 753 clientType = ""):
776 780
777 self.remoteEnvironment(env) 781 self.remoteEnvironment(env)
778 782
779 self.debuggerInterface.remoteProfile(fn, argv, wd, erase) 783 self.debuggerInterface.remoteProfile(fn, argv, wd, erase)
780 self.debugging = False 784 self.debugging = False
785 self.running = True
781 786
782 def remoteStatement(self, stmt): 787 def remoteStatement(self, stmt):
783 """ 788 """
784 Public method to execute a Python statement. 789 Public method to execute a Python statement.
785 790
992 self.__setClientType('Python3') # assume it is a Python3 file 997 self.__setClientType('Python3') # assume it is a Python3 file
993 self.startClient(False) 998 self.startClient(False)
994 999
995 self.debuggerInterface.remoteUTPrepare(fn, tn, tfn, cov, covname, coverase) 1000 self.debuggerInterface.remoteUTPrepare(fn, tn, tfn, cov, covname, coverase)
996 self.debugging = False 1001 self.debugging = False
1002 self.running = True
997 1003
998 def remoteUTRun(self): 1004 def remoteUTRun(self):
999 """ 1005 """
1000 Public method to start a unittest run. 1006 Public method to start a unittest run.
1001 """ 1007 """
1083 @param exceptionType type of exception raised (string) 1089 @param exceptionType type of exception raised (string)
1084 @param exceptionMessage message given by the exception (string) 1090 @param exceptionMessage message given by the exception (string)
1085 @param stackTrace list of stack entries with the exception position 1091 @param stackTrace list of stack entries with the exception position
1086 first. Each stack entry is a list giving the filename and the linenumber. 1092 first. Each stack entry is a list giving the filename and the linenumber.
1087 """ 1093 """
1088 self.clientException.emit(exceptionType, exceptionMessage, stackTrace) 1094 if self.running:
1095 self.clientException.emit(exceptionType, exceptionMessage, stackTrace)
1089 1096
1090 def signalClientSyntaxError(self, message, filename, lineNo, characterNo): 1097 def signalClientSyntaxError(self, message, filename, lineNo, characterNo):
1091 """ 1098 """
1092 Public method to process the syntax error info from the client. 1099 Public method to process the syntax error info from the client.
1093 1100
1094 @param message message of the syntax error (string) 1101 @param message message of the syntax error (string)
1095 @param filename translated filename of the syntax error position (string) 1102 @param filename translated filename of the syntax error position (string)
1096 @param lineNo line number of the syntax error position (integer) 1103 @param lineNo line number of the syntax error position (integer)
1097 @param characterNo character number of the syntax error position (integer) 1104 @param characterNo character number of the syntax error position (integer)
1098 """ 1105 """
1099 self.clientSyntaxError.emit(message, filename, lineNo, characterNo) 1106 if self.running:
1107 self.clientSyntaxError.emit(message, filename, lineNo, characterNo)
1100 1108
1101 def signalClientExit(self, status): 1109 def signalClientExit(self, status):
1102 """ 1110 """
1103 Public method to process the client exit status. 1111 Public method to process the client exit status.
1104 1112
1111 self.startClient(False) 1119 self.startClient(False)
1112 if self.passive: 1120 if self.passive:
1113 self.__createDebuggerInterface("None") 1121 self.__createDebuggerInterface("None")
1114 self.signalClientOutput(self.trUtf8('\nNot connected\n')) 1122 self.signalClientOutput(self.trUtf8('\nNot connected\n'))
1115 self.signalClientStatement(False) 1123 self.signalClientStatement(False)
1124 self.running = False
1116 1125
1117 def signalClientClearBreak(self, filename, lineno): 1126 def signalClientClearBreak(self, filename, lineno):
1118 """ 1127 """
1119 Public method to process the client clear breakpoint command. 1128 Public method to process the client clear breakpoint command.
1120 1129
1243 @param exc flag to enable exception reporting of the IDE (boolean) 1252 @param exc flag to enable exception reporting of the IDE (boolean)
1244 """ 1253 """
1245 print(self.trUtf8("Passive debug connection received")) 1254 print(self.trUtf8("Passive debug connection received"))
1246 self.passiveClientExited = False 1255 self.passiveClientExited = False
1247 self.debugging = True 1256 self.debugging = True
1257 self.running = True
1248 self.__restoreBreakpoints() 1258 self.__restoreBreakpoints()
1249 self.__restoreWatchpoints() 1259 self.__restoreWatchpoints()
1250 self.passiveDebugStarted.emit(fn, exc) 1260 self.passiveDebugStarted.emit(fn, exc)
1251 1261
1252 def __passiveShutDown(self): 1262 def __passiveShutDown(self):

eric ide

mercurial