Debugger/DebuggerInterfacePython.py

branch
Py2 comp.
changeset 3058
0a02c433f52d
parent 3057
10516539f238
parent 3021
801289962f4e
child 3060
5883ce99ee12
equal deleted inserted replaced
3057:10516539f238 3058:0a02c433f52d
155 @return client process object (QProcess) and a flag to indicate 155 @return client process object (QProcess) and a flag to indicate
156 a network connection (boolean) 156 a network connection (boolean)
157 """ 157 """
158 interpreter = Preferences.getDebugger("PythonInterpreter") 158 interpreter = Preferences.getDebugger("PythonInterpreter")
159 if interpreter == "": 159 if interpreter == "":
160 E5MessageBox.critical(None, 160 E5MessageBox.critical(
161 None,
161 self.trUtf8("Start Debugger"), 162 self.trUtf8("Start Debugger"),
162 self.trUtf8( 163 self.trUtf8(
163 """<p>No Python2 interpreter configured.</p>""")) 164 """<p>No Python2 interpreter configured.</p>"""))
164 return None, False 165 return None, False
165 166
194 [rhost, interpreter, os.path.abspath(debugClient), 195 [rhost, interpreter, os.path.abspath(debugClient),
195 noencoding, str(port), redirect, ipaddr] 196 noencoding, str(port), redirect, ipaddr]
196 args[0] = Utilities.getExecutablePath(args[0]) 197 args[0] = Utilities.getExecutablePath(args[0])
197 process = self.__startProcess(args[0], args[1:]) 198 process = self.__startProcess(args[0], args[1:])
198 if process is None: 199 if process is None:
199 E5MessageBox.critical(None, 200 E5MessageBox.critical(
201 None,
200 self.trUtf8("Start Debugger"), 202 self.trUtf8("Start Debugger"),
201 self.trUtf8( 203 self.trUtf8(
202 """<p>The debugger backend could not be""" 204 """<p>The debugger backend could not be"""
203 """ started.</p>""")) 205 """ started.</p>"""))
204 206
240 [interpreter, os.path.abspath(debugClient), 242 [interpreter, os.path.abspath(debugClient),
241 noencoding, str(port), '0', ipaddr] 243 noencoding, str(port), '0', ipaddr]
242 args[0] = Utilities.getExecutablePath(args[0]) 244 args[0] = Utilities.getExecutablePath(args[0])
243 process = self.__startProcess(args[0], args[1:], clientEnv) 245 process = self.__startProcess(args[0], args[1:], clientEnv)
244 if process is None: 246 if process is None:
245 E5MessageBox.critical(None, 247 E5MessageBox.critical(
248 None,
246 self.trUtf8("Start Debugger"), 249 self.trUtf8("Start Debugger"),
247 self.trUtf8( 250 self.trUtf8(
248 """<p>The debugger backend could not be""" 251 """<p>The debugger backend could not be"""
249 """ started.</p>""")) 252 """ started.</p>"""))
250 return process, self.__isNetworked 253 return process, self.__isNetworked
251 254
252 process = self.__startProcess(interpreter, 255 process = self.__startProcess(
256 interpreter,
253 [debugClient, noencoding, str(port), redirect, ipaddr], 257 [debugClient, noencoding, str(port), redirect, ipaddr],
254 clientEnv) 258 clientEnv)
255 if process is None: 259 if process is None:
256 E5MessageBox.critical(None, 260 E5MessageBox.critical(
261 None,
257 self.trUtf8("Start Debugger"), 262 self.trUtf8("Start Debugger"),
258 self.trUtf8( 263 self.trUtf8(
259 """<p>The debugger backend could not be started.</p>""")) 264 """<p>The debugger backend could not be started.</p>"""))
260 return process, self.__isNetworked 265 return process, self.__isNetworked
261 266
292 [rhost, interpreter, os.path.abspath(debugClient), 297 [rhost, interpreter, os.path.abspath(debugClient),
293 noencoding, str(port), redirect, ipaddr] 298 noencoding, str(port), redirect, ipaddr]
294 args[0] = Utilities.getExecutablePath(args[0]) 299 args[0] = Utilities.getExecutablePath(args[0])
295 process = self.__startProcess(args[0], args[1:]) 300 process = self.__startProcess(args[0], args[1:])
296 if process is None: 301 if process is None:
297 E5MessageBox.critical(None, 302 E5MessageBox.critical(
303 None,
298 self.trUtf8("Start Debugger"), 304 self.trUtf8("Start Debugger"),
299 self.trUtf8( 305 self.trUtf8(
300 """<p>The debugger backend could not be""" 306 """<p>The debugger backend could not be"""
301 """ started.</p>""")) 307 """ started.</p>"""))
302 # set translation function 308 # set translation function
338 [interpreter, os.path.abspath(debugClient), 344 [interpreter, os.path.abspath(debugClient),
339 noencoding, str(port), '0', ipaddr] 345 noencoding, str(port), '0', ipaddr]
340 args[0] = Utilities.getExecutablePath(args[0]) 346 args[0] = Utilities.getExecutablePath(args[0])
341 process = self.__startProcess(args[0], args[1:], clientEnv) 347 process = self.__startProcess(args[0], args[1:], clientEnv)
342 if process is None: 348 if process is None:
343 E5MessageBox.critical(None, 349 E5MessageBox.critical(
350 None,
344 self.trUtf8("Start Debugger"), 351 self.trUtf8("Start Debugger"),
345 self.trUtf8( 352 self.trUtf8(
346 """<p>The debugger backend could not be""" 353 """<p>The debugger backend could not be"""
347 """ started.</p>""")) 354 """ started.</p>"""))
348 return process, self.__isNetworked 355 return process, self.__isNetworked
349 356
350 process = self.__startProcess(interpreter, 357 process = self.__startProcess(
358 interpreter,
351 [debugClient, noencoding, str(port), redirect, ipaddr], 359 [debugClient, noencoding, str(port), redirect, ipaddr],
352 clientEnv) 360 clientEnv)
353 if process is None: 361 if process is None:
354 E5MessageBox.critical(None, 362 E5MessageBox.critical(
363 None,
355 self.trUtf8("Start Debugger"), 364 self.trUtf8("Start Debugger"),
356 self.trUtf8( 365 self.trUtf8(
357 """<p>The debugger backend could not be started.</p>""")) 366 """<p>The debugger backend could not be started.</p>"""))
358 return process, self.__isNetworked 367 return process, self.__isNetworked
359 368
857 if resp == DebugProtocol.CallTrace: 866 if resp == DebugProtocol.CallTrace:
858 event, fromStr, toStr = line[eoc:-1].split("@@") 867 event, fromStr, toStr = line[eoc:-1].split("@@")
859 isCall = event.lower() == "c" 868 isCall = event.lower() == "c"
860 fromFile, fromLineno, fromFunc = fromStr.rsplit(":", 2) 869 fromFile, fromLineno, fromFunc = fromStr.rsplit(":", 2)
861 toFile, toLineno, toFunc = toStr.rsplit(":", 2) 870 toFile, toLineno, toFunc = toStr.rsplit(":", 2)
862 self.debugServer.signalClientCallTrace(isCall, 871 self.debugServer.signalClientCallTrace(isCall, fromFile,
863 fromFile, fromLineno, fromFunc, 872 fromLineno,
864 toFile, toLineno, toFunc) 873 fromFunc,
874 toFile, toLineno,
875 toFunc)
865 continue 876 continue
866 877
867 if resp == DebugProtocol.ResponseThreadList: 878 if resp == DebugProtocol.ResponseThreadList:
868 currentId, threadList = eval(evalArg) 879 currentId, threadList = eval(evalArg)
869 self.debugServer.signalClientThreadList( 880 self.debugServer.signalClientThreadList(

eric ide

mercurial