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