DebugClients/Python3/DebugClientBase.py

changeset 2953
703452a2876f
parent 2761
bcc10ef7015d
child 2987
c99695c0f13a
equal deleted inserted replaced
2952:94fc661a54a2 2953:703452a2876f
36 """ 36 """
37 Replacement for the standard input builtin. 37 Replacement for the standard input builtin.
38 38
39 This function works with the split debugger. 39 This function works with the split debugger.
40 40
41 @param prompt The prompt to be shown. (string) 41 @param prompt prompt to be shown (string)
42 @param echo flag indicating to echo the output (boolean)
43 @return result of the input() call
42 """ 44 """
43 if DebugClientInstance is None or not DebugClientInstance.redirect: 45 if DebugClientInstance is None or not DebugClientInstance.redirect:
44 return DebugClientOrigInput(prompt) 46 return DebugClientOrigInput(prompt)
45 47
46 return DebugClientInstance.input(prompt, echo) 48 return DebugClientInstance.input(prompt, echo)
58 60
59 61
60 def DebugClientFork(): 62 def DebugClientFork():
61 """ 63 """
62 Replacement for the standard os.fork(). 64 Replacement for the standard os.fork().
65
66 @return result of the fork() call
63 """ 67 """
64 if DebugClientInstance is None: 68 if DebugClientInstance is None:
65 return DebugClientOrigFork() 69 return DebugClientOrigFork()
66 70
67 return DebugClientInstance.fork() 71 return DebugClientInstance.fork()
262 @param target the start function of the target thread (i.e. the user code) 266 @param target the start function of the target thread (i.e. the user code)
263 @param args arguments to pass to target 267 @param args arguments to pass to target
264 @param kwargs keyword arguments to pass to target 268 @param kwargs keyword arguments to pass to target
265 @param mainThread True, if we are attaching to the already 269 @param mainThread True, if we are attaching to the already
266 started mainthread of the app 270 started mainthread of the app
267 @return The identifier of the created thread
268 """ 271 """
269 if self.debugging: 272 if self.debugging:
270 sys.setprofile(self.profile) 273 sys.setprofile(self.profile)
271 274
272 def __dumpThreadList(self): 275 def __dumpThreadList(self):
306 self.eventLoop(True) 309 self.eventLoop(True)
307 return self.rawLine 310 return self.rawLine
308 311
309 def __exceptionRaised(self): 312 def __exceptionRaised(self):
310 """ 313 """
311 Private method called in the case of an exception 314 Private method called in the case of an exception.
312 315
313 It ensures that the debug server is informed of the raised exception. 316 It ensures that the debug server is informed of the raised exception.
314 """ 317 """
315 self.pendingResponse = DebugProtocol.ResponseException 318 self.pendingResponse = DebugProtocol.ResponseException
316 319
1211 return False 1214 return False
1212 1215
1213 def getRunning(self): 1216 def getRunning(self):
1214 """ 1217 """
1215 Public method to return the main script we are currently running. 1218 Public method to return the main script we are currently running.
1219
1220 @return flag indicating a running debug session (boolean)
1216 """ 1221 """
1217 return self.running 1222 return self.running
1218 1223
1219 def progTerminated(self, status): 1224 def progTerminated(self, status):
1220 """ 1225 """
2063 else: 2068 else:
2064 print("No network port given. Aborting...") 2069 print("No network port given. Aborting...")
2065 2070
2066 def fork(self): 2071 def fork(self):
2067 """ 2072 """
2068 Public method implementing a fork routine deciding which branch to follow. 2073 Public method implementing a fork routine deciding which branch
2074 to follow.
2075
2076 @return process ID (integer)
2069 """ 2077 """
2070 if not self.fork_auto: 2078 if not self.fork_auto:
2071 self.write(DebugProtocol.RequestForkTo + '\n') 2079 self.write(DebugProtocol.RequestForkTo + '\n')
2072 self.eventLoop(True) 2080 self.eventLoop(True)
2073 pid = DebugClientOrigFork() 2081 pid = DebugClientOrigFork()

eric ide

mercurial