82 |
84 |
83 def getClientCapabilities(self): |
85 def getClientCapabilities(self): |
84 """ |
86 """ |
85 Public method to retrieve the debug clients capabilities. |
87 Public method to retrieve the debug clients capabilities. |
86 |
88 |
87 @return debug client capabilities (integer) |
89 @return debug client capabilities |
|
90 @rtype int |
88 """ |
91 """ |
89 return self.clientCapabilities |
92 return self.clientCapabilities |
90 |
93 |
91 def newConnection(self, sock): |
94 def newConnection(self, sock): |
92 """ |
95 """ |
93 Public slot to handle a new connection. |
96 Public slot to handle a new connection. |
94 |
97 |
95 @param sock reference to the socket object (QTcpSocket) |
98 @param sock reference to the socket object |
96 @return flag indicating success (boolean) |
99 @type QTcpSocket |
|
100 @return flag indicating success |
|
101 @rtype bool |
97 """ |
102 """ |
98 return False |
103 return False |
99 |
104 |
100 def flush(self): |
105 def getDebuggerIds(self): |
101 """ |
106 """ |
102 Public slot to flush the queue. |
107 Public method to return the IDs of the connected debugger backends. |
103 """ |
108 |
104 self.queue = [] |
109 @return list of connected debugger backend IDs |
|
110 @rtype list of str |
|
111 """ |
|
112 return [] |
105 |
113 |
106 def shutdown(self): |
114 def shutdown(self): |
107 """ |
115 """ |
108 Public method to cleanly shut down. |
116 Public method to cleanly shut down. |
109 |
117 |
110 It closes our socket and shuts down |
118 It closes our socket and shuts down the debug client. |
111 the debug client. (Needed on Win OS) |
119 (Needed on Win OS) |
112 """ |
120 """ |
113 self.qsock = None |
121 self.qsock = None |
114 self.queue = [] |
122 self.queue = [] |
115 |
123 |
116 def isConnected(self): |
124 def isConnected(self): |
117 """ |
125 """ |
118 Public method to test, if a debug client has connected. |
126 Public method to test, if a debug client has connected. |
119 |
127 |
120 @return flag indicating the connection status (boolean) |
128 @return flag indicating the connection status |
|
129 @rtype bool |
121 """ |
130 """ |
122 return self.qsock is not None |
131 return self.qsock is not None |
123 |
132 |
124 def remoteEnvironment(self, env): |
133 def remoteEnvironment(self, env): |
125 """ |
134 """ |
126 Public method to set the environment for a program to debug, run, ... |
135 Public method to set the environment for a program to debug, run, ... |
127 |
136 |
128 @param env environment settings (dictionary) |
137 @param env environment settings |
|
138 @type dict |
129 """ |
139 """ |
130 return |
140 return |
131 |
141 |
132 def remoteLoad(self, fn, argv, wd, traceInterpreter=False, |
142 def remoteLoad(self, fn, argv, wd, traceInterpreter=False, |
133 autoContinue=True, autoFork=False, forkChild=False): |
143 autoContinue=True, enableMultiprocess=False): |
134 """ |
144 """ |
135 Public method to load a new program to debug. |
145 Public method to load a new program to debug. |
136 |
146 |
137 @param fn the filename to debug (string) |
147 @param fn the filename to debug |
138 @param argv the commandline arguments to pass to the program (string) |
148 @type str |
139 @param wd the working directory for the program (string) |
149 @param argv the commandline arguments to pass to the program |
140 @keyparam traceInterpreter flag indicating if the interpreter library |
150 @type str |
141 should be traced as well (boolean) |
151 @param wd the working directory for the program |
142 @keyparam autoContinue flag indicating, that the debugger should not |
152 @type str |
143 stop at the first executable line (boolean) |
153 @param traceInterpreter flag indicating if the interpreter library |
144 @keyparam autoFork flag indicating the automatic fork mode (boolean) |
154 should be traced as well |
145 @keyparam forkChild flag indicating to debug the child after forking |
155 @type bool |
146 (boolean) |
156 @param autoContinue flag indicating, that the debugger should not |
147 """ |
157 stop at the first executable line |
148 return |
158 @type bool |
149 |
159 @param enableMultiprocess flag indicating to perform multiprocess |
150 def remoteRun(self, fn, argv, wd, autoFork=False, forkChild=False): |
160 debugging |
|
161 @type bool |
|
162 """ |
|
163 return |
|
164 |
|
165 def remoteRun(self, fn, argv, wd): |
151 """ |
166 """ |
152 Public method to load a new program to run. |
167 Public method to load a new program to run. |
153 |
168 |
154 @param fn the filename to run (string) |
169 @param fn the filename to run |
155 @param argv the commandline arguments to pass to the program (string) |
170 @type str |
156 @param wd the working directory for the program (string) |
171 @param argv the commandline arguments to pass to the program |
157 @keyparam autoFork flag indicating the automatic fork mode (boolean) |
172 @type str |
158 @keyparam forkChild flag indicating to debug the child after forking |
173 @param wd the working directory for the program |
159 (boolean) |
174 @type str |
160 """ |
175 """ |
161 return |
176 return |
162 |
177 |
163 def remoteCoverage(self, fn, argv, wd, erase=False): |
178 def remoteCoverage(self, fn, argv, wd, erase=False): |
164 """ |
179 """ |
165 Public method to load a new program to collect coverage data. |
180 Public method to load a new program to collect coverage data. |
166 |
181 |
167 @param fn the filename to run (string) |
182 @param fn the filename to run |
168 @param argv the commandline arguments to pass to the program (string) |
183 @type str |
169 @param wd the working directory for the program (string) |
184 @param argv the commandline arguments to pass to the program |
170 @keyparam erase flag indicating that coverage info should be |
185 @type str |
171 cleared first (boolean) |
186 @param wd the working directory for the program |
|
187 @type str |
|
188 @param erase flag indicating that coverage info should be |
|
189 cleared first |
|
190 @type bool |
172 """ |
191 """ |
173 return |
192 return |
174 |
193 |
175 def remoteProfile(self, fn, argv, wd, erase=False): |
194 def remoteProfile(self, fn, argv, wd, erase=False): |
176 """ |
195 """ |
177 Public method to load a new program to collect profiling data. |
196 Public method to load a new program to collect profiling data. |
178 |
197 |
179 @param fn the filename to run (string) |
198 @param fn the filename to run |
180 @param argv the commandline arguments to pass to the program (string) |
199 @type str |
181 @param wd the working directory for the program (string) |
200 @param argv the commandline arguments to pass to the program |
182 @keyparam erase flag indicating that timing info should be cleared |
201 @type str |
183 first (boolean) |
202 @param wd the working directory for the program |
184 """ |
203 @type str |
185 return |
204 @param erase flag indicating that timing info should be cleared |
186 |
205 first |
187 def remoteStatement(self, stmt): |
206 @type bool |
|
207 """ |
|
208 return |
|
209 |
|
210 def remoteStatement(self, debuggerId, stmt): |
188 """ |
211 """ |
189 Public method to execute a Python statement. |
212 Public method to execute a Python statement. |
190 |
213 |
191 @param stmt the Python statement to execute (string). It |
214 @param debuggerId ID of the debugger backend |
192 should not have a trailing newline. |
215 @type str |
193 """ |
216 @param stmt the Python statement to execute. |
194 self.debugServer.signalClientStatement(False) |
217 @type str |
195 return |
218 """ |
196 |
219 self.debugServer.signalClientStatement(False, "") |
197 def remoteStep(self): |
220 return |
|
221 |
|
222 def remoteStep(self, debuggerId): |
198 """ |
223 """ |
199 Public method to single step the debugged program. |
224 Public method to single step the debugged program. |
200 """ |
225 |
201 return |
226 @param debuggerId ID of the debugger backend |
202 |
227 @type str |
203 def remoteStepOver(self): |
228 """ |
|
229 return |
|
230 |
|
231 def remoteStepOver(self, debuggerId): |
204 """ |
232 """ |
205 Public method to step over the debugged program. |
233 Public method to step over the debugged program. |
206 """ |
234 |
207 return |
235 @param debuggerId ID of the debugger backend |
208 |
236 @type str |
209 def remoteStepOut(self): |
237 """ |
|
238 return |
|
239 |
|
240 def remoteStepOut(self, debuggerId): |
210 """ |
241 """ |
211 Public method to step out the debugged program. |
242 Public method to step out the debugged program. |
212 """ |
243 |
213 return |
244 @param debuggerId ID of the debugger backend |
214 |
245 @type str |
215 def remoteStepQuit(self): |
246 """ |
|
247 return |
|
248 |
|
249 def remoteStepQuit(self, debuggerId): |
216 """ |
250 """ |
217 Public method to stop the debugged program. |
251 Public method to stop the debugged program. |
218 """ |
252 |
219 return |
253 @param debuggerId ID of the debugger backend |
220 |
254 @type str |
221 def remoteContinue(self, special=False): |
255 """ |
|
256 return |
|
257 |
|
258 def remoteContinue(self, debuggerId, special=False): |
222 """ |
259 """ |
223 Public method to continue the debugged program. |
260 Public method to continue the debugged program. |
224 |
261 |
|
262 @param debuggerId ID of the debugger backend |
|
263 @type str |
225 @param special flag indicating a special continue operation |
264 @param special flag indicating a special continue operation |
226 """ |
265 @type bool |
227 return |
266 """ |
228 |
267 return |
229 def remoteMoveIP(self, line): |
268 |
|
269 def remoteContinueUntil(self, debuggerId, line): |
|
270 """ |
|
271 Public method to continue the debugged program to the given line |
|
272 or until returning from the current frame. |
|
273 |
|
274 @param debuggerId ID of the debugger backend |
|
275 @type str |
|
276 @param line the new line, where execution should be continued to |
|
277 @type int |
|
278 """ |
|
279 return |
|
280 |
|
281 def remoteMoveIP(self, debuggerId, line): |
230 """ |
282 """ |
231 Public method to move the instruction pointer to a different line. |
283 Public method to move the instruction pointer to a different line. |
232 |
284 |
|
285 @param debuggerId ID of the debugger backend |
|
286 @type str |
233 @param line the new line, where execution should be continued |
287 @param line the new line, where execution should be continued |
234 """ |
288 @type int |
235 return |
289 """ |
236 |
290 return |
237 def remoteBreakpoint(self, fn, line, setBreakpoint, cond=None, temp=False): |
291 |
|
292 def remoteBreakpoint(self, debuggerId, fn, line, setBreakpoint, cond=None, |
|
293 temp=False): |
238 """ |
294 """ |
239 Public method to set or clear a breakpoint. |
295 Public method to set or clear a breakpoint. |
240 |
296 |
241 @param fn filename the breakpoint belongs to (string) |
297 @param debuggerId ID of the debugger backend |
242 @param line linenumber of the breakpoint (int) |
298 @type str |
243 @param setBreakpoint flag indicating setting or resetting a |
299 @param fn filename the breakpoint belongs to |
244 breakpoint (boolean) |
300 @type str |
245 @param cond condition of the breakpoint (string) |
301 @param line linenumber of the breakpoint |
246 @param temp flag indicating a temporary breakpoint (boolean) |
302 @type int |
247 """ |
303 @param setBreakpoint flag indicating setting or resetting a breakpoint |
248 return |
304 @type bool |
249 |
305 @param cond condition of the breakpoint |
250 def remoteBreakpointEnable(self, fn, line, enable): |
306 @type str |
|
307 @param temp flag indicating a temporary breakpoint |
|
308 @type bool |
|
309 """ |
|
310 return |
|
311 |
|
312 def remoteBreakpointEnable(self, debuggerId, fn, line, enable): |
251 """ |
313 """ |
252 Public method to enable or disable a breakpoint. |
314 Public method to enable or disable a breakpoint. |
253 |
315 |
254 @param fn filename the breakpoint belongs to (string) |
316 @param debuggerId ID of the debugger backend |
255 @param line linenumber of the breakpoint (int) |
317 @type str |
|
318 @param fn filename the breakpoint belongs to |
|
319 @type str |
|
320 @param line linenumber of the breakpoint |
|
321 @type int |
256 @param enable flag indicating enabling or disabling a breakpoint |
322 @param enable flag indicating enabling or disabling a breakpoint |
257 (boolean) |
323 @type bool |
258 """ |
324 """ |
259 return |
325 return |
260 |
326 |
261 def remoteBreakpointIgnore(self, fn, line, count): |
327 def remoteBreakpointIgnore(self, debuggerId, fn, line, count): |
262 """ |
328 """ |
263 Public method to ignore a breakpoint the next couple of occurrences. |
329 Public method to ignore a breakpoint the next couple of occurrences. |
264 |
330 |
265 @param fn filename the breakpoint belongs to (string) |
331 @param debuggerId ID of the debugger backend |
266 @param line linenumber of the breakpoint (int) |
332 @type str |
267 @param count number of occurrences to ignore (int) |
333 @param fn filename the breakpoint belongs to |
268 """ |
334 @type str |
269 return |
335 @param line linenumber of the breakpoint |
270 |
336 @type int |
271 def remoteWatchpoint(self, cond, setWatch, temp=False): |
337 @param count number of occurrences to ignore |
|
338 @type int |
|
339 """ |
|
340 return |
|
341 |
|
342 def remoteWatchpoint(self, debuggerId, cond, setWatch, temp=False): |
272 """ |
343 """ |
273 Public method to set or clear a watch expression. |
344 Public method to set or clear a watch expression. |
274 |
345 |
275 @param cond expression of the watch expression (string) |
346 @param debuggerId ID of the debugger backend |
|
347 @type str |
|
348 @param cond expression of the watch expression |
|
349 @type str |
276 @param setWatch flag indicating setting or resetting a watch expression |
350 @param setWatch flag indicating setting or resetting a watch expression |
277 (boolean) |
351 @type bool |
278 @param temp flag indicating a temporary watch expression (boolean) |
352 @param temp flag indicating a temporary watch expression |
279 """ |
353 @type bool |
280 return |
354 """ |
281 |
355 return |
282 def remoteWatchpointEnable(self, cond, enable): |
356 |
|
357 def remoteWatchpointEnable(self, debuggerId, cond, enable): |
283 """ |
358 """ |
284 Public method to enable or disable a watch expression. |
359 Public method to enable or disable a watch expression. |
285 |
360 |
286 @param cond expression of the watch expression (string) |
361 @param debuggerId ID of the debugger backend |
287 @param enable flag indicating enabling or disabling a watch |
362 @type str |
288 expression (boolean) |
363 @param cond expression of the watch expression |
289 """ |
364 @type str |
290 return |
365 @param enable flag indicating enabling or disabling a watch expression |
291 |
366 @type bool |
292 def remoteWatchpointIgnore(self, cond, count): |
367 """ |
|
368 return |
|
369 |
|
370 def remoteWatchpointIgnore(self, debuggerId, cond, count): |
293 """ |
371 """ |
294 Public method to ignore a watch expression the next couple of |
372 Public method to ignore a watch expression the next couple of |
295 occurrences. |
373 occurrences. |
296 |
374 |
297 @param cond expression of the watch expression (string) |
375 @param debuggerId ID of the debugger backend |
298 @param count number of occurrences to ignore (int) |
376 @type str |
299 """ |
377 @param cond expression of the watch expression |
300 return |
378 @type str |
301 |
379 @param count number of occurrences to ignore |
302 def remoteRawInput(self, s): |
380 @type int |
|
381 """ |
|
382 return |
|
383 |
|
384 def remoteRawInput(self, debuggerId, inputString): |
303 """ |
385 """ |
304 Public method to send the raw input to the debugged program. |
386 Public method to send the raw input to the debugged program. |
305 |
387 |
306 @param s the raw input (string) |
388 @param debuggerId ID of the debugger backend |
307 """ |
389 @type str |
308 return |
390 @param inputString the raw input |
309 |
391 @type str |
310 def remoteThreadList(self): |
392 """ |
|
393 return |
|
394 |
|
395 def remoteThreadList(self, debuggerId): |
311 """ |
396 """ |
312 Public method to request the list of threads from the client. |
397 Public method to request the list of threads from the client. |
313 """ |
398 |
314 return |
399 @param debuggerId ID of the debugger backend |
315 |
400 @type str |
316 def remoteSetThread(self, tid): |
401 """ |
|
402 return |
|
403 |
|
404 def remoteSetThread(self, debuggerId, tid): |
317 """ |
405 """ |
318 Public method to request to set the given thread as current thread. |
406 Public method to request to set the given thread as current thread. |
319 |
407 |
320 @param tid id of the thread (integer) |
408 @param debuggerId ID of the debugger backend |
321 """ |
409 @type str |
322 return |
410 @param tid id of the thread |
323 |
411 @type int |
324 def remoteClientVariables(self, scope, filterList, framenr=0, maxSize=0): |
412 """ |
|
413 return |
|
414 |
|
415 def remoteClientStack(self, debuggerId): |
|
416 """ |
|
417 Public method to request the stack of the main thread. |
|
418 |
|
419 @param debuggerId ID of the debugger backend |
|
420 @type str |
|
421 """ |
|
422 return |
|
423 |
|
424 def remoteClientVariables(self, debuggerId, scope, filterList, framenr=0, |
|
425 maxSize=0): |
325 """ |
426 """ |
326 Public method to request the variables of the debugged program. |
427 Public method to request the variables of the debugged program. |
327 |
428 |
|
429 @param debuggerId ID of the debugger backend |
|
430 @type str |
328 @param scope the scope of the variables (0 = local, 1 = global) |
431 @param scope the scope of the variables (0 = local, 1 = global) |
329 @type int |
432 @type int |
330 @param filterList list of variable types to filter out |
433 @param filterList list of variable types to filter out |
331 @type list of int |
434 @type list of str |
332 @param framenr framenumber of the variables to retrieve |
435 @param framenr framenumber of the variables to retrieve |
333 @type int |
436 @type int |
334 @param maxSize maximum size the formatted value of a variable will |
437 @param maxSize maximum size the formatted value of a variable will |
335 be shown. If it is bigger than that, a 'too big' indication will |
438 be shown. If it is bigger than that, a 'too big' indication will |
336 be given (@@TOO_BIG_TO_SHOW@@). |
439 be given (@@TOO_BIG_TO_SHOW@@). |
337 @type int |
440 @type int |
338 """ |
441 """ |
339 return |
442 return |
340 |
443 |
341 def remoteClientVariable(self, scope, filterList, var, framenr=0, |
444 def remoteClientVariable(self, debuggerId, scope, filterList, var, |
342 maxSize=0): |
445 framenr=0, maxSize=0): |
343 """ |
446 """ |
344 Public method to request the variables of the debugged program. |
447 Public method to request the variables of the debugged program. |
345 |
448 |
|
449 @param debuggerId ID of the debugger backend |
|
450 @type str |
346 @param scope the scope of the variables (0 = local, 1 = global) |
451 @param scope the scope of the variables (0 = local, 1 = global) |
347 @type int |
452 @type int |
348 @param filterList list of variable types to filter out |
453 @param filterList list of variable types to filter out |
349 @type list of int |
454 @type list of str |
350 @param var list encoded name of variable to retrieve |
455 @param var list encoded name of variable to retrieve |
351 @type list of str |
456 @type list of str |
352 @param framenr framenumber of the variables to retrieve (int) |
457 @param framenr framenumber of the variables to retrieve |
353 @type int |
458 @type int |
354 @param maxSize maximum size the formatted value of a variable will |
459 @param maxSize maximum size the formatted value of a variable will |
355 be shown. If it is bigger than that, a 'too big' indication will |
460 be shown. If it is bigger than that, a 'too big' indication will |
356 be given (@@TOO_BIG_TO_SHOW@@). |
461 be given (@@TOO_BIG_TO_SHOW@@). |
357 @type int |
462 @type int |
358 """ |
463 """ |
359 return |
464 return |
360 |
465 |
361 def remoteClientSetFilter(self, scope, filterStr): |
466 def remoteClientDisassembly(self, debuggerId): |
|
467 """ |
|
468 Public method to ask the client for the latest traceback disassembly. |
|
469 |
|
470 @param debuggerId ID of the debugger backend |
|
471 @type str |
|
472 """ |
|
473 return |
|
474 |
|
475 def remoteClientSetFilter(self, debuggerId, scope, filterStr): |
362 """ |
476 """ |
363 Public method to set a variables filter list. |
477 Public method to set a variables filter list. |
364 |
478 |
|
479 @param debuggerId ID of the debugger backend |
|
480 @type str |
365 @param scope the scope of the variables (0 = local, 1 = global) |
481 @param scope the scope of the variables (0 = local, 1 = global) |
|
482 @type int |
366 @param filterStr regexp string for variable names to filter out |
483 @param filterStr regexp string for variable names to filter out |
367 (string) |
484 @type str |
368 """ |
485 """ |
369 return |
486 return |
370 |
487 |
371 def setCallTraceEnabled(self, on): |
488 def setCallTraceEnabled(self, debuggerId, on): |
372 """ |
489 """ |
373 Public method to set the call trace state. |
490 Public method to set the call trace state. |
374 |
491 |
375 @param on flag indicating to enable the call trace function (boolean) |
492 @param debuggerId ID of the debugger backend |
376 """ |
493 @type str |
377 return |
494 @param on flag indicating to enable the call trace function |
378 |
495 @type bool |
379 def remoteEval(self, arg): |
496 """ |
380 """ |
497 return |
381 Public method to evaluate arg in the current context of the debugged |
498 |
382 program. |
499 def remoteNoDebugList(self, debuggerId, noDebugList): |
383 |
500 """ |
384 @param arg the arguments to evaluate (string) |
501 Public method to set a list of programs not to be debugged. |
|
502 |
|
503 The programs given in the list will not be run under the control |
|
504 of the multi process debugger. |
|
505 |
|
506 @param debuggerId ID of the debugger backend |
|
507 @type str |
|
508 @param noDebugList list of Python programs not to be debugged |
|
509 @type list of str |
385 """ |
510 """ |
386 return |
511 return |
387 |
512 |
388 def remoteBanner(self): |
513 def remoteBanner(self): |
389 """ |
514 """ |
390 Public slot to get the banner info of the remote client. |
515 Public slot to get the banner info of the remote client. |
391 """ |
516 """ |
392 return |
517 return |
393 |
518 |
394 def remoteCapabilities(self): |
519 def remoteCapabilities(self, debuggerId): |
395 """ |
520 """ |
396 Public slot to get the debug clients capabilities. |
521 Public slot to get the debug clients capabilities. |
397 """ |
522 |
398 return |
523 @param debuggerId ID of the debugger backend |
399 |
524 @type str |
400 def remoteCompletion(self, text): |
525 """ |
|
526 return |
|
527 |
|
528 def remoteCompletion(self, debuggerId, text): |
401 """ |
529 """ |
402 Public slot to get the a list of possible commandline completions |
530 Public slot to get the a list of possible commandline completions |
403 from the remote client. |
531 from the remote client. |
404 |
532 |
405 @param text the text to be completed (string) |
533 @param debuggerId ID of the debugger backend |
|
534 @type str |
|
535 @param text the text to be completed |
|
536 @type str |
406 """ |
537 """ |
407 return |
538 return |
408 |
539 |
409 def remoteUTDiscover(self, syspath, workdir, discoveryStart): |
540 def remoteUTDiscover(self, syspath, workdir, discoveryStart): |
410 """ |
541 """ |