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