65 statements. Commands and statement are always exactly one line and may be |
65 statements. Commands and statement are always exactly one line and may be |
66 interspersed. |
66 interspersed. |
67 </p><p> |
67 </p><p> |
68 The protocol is as follows. First the client opens a connection to the |
68 The protocol is as follows. First the client opens a connection to the |
69 debugger and then sends a series of one line commands. A command is either |
69 debugger and then sends a series of one line commands. A command is either |
70 >Load<, >Step<, >StepInto<, ... or a Python statement. |
70 >Load<, >Step<, >StepInto<, ... or a Python statement. |
71 See DebugProtocol.py for a listing of valid protocol tokens. |
71 See DebugProtocol.py for a listing of valid protocol tokens. |
72 </p><p> |
72 </p><p> |
73 A Python statement consists of the statement to execute, followed (in a |
73 A Python statement consists of the statement to execute, followed (in a |
74 separate line) by >OK?<. If the statement was incomplete then the response |
74 separate line) by >OK?<. If the statement was incomplete then the response |
75 is >Continue<. If there was an exception then the response is |
75 is >Continue<. If there was an exception then the response is |
76 >Exception<. |
76 >Exception<. |
77 Otherwise the response is >OK<. The reason for the >OK?< part is to |
77 Otherwise the response is >OK<. The reason for the >OK?< part is to |
78 provide a sentinal (ie. the responding >OK<) after any possible output as a |
78 provide a sentinal (ie. the responding >OK<) after any possible output as a |
79 result of executing the command. |
79 result of executing the command. |
80 </p><p> |
80 </p><p> |
218 <dd> |
218 <dd> |
219 client capabilities (integer) |
219 client capabilities (integer) |
220 </dd> |
220 </dd> |
221 </dl><a NAME="DebugClientBase.__compileFileSource" ID="DebugClientBase.__compileFileSource"></a> |
221 </dl><a NAME="DebugClientBase.__compileFileSource" ID="DebugClientBase.__compileFileSource"></a> |
222 <h4>DebugClientBase.__compileFileSource</h4> |
222 <h4>DebugClientBase.__compileFileSource</h4> |
223 <b>__compileFileSource</b>(<i>filename, mode = 'exec'</i>) |
223 <b>__compileFileSource</b>(<i>filename, mode='exec'</i>) |
224 <p> |
224 <p> |
225 Private method to compile source code read from a file. |
225 Private method to compile source code read from a file. |
226 </p><dl> |
226 </p><dl> |
227 <dt><i>filename</i></dt> |
227 <dt><i>filename</i></dt> |
228 <dd> |
228 <dd> |
308 </dd> |
308 </dd> |
309 </dl><dl> |
309 </dl><dl> |
310 <dt>Returns:</dt> |
310 <dt>Returns:</dt> |
311 <dd> |
311 <dd> |
312 A tuple consisting of a list of formatted variables. Each |
312 A tuple consisting of a list of formatted variables. Each |
313 variable entry is a tuple of three elements, the variable name, |
313 variable entry is a tuple of three elements, the variable name, |
314 its type and value. |
314 its type and value. |
315 </dd> |
315 </dd> |
316 </dl><a NAME="DebugClientBase.__formatVariablesList" ID="DebugClientBase.__formatVariablesList"></a> |
316 </dl><a NAME="DebugClientBase.__formatVariablesList" ID="DebugClientBase.__formatVariablesList"></a> |
317 <h4>DebugClientBase.__formatVariablesList</h4> |
317 <h4>DebugClientBase.__formatVariablesList</h4> |
318 <b>__formatVariablesList</b>(<i>keylist, dict, scope, filter = [], formatSequences = False</i>) |
318 <b>__formatVariablesList</b>(<i>keylist, dict, scope, filter=[], formatSequences=False</i>) |
319 <p> |
319 <p> |
320 Private method to produce a formated variables list. |
320 Private method to produce a formated variables list. |
321 </p><p> |
321 </p><p> |
322 The dictionary passed in to it is scanned. Variables are |
322 The dictionary passed in to it is scanned. Variables are |
323 only added to the list, if their type is not contained |
323 only added to the list, if their type is not contained |
324 in the filter list and their name doesn't match any of the filter expressions. |
324 in the filter list and their name doesn't match any of the filter expressions. |
325 The formated variables list (a list of tuples of 3 values) is returned. |
325 The formated variables list (a list of tuples of 3 values) is returned. |
326 </p><dl> |
326 </p><dl> |
327 <dt><i>keylist</i></dt> |
327 <dt><i>keylist</i></dt> |
328 <dd> |
328 <dd> |
337 Variables are only added to the list, if their name do not match any of the |
337 Variables are only added to the list, if their name do not match any of the |
338 filter expressions. |
338 filter expressions. |
339 </dd><dt><i>filter</i></dt> |
339 </dd><dt><i>filter</i></dt> |
340 <dd> |
340 <dd> |
341 the indices of variable types to be filtered. Variables are |
341 the indices of variable types to be filtered. Variables are |
342 only added to the list, if their type is not contained in the filter |
342 only added to the list, if their type is not contained in the filter |
343 list. |
343 list. |
344 </dd><dt><i>formatSequences</i></dt> |
344 </dd><dt><i>formatSequences</i></dt> |
345 <dd> |
345 <dd> |
346 flag indicating, that sequence or dictionary variables |
346 flag indicating, that sequence or dictionary variables |
347 should be formatted. If it is 0 (or false), just the number of items contained |
347 should be formatted. If it is 0 (or false), just the number of items contained |
349 </dd> |
349 </dd> |
350 </dl><dl> |
350 </dl><dl> |
351 <dt>Returns:</dt> |
351 <dt>Returns:</dt> |
352 <dd> |
352 <dd> |
353 A tuple consisting of a list of formatted variables. Each variable |
353 A tuple consisting of a list of formatted variables. Each variable |
354 entry is a tuple of three elements, the variable name, its type and |
354 entry is a tuple of three elements, the variable name, its type and |
355 value. |
355 value. |
356 </dd> |
356 </dd> |
357 </dl><a NAME="DebugClientBase.__generateFilterObjects" ID="DebugClientBase.__generateFilterObjects"></a> |
357 </dl><a NAME="DebugClientBase.__generateFilterObjects" ID="DebugClientBase.__generateFilterObjects"></a> |
358 <h4>DebugClientBase.__generateFilterObjects</h4> |
358 <h4>DebugClientBase.__generateFilterObjects</h4> |
359 <b>__generateFilterObjects</b>(<i>scope, filterString</i>) |
359 <b>__generateFilterObjects</b>(<i>scope, filterString</i>) |
370 </dd> |
370 </dd> |
371 </dl><a NAME="DebugClientBase.__getSysPath" ID="DebugClientBase.__getSysPath"></a> |
371 </dl><a NAME="DebugClientBase.__getSysPath" ID="DebugClientBase.__getSysPath"></a> |
372 <h4>DebugClientBase.__getSysPath</h4> |
372 <h4>DebugClientBase.__getSysPath</h4> |
373 <b>__getSysPath</b>(<i>firstEntry</i>) |
373 <b>__getSysPath</b>(<i>firstEntry</i>) |
374 <p> |
374 <p> |
375 Private slot to calculate a path list including the PYTHONPATH |
375 Private slot to calculate a path list including the PYTHONPATH |
376 environment variable. |
376 environment variable. |
377 </p><dl> |
377 </p><dl> |
378 <dt><i>firstEntry</i></dt> |
378 <dt><i>firstEntry</i></dt> |
379 <dd> |
379 <dd> |
380 entry to be put first in sys.path (string) |
380 entry to be put first in sys.path (string) |
434 <h4>DebugClientBase.absPath</h4> |
434 <h4>DebugClientBase.absPath</h4> |
435 <b>absPath</b>(<i>fn</i>) |
435 <b>absPath</b>(<i>fn</i>) |
436 <p> |
436 <p> |
437 Public method to convert a filename to an absolute name. |
437 Public method to convert a filename to an absolute name. |
438 </p><p> |
438 </p><p> |
439 sys.path is used as a set of possible prefixes. The name stays |
439 sys.path is used as a set of possible prefixes. The name stays |
440 relative if a file could not be found. |
440 relative if a file could not be found. |
441 </p><dl> |
441 </p><dl> |
442 <dt><i>fn</i></dt> |
442 <dt><i>fn</i></dt> |
443 <dd> |
443 <dd> |
444 filename (string) |
444 filename (string) |
448 <dd> |
448 <dd> |
449 the converted filename (string) |
449 the converted filename (string) |
450 </dd> |
450 </dd> |
451 </dl><a NAME="DebugClientBase.attachThread" ID="DebugClientBase.attachThread"></a> |
451 </dl><a NAME="DebugClientBase.attachThread" ID="DebugClientBase.attachThread"></a> |
452 <h4>DebugClientBase.attachThread</h4> |
452 <h4>DebugClientBase.attachThread</h4> |
453 <b>attachThread</b>(<i>target = None, args = None, kwargs = None, mainThread = False</i>) |
453 <b>attachThread</b>(<i>target=None, args=None, kwargs=None, mainThread=False</i>) |
454 <p> |
454 <p> |
455 Public method to setup a thread for DebugClient to debug. |
455 Public method to setup a thread for DebugClient to debug. |
456 </p><p> |
456 </p><p> |
457 If mainThread is non-zero, then we are attaching to the already |
457 If mainThread is non-zero, then we are attaching to the already |
458 started mainthread of the app and the rest of the args are ignored. |
458 started mainthread of the app and the rest of the args are ignored. |
459 </p><dl> |
459 </p><dl> |
460 <dt><i>target</i></dt> |
460 <dt><i>target</i></dt> |
461 <dd> |
461 <dd> |
462 the start function of the target thread (i.e. the user code) |
462 the start function of the target thread (i.e. the user code) |
488 <dd> |
488 <dd> |
489 file descriptor to be closed (integer) |
489 file descriptor to be closed (integer) |
490 </dd> |
490 </dd> |
491 </dl><a NAME="DebugClientBase.connectDebugger" ID="DebugClientBase.connectDebugger"></a> |
491 </dl><a NAME="DebugClientBase.connectDebugger" ID="DebugClientBase.connectDebugger"></a> |
492 <h4>DebugClientBase.connectDebugger</h4> |
492 <h4>DebugClientBase.connectDebugger</h4> |
493 <b>connectDebugger</b>(<i>port, remoteAddress = None, redirect = True</i>) |
493 <b>connectDebugger</b>(<i>port, remoteAddress=None, redirect=True</i>) |
494 <p> |
494 <p> |
495 Public method to establish a session with the debugger. |
495 Public method to establish a session with the debugger. |
496 </p><p> |
496 </p><p> |
497 It opens a network connection to the debugger, connects it to stdin, |
497 It opens a network connection to the debugger, connects it to stdin, |
498 stdout and stderr and saves these file objects in case the application |
498 stdout and stderr and saves these file objects in case the application |
499 being debugged redirects them itself. |
499 being debugged redirects them itself. |
500 </p><dl> |
500 </p><dl> |
501 <dt><i>port</i></dt> |
501 <dt><i>port</i></dt> |
502 <dd> |
502 <dd> |
508 <dd> |
508 <dd> |
509 flag indicating redirection of stdin, stdout and stderr (boolean) |
509 flag indicating redirection of stdin, stdout and stderr (boolean) |
510 </dd> |
510 </dd> |
511 </dl><a NAME="DebugClientBase.eventLoop" ID="DebugClientBase.eventLoop"></a> |
511 </dl><a NAME="DebugClientBase.eventLoop" ID="DebugClientBase.eventLoop"></a> |
512 <h4>DebugClientBase.eventLoop</h4> |
512 <h4>DebugClientBase.eventLoop</h4> |
513 <b>eventLoop</b>(<i>disablePolling = False</i>) |
513 <b>eventLoop</b>(<i>disablePolling=False</i>) |
514 <p> |
514 <p> |
515 Public method implementing our event loop. |
515 Public method implementing our event loop. |
516 </p><dl> |
516 </p><dl> |
517 <dt><i>disablePolling</i></dt> |
517 <dt><i>disablePolling</i></dt> |
518 <dd> |
518 <dd> |
557 <dd> |
557 <dd> |
558 the received line |
558 the received line |
559 </dd> |
559 </dd> |
560 </dl><a NAME="DebugClientBase.input" ID="DebugClientBase.input"></a> |
560 </dl><a NAME="DebugClientBase.input" ID="DebugClientBase.input"></a> |
561 <h4>DebugClientBase.input</h4> |
561 <h4>DebugClientBase.input</h4> |
562 <b>input</b>(<i>prompt, echo = True</i>) |
562 <b>input</b>(<i>prompt, echo=True</i>) |
563 <p> |
563 <p> |
564 Public method to implement input() using the event loop. |
564 Public method to implement input() using the event loop. |
565 </p><dl> |
565 </p><dl> |
566 <dt><i>prompt</i></dt> |
566 <dt><i>prompt</i></dt> |
567 <dd> |
567 <dd> |
611 <dd> |
611 <dd> |
612 result of the function call |
612 result of the function call |
613 </dd> |
613 </dd> |
614 </dl><a NAME="DebugClientBase.sessionClose" ID="DebugClientBase.sessionClose"></a> |
614 </dl><a NAME="DebugClientBase.sessionClose" ID="DebugClientBase.sessionClose"></a> |
615 <h4>DebugClientBase.sessionClose</h4> |
615 <h4>DebugClientBase.sessionClose</h4> |
616 <b>sessionClose</b>(<i>exit = True</i>) |
616 <b>sessionClose</b>(<i>exit=True</i>) |
617 <p> |
617 <p> |
618 Public method to close the session with the debugger and optionally terminate. |
618 Public method to close the session with the debugger and optionally terminate. |
619 </p><dl> |
619 </p><dl> |
620 <dt><i>exit</i></dt> |
620 <dt><i>exit</i></dt> |
621 <dd> |
621 <dd> |
636 <dd> |
636 <dd> |
637 non-zero if fn represents a file we are 'skipping', zero otherwise. |
637 non-zero if fn represents a file we are 'skipping', zero otherwise. |
638 </dd> |
638 </dd> |
639 </dl><a NAME="DebugClientBase.startDebugger" ID="DebugClientBase.startDebugger"></a> |
639 </dl><a NAME="DebugClientBase.startDebugger" ID="DebugClientBase.startDebugger"></a> |
640 <h4>DebugClientBase.startDebugger</h4> |
640 <h4>DebugClientBase.startDebugger</h4> |
641 <b>startDebugger</b>(<i>filename = None, host = None, port = None, enableTrace = True, exceptions = True, tracePython = False, redirect = True</i>) |
641 <b>startDebugger</b>(<i>filename=None, host=None, port=None, enableTrace=True, exceptions=True, tracePython=False, redirect=True</i>) |
642 <p> |
642 <p> |
643 Public method used to start the remote debugger. |
643 Public method used to start the remote debugger. |
644 </p><dl> |
644 </p><dl> |
645 <dt><i>filename</i></dt> |
645 <dt><i>filename</i></dt> |
646 <dd> |
646 <dd> |
664 <dd> |
664 <dd> |
665 flag indicating redirection of stdin, stdout and stderr (boolean) |
665 flag indicating redirection of stdin, stdout and stderr (boolean) |
666 </dd> |
666 </dd> |
667 </dl><a NAME="DebugClientBase.startProgInDebugger" ID="DebugClientBase.startProgInDebugger"></a> |
667 </dl><a NAME="DebugClientBase.startProgInDebugger" ID="DebugClientBase.startProgInDebugger"></a> |
668 <h4>DebugClientBase.startProgInDebugger</h4> |
668 <h4>DebugClientBase.startProgInDebugger</h4> |
669 <b>startProgInDebugger</b>(<i>progargs, wd = '', host = None, port = None, exceptions = True, tracePython = False, redirect = True</i>) |
669 <b>startProgInDebugger</b>(<i>progargs, wd='', host=None, port=None, exceptions=True, tracePython=False, redirect=True</i>) |
670 <p> |
670 <p> |
671 Public method used to start the remote debugger. |
671 Public method used to start the remote debugger. |
672 </p><dl> |
672 </p><dl> |
673 <dt><i>progargs</i></dt> |
673 <dt><i>progargs</i></dt> |
674 <dd> |
674 <dd> |
727 </p> |
727 </p> |
728 <div align="right"><a href="#top">Up</a></div> |
728 <div align="right"><a href="#top">Up</a></div> |
729 <hr /><hr /> |
729 <hr /><hr /> |
730 <a NAME="DebugClientInput" ID="DebugClientInput"></a> |
730 <a NAME="DebugClientInput" ID="DebugClientInput"></a> |
731 <h2>DebugClientInput</h2> |
731 <h2>DebugClientInput</h2> |
732 <b>DebugClientInput</b>(<i>prompt = "", echo = True</i>) |
732 <b>DebugClientInput</b>(<i>prompt="", echo=True</i>) |
733 <p> |
733 <p> |
734 Replacement for the standard input builtin. |
734 Replacement for the standard input builtin. |
735 </p><p> |
735 </p><p> |
736 This function works with the split debugger. |
736 This function works with the split debugger. |
737 </p><dl> |
737 </p><dl> |