|
1 <?xml version="1.0" encoding="utf-8"?> |
|
2 <!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' |
|
3 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'> |
|
4 <html><head> |
|
5 <title>eric5.DebugClients.Python3.DebugClientBase</title> |
|
6 <style> |
|
7 b'body {\n background:white;\n margin: 0em 1em 10em 1em;\n color: black;\n}\n\nh1 { color: white; background: #4FA4FF; }\nh2 { color: white; background: #4FA4FF; }\nh3 { color: white; background: #00557F; }\nh4 { color: white; background: #00557F; }\n \na { color: #AA5500; }\n' |
|
8 </style> |
|
9 </head> |
|
10 <body><a NAME="top" ID="top"></a> |
|
11 <h1>eric5.DebugClients.Python3.DebugClientBase</h1> |
|
12 <p> |
|
13 Module implementing a debug client base class. |
|
14 </p> |
|
15 <h3>Global Attributes</h3> |
|
16 <table> |
|
17 <tr><td>DebugClientInstance</td></tr> |
|
18 </table> |
|
19 <h3>Classes</h3> |
|
20 <table> |
|
21 <tr> |
|
22 <td><a href="#DebugClientBase">DebugClientBase</a></td> |
|
23 <td>Class implementing the client side of the debugger.</td> |
|
24 </tr> |
|
25 </table> |
|
26 <h3>Functions</h3> |
|
27 <table> |
|
28 <tr> |
|
29 <td><a href="#DebugClientClose">DebugClientClose</a></td> |
|
30 <td>Replacement for the standard os.close(fd).</td> |
|
31 </tr><tr> |
|
32 <td><a href="#DebugClientFork">DebugClientFork</a></td> |
|
33 <td>Replacement for the standard os.fork().</td> |
|
34 </tr><tr> |
|
35 <td><a href="#DebugClientInput">DebugClientInput</a></td> |
|
36 <td>Replacement for the standard input builtin.</td> |
|
37 </tr><tr> |
|
38 <td><a href="#DebugClientSetRecursionLimit">DebugClientSetRecursionLimit</a></td> |
|
39 <td>Replacement for the standard sys.setrecursionlimit(limit).</td> |
|
40 </tr> |
|
41 </table> |
|
42 <hr /><hr /> |
|
43 <a NAME="DebugClientBase" ID="DebugClientBase"></a> |
|
44 <h2>DebugClientBase</h2> |
|
45 <p> |
|
46 Class implementing the client side of the debugger. |
|
47 </p><p> |
|
48 It provides access to the Python interpeter from a debugger running in another |
|
49 process whether or not the Qt event loop is running. |
|
50 </p><p> |
|
51 The protocol between the debugger and the client assumes that there will be |
|
52 a single source of debugger commands and a single source of Python |
|
53 statements. Commands and statement are always exactly one line and may be |
|
54 interspersed. |
|
55 </p><p> |
|
56 The protocol is as follows. First the client opens a connection to the |
|
57 debugger and then sends a series of one line commands. A command is either |
|
58 &gt;Load&lt;, &gt;Step&lt;, &gt;StepInto&lt;, ... or a Python statement. |
|
59 See DebugProtocol.py for a listing of valid protocol tokens. |
|
60 </p><p> |
|
61 A Python statement consists of the statement to execute, followed (in a |
|
62 separate line) by &gt;OK?&lt;. If the statement was incomplete then the response |
|
63 is &gt;Continue&lt;. If there was an exception then the response is |
|
64 &gt;Exception&lt;. |
|
65 Otherwise the response is &gt;OK&lt;. The reason for the &gt;OK?&lt; part is to |
|
66 provide a sentinal (ie. the responding &gt;OK&lt;) after any possible output as a |
|
67 result of executing the command. |
|
68 </p><p> |
|
69 The client may send any other lines at any other time which should be |
|
70 interpreted as program output. |
|
71 </p><p> |
|
72 If the debugger closes the session there is no response from the client. |
|
73 The client may close the session at any time as a result of the script |
|
74 being debugged closing or crashing. |
|
75 </p><p> |
|
76 <b>Note</b>: This class is meant to be subclassed by individual DebugClient classes. |
|
77 Do not instantiate it directly. |
|
78 </p> |
|
79 <h3>Derived from</h3> |
|
80 object |
|
81 <h3>Class Attributes</h3> |
|
82 <table> |
|
83 <tr><td>clientCapabilities</td></tr> |
|
84 </table> |
|
85 <h3>Methods</h3> |
|
86 <table> |
|
87 <tr> |
|
88 <td><a href="#DebugClientBase.__init__">DebugClientBase</a></td> |
|
89 <td>Constructor</td> |
|
90 </tr><tr> |
|
91 <td><a href="#DebugClientBase.__clientCapabilities">__clientCapabilities</a></td> |
|
92 <td>Private method to determine the clients capabilities.</td> |
|
93 </tr><tr> |
|
94 <td><a href="#DebugClientBase.__compileFileSource">__compileFileSource</a></td> |
|
95 <td>Private method to compile source code read from a file.</td> |
|
96 </tr><tr> |
|
97 <td><a href="#DebugClientBase.__completionList">__completionList</a></td> |
|
98 <td>Private slot to handle the request for a commandline completion list.</td> |
|
99 </tr><tr> |
|
100 <td><a href="#DebugClientBase.__dumpThreadList">__dumpThreadList</a></td> |
|
101 <td>Public method to send the list of threads.</td> |
|
102 </tr><tr> |
|
103 <td><a href="#DebugClientBase.__dumpVariable">__dumpVariable</a></td> |
|
104 <td>Private method to return the variables of a frame to the debug server.</td> |
|
105 </tr><tr> |
|
106 <td><a href="#DebugClientBase.__dumpVariables">__dumpVariables</a></td> |
|
107 <td>Private method to return the variables of a frame to the debug server.</td> |
|
108 </tr><tr> |
|
109 <td><a href="#DebugClientBase.__exceptionRaised">__exceptionRaised</a></td> |
|
110 <td>Private method called in the case of an exception</td> |
|
111 </tr><tr> |
|
112 <td><a href="#DebugClientBase.__formatQt4Variable">__formatQt4Variable</a></td> |
|
113 <td>Private method to produce a formatted output of a simple Qt4 type.</td> |
|
114 </tr><tr> |
|
115 <td><a href="#DebugClientBase.__formatVariablesList">__formatVariablesList</a></td> |
|
116 <td>Private method to produce a formated variables list.</td> |
|
117 </tr><tr> |
|
118 <td><a href="#DebugClientBase.__generateFilterObjects">__generateFilterObjects</a></td> |
|
119 <td>Private slot to convert a filter string to a list of filter objects.</td> |
|
120 </tr><tr> |
|
121 <td><a href="#DebugClientBase.__interact">__interact</a></td> |
|
122 <td>Private method to Interact with the debugger.</td> |
|
123 </tr><tr> |
|
124 <td><a href="#DebugClientBase.__resolveHost">__resolveHost</a></td> |
|
125 <td>Private method to resolve a hostname to an IP address.</td> |
|
126 </tr><tr> |
|
127 <td><a href="#DebugClientBase.__setCoding">__setCoding</a></td> |
|
128 <td>Private method to set the coding used by a python file.</td> |
|
129 </tr><tr> |
|
130 <td><a href="#DebugClientBase.__unhandled_exception">__unhandled_exception</a></td> |
|
131 <td>Private method called to report an uncaught exception.</td> |
|
132 </tr><tr> |
|
133 <td><a href="#DebugClientBase.absPath">absPath</a></td> |
|
134 <td>Public method to convert a filename to an absolute name.</td> |
|
135 </tr><tr> |
|
136 <td><a href="#DebugClientBase.attachThread">attachThread</a></td> |
|
137 <td>Public method to setup a thread for DebugClient to debug.</td> |
|
138 </tr><tr> |
|
139 <td><a href="#DebugClientBase.close">close</a></td> |
|
140 <td>Private method implementing a close method as a replacement for os.close().</td> |
|
141 </tr><tr> |
|
142 <td><a href="#DebugClientBase.connectDebugger">connectDebugger</a></td> |
|
143 <td>Public method to establish a session with the debugger.</td> |
|
144 </tr><tr> |
|
145 <td><a href="#DebugClientBase.eventLoop">eventLoop</a></td> |
|
146 <td>Public method implementing our event loop.</td> |
|
147 </tr><tr> |
|
148 <td><a href="#DebugClientBase.eventPoll">eventPoll</a></td> |
|
149 <td>Public method to poll for events like 'set break point'.</td> |
|
150 </tr><tr> |
|
151 <td><a href="#DebugClientBase.fork">fork</a></td> |
|
152 <td>Public method implementing a fork routine deciding which branch to follow.</td> |
|
153 </tr><tr> |
|
154 <td><a href="#DebugClientBase.getCoding">getCoding</a></td> |
|
155 <td>Public method to return the current coding.</td> |
|
156 </tr><tr> |
|
157 <td><a href="#DebugClientBase.getRunning">getRunning</a></td> |
|
158 <td>Public method to return the main script we are currently running.</td> |
|
159 </tr><tr> |
|
160 <td><a href="#DebugClientBase.handleLine">handleLine</a></td> |
|
161 <td>Public method to handle the receipt of a complete line.</td> |
|
162 </tr><tr> |
|
163 <td><a href="#DebugClientBase.input">input</a></td> |
|
164 <td>Public method to implement input() using the event loop.</td> |
|
165 </tr><tr> |
|
166 <td><a href="#DebugClientBase.main">main</a></td> |
|
167 <td>Public method implementing the main method.</td> |
|
168 </tr><tr> |
|
169 <td><a href="#DebugClientBase.progTerminated">progTerminated</a></td> |
|
170 <td>Public method to tell the debugger that the program has terminated.</td> |
|
171 </tr><tr> |
|
172 <td><a href="#DebugClientBase.run_call">run_call</a></td> |
|
173 <td>Public method used to start the remote debugger and call a function.</td> |
|
174 </tr><tr> |
|
175 <td><a href="#DebugClientBase.sessionClose">sessionClose</a></td> |
|
176 <td>Public method to close the session with the debugger and optionally terminate.</td> |
|
177 </tr><tr> |
|
178 <td><a href="#DebugClientBase.shouldSkip">shouldSkip</a></td> |
|
179 <td>Public method to check if a file should be skipped.</td> |
|
180 </tr><tr> |
|
181 <td><a href="#DebugClientBase.startDebugger">startDebugger</a></td> |
|
182 <td>Public method used to start the remote debugger.</td> |
|
183 </tr><tr> |
|
184 <td><a href="#DebugClientBase.startProgInDebugger">startProgInDebugger</a></td> |
|
185 <td>Public method used to start the remote debugger.</td> |
|
186 </tr><tr> |
|
187 <td><a href="#DebugClientBase.write">write</a></td> |
|
188 <td>Public method to write data to the output stream.</td> |
|
189 </tr> |
|
190 </table> |
|
191 <a NAME="DebugClientBase.__init__" ID="DebugClientBase.__init__"></a> |
|
192 <h4>DebugClientBase (Constructor)</h4> |
|
193 <b>DebugClientBase</b>(<i></i>) |
|
194 <p> |
|
195 Constructor |
|
196 </p><a NAME="DebugClientBase.__clientCapabilities" ID="DebugClientBase.__clientCapabilities"></a> |
|
197 <h4>DebugClientBase.__clientCapabilities</h4> |
|
198 <b>__clientCapabilities</b>(<i></i>) |
|
199 <p> |
|
200 Private method to determine the clients capabilities. |
|
201 </p><dl> |
|
202 <dt>Returns:</dt> |
|
203 <dd> |
|
204 client capabilities (integer) |
|
205 </dd> |
|
206 </dl><a NAME="DebugClientBase.__compileFileSource" ID="DebugClientBase.__compileFileSource"></a> |
|
207 <h4>DebugClientBase.__compileFileSource</h4> |
|
208 <b>__compileFileSource</b>(<i>filename, mode = 'exec'</i>) |
|
209 <p> |
|
210 Private method to compile source code read from a file. |
|
211 </p><dl> |
|
212 <dt><i>filename</i></dt> |
|
213 <dd> |
|
214 name of the source file (string) |
|
215 </dd><dt><i>mode</i></dt> |
|
216 <dd> |
|
217 kind of code to be generated (string, exec or eval) |
|
218 </dd> |
|
219 </dl><dl> |
|
220 <dt>Returns:</dt> |
|
221 <dd> |
|
222 compiled code object (None in case of errors) |
|
223 </dd> |
|
224 </dl><a NAME="DebugClientBase.__completionList" ID="DebugClientBase.__completionList"></a> |
|
225 <h4>DebugClientBase.__completionList</h4> |
|
226 <b>__completionList</b>(<i>text</i>) |
|
227 <p> |
|
228 Private slot to handle the request for a commandline completion list. |
|
229 </p><dl> |
|
230 <dt><i>text</i></dt> |
|
231 <dd> |
|
232 the text to be completed (string) |
|
233 </dd> |
|
234 </dl><a NAME="DebugClientBase.__dumpThreadList" ID="DebugClientBase.__dumpThreadList"></a> |
|
235 <h4>DebugClientBase.__dumpThreadList</h4> |
|
236 <b>__dumpThreadList</b>(<i></i>) |
|
237 <p> |
|
238 Public method to send the list of threads. |
|
239 </p><a NAME="DebugClientBase.__dumpVariable" ID="DebugClientBase.__dumpVariable"></a> |
|
240 <h4>DebugClientBase.__dumpVariable</h4> |
|
241 <b>__dumpVariable</b>(<i>var, frmnr, scope, filter</i>) |
|
242 <p> |
|
243 Private method to return the variables of a frame to the debug server. |
|
244 </p><dl> |
|
245 <dt><i>var</i></dt> |
|
246 <dd> |
|
247 list encoded name of the requested variable (list of strings) |
|
248 </dd><dt><i>frmnr</i></dt> |
|
249 <dd> |
|
250 distance of frame reported on. 0 is the current frame (int) |
|
251 </dd><dt><i>scope</i></dt> |
|
252 <dd> |
|
253 1 to report global variables, 0 for local variables (int) |
|
254 </dd><dt><i>filter</i></dt> |
|
255 <dd> |
|
256 the indices of variable types to be filtered (list of int) |
|
257 </dd> |
|
258 </dl><a NAME="DebugClientBase.__dumpVariables" ID="DebugClientBase.__dumpVariables"></a> |
|
259 <h4>DebugClientBase.__dumpVariables</h4> |
|
260 <b>__dumpVariables</b>(<i>frmnr, scope, filter</i>) |
|
261 <p> |
|
262 Private method to return the variables of a frame to the debug server. |
|
263 </p><dl> |
|
264 <dt><i>frmnr</i></dt> |
|
265 <dd> |
|
266 distance of frame reported on. 0 is the current frame (int) |
|
267 </dd><dt><i>scope</i></dt> |
|
268 <dd> |
|
269 1 to report global variables, 0 for local variables (int) |
|
270 </dd><dt><i>filter</i></dt> |
|
271 <dd> |
|
272 the indices of variable types to be filtered (list of int) |
|
273 </dd> |
|
274 </dl><a NAME="DebugClientBase.__exceptionRaised" ID="DebugClientBase.__exceptionRaised"></a> |
|
275 <h4>DebugClientBase.__exceptionRaised</h4> |
|
276 <b>__exceptionRaised</b>(<i></i>) |
|
277 <p> |
|
278 Private method called in the case of an exception |
|
279 </p><p> |
|
280 It ensures that the debug server is informed of the raised exception. |
|
281 </p><a NAME="DebugClientBase.__formatQt4Variable" ID="DebugClientBase.__formatQt4Variable"></a> |
|
282 <h4>DebugClientBase.__formatQt4Variable</h4> |
|
283 <b>__formatQt4Variable</b>(<i>value, vtype</i>) |
|
284 <p> |
|
285 Private method to produce a formatted output of a simple Qt4 type. |
|
286 </p><dl> |
|
287 <dt><i>value</i></dt> |
|
288 <dd> |
|
289 variable to be formatted |
|
290 </dd><dt><i>vtype</i></dt> |
|
291 <dd> |
|
292 type of the variable to be formatted (string) |
|
293 </dd> |
|
294 </dl><dl> |
|
295 <dt>Returns:</dt> |
|
296 <dd> |
|
297 A tuple consisting of a list of formatted variables. Each |
|
298 variable entry is a tuple of three elements, the variable name, |
|
299 its type and value. |
|
300 </dd> |
|
301 </dl><a NAME="DebugClientBase.__formatVariablesList" ID="DebugClientBase.__formatVariablesList"></a> |
|
302 <h4>DebugClientBase.__formatVariablesList</h4> |
|
303 <b>__formatVariablesList</b>(<i>keylist, dict, scope, filter = [], formatSequences = False</i>) |
|
304 <p> |
|
305 Private method to produce a formated variables list. |
|
306 </p><p> |
|
307 The dictionary passed in to it is scanned. Variables are |
|
308 only added to the list, if their type is not contained |
|
309 in the filter list and their name doesn't match any of the filter expressions. |
|
310 The formated variables list (a list of tuples of 3 values) is returned. |
|
311 </p><dl> |
|
312 <dt><i>keylist</i></dt> |
|
313 <dd> |
|
314 keys of the dictionary |
|
315 </dd><dt><i>dict</i></dt> |
|
316 <dd> |
|
317 the dictionary to be scanned |
|
318 </dd><dt><i>scope</i></dt> |
|
319 <dd> |
|
320 1 to filter using the globals filter, 0 using the locals |
|
321 filter (int). |
|
322 Variables are only added to the list, if their name do not match any of the |
|
323 filter expressions. |
|
324 </dd><dt><i>filter</i></dt> |
|
325 <dd> |
|
326 the indices of variable types to be filtered. Variables are |
|
327 only added to the list, if their type is not contained in the filter |
|
328 list. |
|
329 </dd><dt><i>formatSequences</i></dt> |
|
330 <dd> |
|
331 flag indicating, that sequence or dictionary variables |
|
332 should be formatted. If it is 0 (or false), just the number of items contained |
|
333 in these variables is returned. (boolean) |
|
334 </dd> |
|
335 </dl><dl> |
|
336 <dt>Returns:</dt> |
|
337 <dd> |
|
338 A tuple consisting of a list of formatted variables. Each variable |
|
339 entry is a tuple of three elements, the variable name, its type and |
|
340 value. |
|
341 </dd> |
|
342 </dl><a NAME="DebugClientBase.__generateFilterObjects" ID="DebugClientBase.__generateFilterObjects"></a> |
|
343 <h4>DebugClientBase.__generateFilterObjects</h4> |
|
344 <b>__generateFilterObjects</b>(<i>scope, filterString</i>) |
|
345 <p> |
|
346 Private slot to convert a filter string to a list of filter objects. |
|
347 </p><dl> |
|
348 <dt><i>scope</i></dt> |
|
349 <dd> |
|
350 1 to generate filter for global variables, 0 for local |
|
351 variables (int) |
|
352 </dd><dt><i>filterString</i></dt> |
|
353 <dd> |
|
354 string of filter patterns separated by ';' |
|
355 </dd> |
|
356 </dl><a NAME="DebugClientBase.__interact" ID="DebugClientBase.__interact"></a> |
|
357 <h4>DebugClientBase.__interact</h4> |
|
358 <b>__interact</b>(<i></i>) |
|
359 <p> |
|
360 Private method to Interact with the debugger. |
|
361 </p><a NAME="DebugClientBase.__resolveHost" ID="DebugClientBase.__resolveHost"></a> |
|
362 <h4>DebugClientBase.__resolveHost</h4> |
|
363 <b>__resolveHost</b>(<i>host</i>) |
|
364 <p> |
|
365 Private method to resolve a hostname to an IP address. |
|
366 </p><dl> |
|
367 <dt><i>host</i></dt> |
|
368 <dd> |
|
369 hostname of the debug server (string) |
|
370 </dd> |
|
371 </dl><dl> |
|
372 <dt>Returns:</dt> |
|
373 <dd> |
|
374 IP address (string) |
|
375 </dd> |
|
376 </dl><a NAME="DebugClientBase.__setCoding" ID="DebugClientBase.__setCoding"></a> |
|
377 <h4>DebugClientBase.__setCoding</h4> |
|
378 <b>__setCoding</b>(<i>filename</i>) |
|
379 <p> |
|
380 Private method to set the coding used by a python file. |
|
381 </p><dl> |
|
382 <dt><i>filename</i></dt> |
|
383 <dd> |
|
384 name of the file to inspect (string) |
|
385 </dd> |
|
386 </dl><a NAME="DebugClientBase.__unhandled_exception" ID="DebugClientBase.__unhandled_exception"></a> |
|
387 <h4>DebugClientBase.__unhandled_exception</h4> |
|
388 <b>__unhandled_exception</b>(<i>exctype, excval, exctb</i>) |
|
389 <p> |
|
390 Private method called to report an uncaught exception. |
|
391 </p><dl> |
|
392 <dt><i>exctype</i></dt> |
|
393 <dd> |
|
394 the type of the exception |
|
395 </dd><dt><i>excval</i></dt> |
|
396 <dd> |
|
397 data about the exception |
|
398 </dd><dt><i>exctb</i></dt> |
|
399 <dd> |
|
400 traceback for the exception |
|
401 </dd> |
|
402 </dl><a NAME="DebugClientBase.absPath" ID="DebugClientBase.absPath"></a> |
|
403 <h4>DebugClientBase.absPath</h4> |
|
404 <b>absPath</b>(<i>fn</i>) |
|
405 <p> |
|
406 Public method to convert a filename to an absolute name. |
|
407 </p><p> |
|
408 sys.path is used as a set of possible prefixes. The name stays |
|
409 relative if a file could not be found. |
|
410 </p><dl> |
|
411 <dt><i>fn</i></dt> |
|
412 <dd> |
|
413 filename (string) |
|
414 </dd> |
|
415 </dl><dl> |
|
416 <dt>Returns:</dt> |
|
417 <dd> |
|
418 the converted filename (string) |
|
419 </dd> |
|
420 </dl><a NAME="DebugClientBase.attachThread" ID="DebugClientBase.attachThread"></a> |
|
421 <h4>DebugClientBase.attachThread</h4> |
|
422 <b>attachThread</b>(<i>target = None, args = None, kwargs = None, mainThread = False</i>) |
|
423 <p> |
|
424 Public method to setup a thread for DebugClient to debug. |
|
425 </p><p> |
|
426 If mainThread is non-zero, then we are attaching to the already |
|
427 started mainthread of the app and the rest of the args are ignored. |
|
428 </p><dl> |
|
429 <dt><i>target</i></dt> |
|
430 <dd> |
|
431 the start function of the target thread (i.e. the user code) |
|
432 </dd><dt><i>args</i></dt> |
|
433 <dd> |
|
434 arguments to pass to target |
|
435 </dd><dt><i>kwargs</i></dt> |
|
436 <dd> |
|
437 keyword arguments to pass to target |
|
438 </dd><dt><i>mainThread</i></dt> |
|
439 <dd> |
|
440 True, if we are attaching to the already |
|
441 started mainthread of the app |
|
442 </dd> |
|
443 </dl><dl> |
|
444 <dt>Returns:</dt> |
|
445 <dd> |
|
446 The identifier of the created thread |
|
447 </dd> |
|
448 </dl><a NAME="DebugClientBase.close" ID="DebugClientBase.close"></a> |
|
449 <h4>DebugClientBase.close</h4> |
|
450 <b>close</b>(<i>fd</i>) |
|
451 <p> |
|
452 Private method implementing a close method as a replacement for os.close(). |
|
453 </p><p> |
|
454 It prevents the debugger connections from being closed. |
|
455 </p><dl> |
|
456 <dt><i>fd</i></dt> |
|
457 <dd> |
|
458 file descriptor to be closed (integer) |
|
459 </dd> |
|
460 </dl><a NAME="DebugClientBase.connectDebugger" ID="DebugClientBase.connectDebugger"></a> |
|
461 <h4>DebugClientBase.connectDebugger</h4> |
|
462 <b>connectDebugger</b>(<i>port, remoteAddress = None, redirect = True</i>) |
|
463 <p> |
|
464 Public method to establish a session with the debugger. |
|
465 </p><p> |
|
466 It opens a network connection to the debugger, connects it to stdin, |
|
467 stdout and stderr and saves these file objects in case the application |
|
468 being debugged redirects them itself. |
|
469 </p><dl> |
|
470 <dt><i>port</i></dt> |
|
471 <dd> |
|
472 the port number to connect to (int) |
|
473 </dd><dt><i>remoteAddress</i></dt> |
|
474 <dd> |
|
475 the network address of the debug server host (string) |
|
476 </dd><dt><i>redirect</i></dt> |
|
477 <dd> |
|
478 flag indicating redirection of stdin, stdout and stderr (boolean) |
|
479 </dd> |
|
480 </dl><a NAME="DebugClientBase.eventLoop" ID="DebugClientBase.eventLoop"></a> |
|
481 <h4>DebugClientBase.eventLoop</h4> |
|
482 <b>eventLoop</b>(<i>disablePolling = False</i>) |
|
483 <p> |
|
484 Public method implementing our event loop. |
|
485 </p><dl> |
|
486 <dt><i>disablePolling</i></dt> |
|
487 <dd> |
|
488 flag indicating to enter an event loop with |
|
489 polling disabled (boolean) |
|
490 </dd> |
|
491 </dl><a NAME="DebugClientBase.eventPoll" ID="DebugClientBase.eventPoll"></a> |
|
492 <h4>DebugClientBase.eventPoll</h4> |
|
493 <b>eventPoll</b>(<i></i>) |
|
494 <p> |
|
495 Public method to poll for events like 'set break point'. |
|
496 </p><a NAME="DebugClientBase.fork" ID="DebugClientBase.fork"></a> |
|
497 <h4>DebugClientBase.fork</h4> |
|
498 <b>fork</b>(<i></i>) |
|
499 <p> |
|
500 Public method implementing a fork routine deciding which branch to follow. |
|
501 </p><a NAME="DebugClientBase.getCoding" ID="DebugClientBase.getCoding"></a> |
|
502 <h4>DebugClientBase.getCoding</h4> |
|
503 <b>getCoding</b>(<i></i>) |
|
504 <p> |
|
505 Public method to return the current coding. |
|
506 </p><dl> |
|
507 <dt>Returns:</dt> |
|
508 <dd> |
|
509 codec name (string) |
|
510 </dd> |
|
511 </dl><a NAME="DebugClientBase.getRunning" ID="DebugClientBase.getRunning"></a> |
|
512 <h4>DebugClientBase.getRunning</h4> |
|
513 <b>getRunning</b>(<i></i>) |
|
514 <p> |
|
515 Public method to return the main script we are currently running. |
|
516 </p><a NAME="DebugClientBase.handleLine" ID="DebugClientBase.handleLine"></a> |
|
517 <h4>DebugClientBase.handleLine</h4> |
|
518 <b>handleLine</b>(<i>line</i>) |
|
519 <p> |
|
520 Public method to handle the receipt of a complete line. |
|
521 </p><p> |
|
522 It first looks for a valid protocol token at the start of the line. Thereafter |
|
523 it trys to execute the lines accumulated so far. |
|
524 </p><dl> |
|
525 <dt><i>line</i></dt> |
|
526 <dd> |
|
527 the received line |
|
528 </dd> |
|
529 </dl><a NAME="DebugClientBase.input" ID="DebugClientBase.input"></a> |
|
530 <h4>DebugClientBase.input</h4> |
|
531 <b>input</b>(<i>prompt, echo</i>) |
|
532 <p> |
|
533 Public method to implement input() using the event loop. |
|
534 </p><dl> |
|
535 <dt><i>prompt</i></dt> |
|
536 <dd> |
|
537 the prompt to be shown (string) |
|
538 </dd><dt><i>echo</i></dt> |
|
539 <dd> |
|
540 Flag indicating echoing of the input (boolean) |
|
541 </dd> |
|
542 </dl><dl> |
|
543 <dt>Returns:</dt> |
|
544 <dd> |
|
545 the entered string |
|
546 </dd> |
|
547 </dl><a NAME="DebugClientBase.main" ID="DebugClientBase.main"></a> |
|
548 <h4>DebugClientBase.main</h4> |
|
549 <b>main</b>(<i></i>) |
|
550 <p> |
|
551 Public method implementing the main method. |
|
552 </p><a NAME="DebugClientBase.progTerminated" ID="DebugClientBase.progTerminated"></a> |
|
553 <h4>DebugClientBase.progTerminated</h4> |
|
554 <b>progTerminated</b>(<i>status</i>) |
|
555 <p> |
|
556 Public method to tell the debugger that the program has terminated. |
|
557 </p><dl> |
|
558 <dt><i>status</i></dt> |
|
559 <dd> |
|
560 the return status |
|
561 </dd> |
|
562 </dl><a NAME="DebugClientBase.run_call" ID="DebugClientBase.run_call"></a> |
|
563 <h4>DebugClientBase.run_call</h4> |
|
564 <b>run_call</b>(<i>scriptname, func, *args</i>) |
|
565 <p> |
|
566 Public method used to start the remote debugger and call a function. |
|
567 </p><dl> |
|
568 <dt><i>scriptname</i></dt> |
|
569 <dd> |
|
570 name of the script to be debugged (string) |
|
571 </dd><dt><i>func</i></dt> |
|
572 <dd> |
|
573 function to be called |
|
574 </dd><dt><i>*args</i></dt> |
|
575 <dd> |
|
576 arguments being passed to func |
|
577 </dd> |
|
578 </dl><dl> |
|
579 <dt>Returns:</dt> |
|
580 <dd> |
|
581 result of the function call |
|
582 </dd> |
|
583 </dl><a NAME="DebugClientBase.sessionClose" ID="DebugClientBase.sessionClose"></a> |
|
584 <h4>DebugClientBase.sessionClose</h4> |
|
585 <b>sessionClose</b>(<i>exit = True</i>) |
|
586 <p> |
|
587 Public method to close the session with the debugger and optionally terminate. |
|
588 </p><dl> |
|
589 <dt><i>exit</i></dt> |
|
590 <dd> |
|
591 flag indicating to terminate (boolean) |
|
592 </dd> |
|
593 </dl><a NAME="DebugClientBase.shouldSkip" ID="DebugClientBase.shouldSkip"></a> |
|
594 <h4>DebugClientBase.shouldSkip</h4> |
|
595 <b>shouldSkip</b>(<i>fn</i>) |
|
596 <p> |
|
597 Public method to check if a file should be skipped. |
|
598 </p><dl> |
|
599 <dt><i>fn</i></dt> |
|
600 <dd> |
|
601 filename to be checked |
|
602 </dd> |
|
603 </dl><dl> |
|
604 <dt>Returns:</dt> |
|
605 <dd> |
|
606 non-zero if fn represents a file we are 'skipping', zero otherwise. |
|
607 </dd> |
|
608 </dl><a NAME="DebugClientBase.startDebugger" ID="DebugClientBase.startDebugger"></a> |
|
609 <h4>DebugClientBase.startDebugger</h4> |
|
610 <b>startDebugger</b>(<i>filename = None, host = None, port = None, enableTrace = True, exceptions = True, tracePython = False, redirect = True</i>) |
|
611 <p> |
|
612 Public method used to start the remote debugger. |
|
613 </p><dl> |
|
614 <dt><i>filename</i></dt> |
|
615 <dd> |
|
616 the program to be debugged (string) |
|
617 </dd><dt><i>host</i></dt> |
|
618 <dd> |
|
619 hostname of the debug server (string) |
|
620 </dd><dt><i>port</i></dt> |
|
621 <dd> |
|
622 portnumber of the debug server (int) |
|
623 </dd><dt><i>enableTrace</i></dt> |
|
624 <dd> |
|
625 flag to enable the tracing function (boolean) |
|
626 </dd><dt><i>exceptions</i></dt> |
|
627 <dd> |
|
628 flag to enable exception reporting of the IDE (boolean) |
|
629 </dd><dt><i>tracePython</i></dt> |
|
630 <dd> |
|
631 flag to enable tracing into the Python library (boolean) |
|
632 </dd><dt><i>redirect</i></dt> |
|
633 <dd> |
|
634 flag indicating redirection of stdin, stdout and stderr (boolean) |
|
635 </dd> |
|
636 </dl><a NAME="DebugClientBase.startProgInDebugger" ID="DebugClientBase.startProgInDebugger"></a> |
|
637 <h4>DebugClientBase.startProgInDebugger</h4> |
|
638 <b>startProgInDebugger</b>(<i>progargs, wd = '', host = None, port = None, exceptions = True, tracePython = False, redirect = True</i>) |
|
639 <p> |
|
640 Public method used to start the remote debugger. |
|
641 </p><dl> |
|
642 <dt><i>progargs</i></dt> |
|
643 <dd> |
|
644 commandline for the program to be debugged |
|
645 (list of strings) |
|
646 </dd><dt><i>wd</i></dt> |
|
647 <dd> |
|
648 working directory for the program execution (string) |
|
649 </dd><dt><i>host</i></dt> |
|
650 <dd> |
|
651 hostname of the debug server (string) |
|
652 </dd><dt><i>port</i></dt> |
|
653 <dd> |
|
654 portnumber of the debug server (int) |
|
655 </dd><dt><i>exceptions</i></dt> |
|
656 <dd> |
|
657 flag to enable exception reporting of the IDE (boolean) |
|
658 </dd><dt><i>tracePython</i></dt> |
|
659 <dd> |
|
660 flag to enable tracing into the Python library (boolean) |
|
661 </dd><dt><i>redirect</i></dt> |
|
662 <dd> |
|
663 flag indicating redirection of stdin, stdout and stderr (boolean) |
|
664 </dd> |
|
665 </dl><a NAME="DebugClientBase.write" ID="DebugClientBase.write"></a> |
|
666 <h4>DebugClientBase.write</h4> |
|
667 <b>write</b>(<i>s</i>) |
|
668 <p> |
|
669 Public method to write data to the output stream. |
|
670 </p><dl> |
|
671 <dt><i>s</i></dt> |
|
672 <dd> |
|
673 data to be written (string) |
|
674 </dd> |
|
675 </dl> |
|
676 <div align="right"><a href="#top">Up</a></div> |
|
677 <hr /><hr /> |
|
678 <a NAME="DebugClientClose" ID="DebugClientClose"></a> |
|
679 <h2>DebugClientClose</h2> |
|
680 <b>DebugClientClose</b>(<i>fd</i>) |
|
681 <p> |
|
682 Replacement for the standard os.close(fd). |
|
683 </p><dl> |
|
684 <dt><i>fd</i></dt> |
|
685 <dd> |
|
686 open file descriptor to be closed (integer) |
|
687 </dd> |
|
688 </dl> |
|
689 <div align="right"><a href="#top">Up</a></div> |
|
690 <hr /><hr /> |
|
691 <a NAME="DebugClientFork" ID="DebugClientFork"></a> |
|
692 <h2>DebugClientFork</h2> |
|
693 <b>DebugClientFork</b>(<i></i>) |
|
694 <p> |
|
695 Replacement for the standard os.fork(). |
|
696 </p> |
|
697 <div align="right"><a href="#top">Up</a></div> |
|
698 <hr /><hr /> |
|
699 <a NAME="DebugClientInput" ID="DebugClientInput"></a> |
|
700 <h2>DebugClientInput</h2> |
|
701 <b>DebugClientInput</b>(<i>prompt = ""</i>) |
|
702 <p> |
|
703 Replacement for the standard input builtin. |
|
704 </p><p> |
|
705 This function works with the split debugger. |
|
706 </p><dl> |
|
707 <dt><i>prompt</i></dt> |
|
708 <dd> |
|
709 The prompt to be shown. (string) |
|
710 </dd> |
|
711 </dl> |
|
712 <div align="right"><a href="#top">Up</a></div> |
|
713 <hr /><hr /> |
|
714 <a NAME="DebugClientSetRecursionLimit" ID="DebugClientSetRecursionLimit"></a> |
|
715 <h2>DebugClientSetRecursionLimit</h2> |
|
716 <b>DebugClientSetRecursionLimit</b>(<i>limit</i>) |
|
717 <p> |
|
718 Replacement for the standard sys.setrecursionlimit(limit). |
|
719 </p><dl> |
|
720 <dt><i>limit</i></dt> |
|
721 <dd> |
|
722 recursion limit (integer) |
|
723 </dd> |
|
724 </dl> |
|
725 <div align="right"><a href="#top">Up</a></div> |
|
726 <hr /> |
|
727 </body></html> |