|
1 <!DOCTYPE html> |
|
2 <html><head> |
|
3 <title>eric6.DebugClients.Python.DebugClientBase</title> |
|
4 <meta charset="UTF-8"> |
|
5 <style> |
|
6 body { |
|
7 background: #EDECE6; |
|
8 margin: 0em 1em 10em 1em; |
|
9 color: black; |
|
10 } |
|
11 |
|
12 h1 { color: white; background: #85774A; } |
|
13 h2 { color: white; background: #85774A; } |
|
14 h3 { color: white; background: #9D936E; } |
|
15 h4 { color: white; background: #9D936E; } |
|
16 |
|
17 a { color: #BA6D36; } |
|
18 |
|
19 </style> |
|
20 </head> |
|
21 <body><a NAME="top" ID="top"></a> |
|
22 <h1>eric6.DebugClients.Python.DebugClientBase</h1> |
|
23 <p> |
|
24 Module implementing a debug client base class. |
|
25 </p> |
|
26 <h3>Global Attributes</h3> |
|
27 <table> |
|
28 <tr><td>DebugClientInstance</td></tr> |
|
29 </table> |
|
30 <h3>Classes</h3> |
|
31 <table> |
|
32 <tr> |
|
33 <td><a href="#DebugClientBase">DebugClientBase</a></td> |
|
34 <td>Class implementing the client side of the debugger.</td> |
|
35 </tr> |
|
36 </table> |
|
37 <h3>Functions</h3> |
|
38 <table> |
|
39 <tr> |
|
40 <td><a href="#DebugClientClose">DebugClientClose</a></td> |
|
41 <td>Replacement for the standard os.close(fd).</td> |
|
42 </tr><tr> |
|
43 <td><a href="#DebugClientFork">DebugClientFork</a></td> |
|
44 <td>Replacement for the standard os.fork().</td> |
|
45 </tr><tr> |
|
46 <td><a href="#DebugClientInput">DebugClientInput</a></td> |
|
47 <td>Replacement for the standard input builtin.</td> |
|
48 </tr><tr> |
|
49 <td><a href="#DebugClientRawInput">DebugClientRawInput</a></td> |
|
50 <td>Replacement for the standard raw_input builtin.</td> |
|
51 </tr><tr> |
|
52 <td><a href="#DebugClientSetRecursionLimit">DebugClientSetRecursionLimit</a></td> |
|
53 <td>Replacement for the standard sys.setrecursionlimit(limit).</td> |
|
54 </tr> |
|
55 </table> |
|
56 <hr /><hr /> |
|
57 <a NAME="DebugClientBase" ID="DebugClientBase"></a> |
|
58 <h2>DebugClientBase</h2> |
|
59 <p> |
|
60 Class implementing the client side of the debugger. |
|
61 </p><p> |
|
62 It provides access to the Python interpeter from a debugger running in |
|
63 another process. |
|
64 </p><p> |
|
65 The protocol between the debugger and the client is based on JSONRPC 2.0 |
|
66 PDUs. Each one is sent on a single line, i.e. commands or responses are |
|
67 separated by a linefeed character. |
|
68 </p><p> |
|
69 If the debugger closes the session there is no response from the client. |
|
70 The client may close the session at any time as a result of the script |
|
71 being debugged closing or crashing. |
|
72 </p><p> |
|
73 <b>Note</b>: This class is meant to be subclassed by individual |
|
74 DebugClient classes. Do not instantiate it directly. |
|
75 </p> |
|
76 <h3>Derived from</h3> |
|
77 object |
|
78 <h3>Class Attributes</h3> |
|
79 <table> |
|
80 <tr><td>Indicators</td></tr><tr><td>clientCapabilities</td></tr> |
|
81 </table> |
|
82 <h3>Class Methods</h3> |
|
83 <table> |
|
84 <tr><td>None</td></tr> |
|
85 </table> |
|
86 <h3>Methods</h3> |
|
87 <table> |
|
88 <tr> |
|
89 <td><a href="#DebugClientBase.__init__">DebugClientBase</a></td> |
|
90 <td>Constructor</td> |
|
91 </tr><tr> |
|
92 <td><a href="#DebugClientBase.__clientCapabilities">__clientCapabilities</a></td> |
|
93 <td>Private method to determine the clients capabilities.</td> |
|
94 </tr><tr> |
|
95 <td><a href="#DebugClientBase.__compileFileSource">__compileFileSource</a></td> |
|
96 <td>Private method to compile source code read from a file.</td> |
|
97 </tr><tr> |
|
98 <td><a href="#DebugClientBase.__completionList">__completionList</a></td> |
|
99 <td>Private slot to handle the request for a commandline completion list.</td> |
|
100 </tr><tr> |
|
101 <td><a href="#DebugClientBase.__dumpVariable">__dumpVariable</a></td> |
|
102 <td>Private method to return the variables of a frame to the debug server.</td> |
|
103 </tr><tr> |
|
104 <td><a href="#DebugClientBase.__dumpVariables">__dumpVariables</a></td> |
|
105 <td>Private method to return the variables of a frame to the debug server.</td> |
|
106 </tr><tr> |
|
107 <td><a href="#DebugClientBase.__extractIndicators">__extractIndicators</a></td> |
|
108 <td>Private method to extract the indicator string from a variable text.</td> |
|
109 </tr><tr> |
|
110 <td><a href="#DebugClientBase.__formatQtVariable">__formatQtVariable</a></td> |
|
111 <td>Private method to produce a formatted output of a simple Qt4/Qt5 type.</td> |
|
112 </tr><tr> |
|
113 <td><a href="#DebugClientBase.__formatVariablesList">__formatVariablesList</a></td> |
|
114 <td>Private method to produce a formated variables list.</td> |
|
115 </tr><tr> |
|
116 <td><a href="#DebugClientBase.__generateFilterObjects">__generateFilterObjects</a></td> |
|
117 <td>Private slot to convert a filter string to a list of filter objects.</td> |
|
118 </tr><tr> |
|
119 <td><a href="#DebugClientBase.__getCompletionList">__getCompletionList</a></td> |
|
120 <td>Private method to create a completions list.</td> |
|
121 </tr><tr> |
|
122 <td><a href="#DebugClientBase.__getSysPath">__getSysPath</a></td> |
|
123 <td>Private slot to calculate a path list including the PYTHONPATH environment variable.</td> |
|
124 </tr><tr> |
|
125 <td><a href="#DebugClientBase.__interact">__interact</a></td> |
|
126 <td>Private method to interact with the debugger.</td> |
|
127 </tr><tr> |
|
128 <td><a href="#DebugClientBase.__interceptSignals">__interceptSignals</a></td> |
|
129 <td>Private method to intercept common signals.</td> |
|
130 </tr><tr> |
|
131 <td><a href="#DebugClientBase.__resolveHost">__resolveHost</a></td> |
|
132 <td>Private method to resolve a hostname to an IP address.</td> |
|
133 </tr><tr> |
|
134 <td><a href="#DebugClientBase.__setCoding">__setCoding</a></td> |
|
135 <td>Private method to set the coding used by a python file.</td> |
|
136 </tr><tr> |
|
137 <td><a href="#DebugClientBase.__signalHandler">__signalHandler</a></td> |
|
138 <td>Private method to handle signals.</td> |
|
139 </tr><tr> |
|
140 <td><a href="#DebugClientBase.__unhandled_exception">__unhandled_exception</a></td> |
|
141 <td>Private method called to report an uncaught exception.</td> |
|
142 </tr><tr> |
|
143 <td><a href="#DebugClientBase.absPath">absPath</a></td> |
|
144 <td>Public method to convert a filename to an absolute name.</td> |
|
145 </tr><tr> |
|
146 <td><a href="#DebugClientBase.close">close</a></td> |
|
147 <td>Public method implementing a close method as a replacement for os.close().</td> |
|
148 </tr><tr> |
|
149 <td><a href="#DebugClientBase.connectDebugger">connectDebugger</a></td> |
|
150 <td>Public method to establish a session with the debugger.</td> |
|
151 </tr><tr> |
|
152 <td><a href="#DebugClientBase.eventLoop">eventLoop</a></td> |
|
153 <td>Public method implementing our event loop.</td> |
|
154 </tr><tr> |
|
155 <td><a href="#DebugClientBase.eventPoll">eventPoll</a></td> |
|
156 <td>Public method to poll for events like 'set break point'.</td> |
|
157 </tr><tr> |
|
158 <td><a href="#DebugClientBase.fork">fork</a></td> |
|
159 <td>Public method implementing a fork routine deciding which branch to follow.</td> |
|
160 </tr><tr> |
|
161 <td><a href="#DebugClientBase.getCoding">getCoding</a></td> |
|
162 <td>Public method to return the current coding.</td> |
|
163 </tr><tr> |
|
164 <td><a href="#DebugClientBase.getRunning">getRunning</a></td> |
|
165 <td>Public method to return the main script we are currently running.</td> |
|
166 </tr><tr> |
|
167 <td><a href="#DebugClientBase.handleJsonCommand">handleJsonCommand</a></td> |
|
168 <td>Public method to handle a command serialized as a JSON string.</td> |
|
169 </tr><tr> |
|
170 <td><a href="#DebugClientBase.handleLine">handleLine</a></td> |
|
171 <td>Public method to handle the receipt of a complete line.</td> |
|
172 </tr><tr> |
|
173 <td><a href="#DebugClientBase.input">input</a></td> |
|
174 <td>Public method to implement input() (Python 2) using the event loop.</td> |
|
175 </tr><tr> |
|
176 <td><a href="#DebugClientBase.main">main</a></td> |
|
177 <td>Public method implementing the main method.</td> |
|
178 </tr><tr> |
|
179 <td><a href="#DebugClientBase.progTerminated">progTerminated</a></td> |
|
180 <td>Public method to tell the debugger that the program has terminated.</td> |
|
181 </tr><tr> |
|
182 <td><a href="#DebugClientBase.raw_input">raw_input</a></td> |
|
183 <td>Public method to implement raw_input() / input() using the event loop.</td> |
|
184 </tr><tr> |
|
185 <td><a href="#DebugClientBase.readReady">readReady</a></td> |
|
186 <td>Public method called when there is data ready to be read.</td> |
|
187 </tr><tr> |
|
188 <td><a href="#DebugClientBase.run_call">run_call</a></td> |
|
189 <td>Public method used to start the remote debugger and call a function.</td> |
|
190 </tr><tr> |
|
191 <td><a href="#DebugClientBase.sendCallTrace">sendCallTrace</a></td> |
|
192 <td>Public method to send a call trace entry.</td> |
|
193 </tr><tr> |
|
194 <td><a href="#DebugClientBase.sendClearTemporaryBreakpoint">sendClearTemporaryBreakpoint</a></td> |
|
195 <td>Public method to signal the deletion of a temporary breakpoint.</td> |
|
196 </tr><tr> |
|
197 <td><a href="#DebugClientBase.sendClearTemporaryWatch">sendClearTemporaryWatch</a></td> |
|
198 <td>Public method to signal the deletion of a temporary watch expression.</td> |
|
199 </tr><tr> |
|
200 <td><a href="#DebugClientBase.sendException">sendException</a></td> |
|
201 <td>Public method to send information for an exception.</td> |
|
202 </tr><tr> |
|
203 <td><a href="#DebugClientBase.sendJsonCommand">sendJsonCommand</a></td> |
|
204 <td>Public method to send a single command or response to the IDE.</td> |
|
205 </tr><tr> |
|
206 <td><a href="#DebugClientBase.sendPassiveStartup">sendPassiveStartup</a></td> |
|
207 <td>Public method to send the passive start information.</td> |
|
208 </tr><tr> |
|
209 <td><a href="#DebugClientBase.sendResponseLine">sendResponseLine</a></td> |
|
210 <td>Public method to send the current call stack.</td> |
|
211 </tr><tr> |
|
212 <td><a href="#DebugClientBase.sendSyntaxError">sendSyntaxError</a></td> |
|
213 <td>Public method to send information for a syntax error.</td> |
|
214 </tr><tr> |
|
215 <td><a href="#DebugClientBase.sessionClose">sessionClose</a></td> |
|
216 <td>Public method to close the session with the debugger and optionally terminate.</td> |
|
217 </tr><tr> |
|
218 <td><a href="#DebugClientBase.startDebugger">startDebugger</a></td> |
|
219 <td>Public method used to start the remote debugger.</td> |
|
220 </tr><tr> |
|
221 <td><a href="#DebugClientBase.startProgInDebugger">startProgInDebugger</a></td> |
|
222 <td>Public method used to start the remote debugger.</td> |
|
223 </tr><tr> |
|
224 <td><a href="#DebugClientBase.writeReady">writeReady</a></td> |
|
225 <td>Public method called when we are ready to write data.</td> |
|
226 </tr> |
|
227 </table> |
|
228 <h3>Static Methods</h3> |
|
229 <table> |
|
230 <tr><td>None</td></tr> |
|
231 </table> |
|
232 <a NAME="DebugClientBase.__init__" ID="DebugClientBase.__init__"></a> |
|
233 <h4>DebugClientBase (Constructor)</h4> |
|
234 <b>DebugClientBase</b>(<i></i>) |
|
235 <p> |
|
236 Constructor |
|
237 </p><a NAME="DebugClientBase.__clientCapabilities" ID="DebugClientBase.__clientCapabilities"></a> |
|
238 <h4>DebugClientBase.__clientCapabilities</h4> |
|
239 <b>__clientCapabilities</b>(<i></i>) |
|
240 <p> |
|
241 Private method to determine the clients capabilities. |
|
242 </p><dl> |
|
243 <dt>Returns:</dt> |
|
244 <dd> |
|
245 client capabilities (integer) |
|
246 </dd> |
|
247 </dl><a NAME="DebugClientBase.__compileFileSource" ID="DebugClientBase.__compileFileSource"></a> |
|
248 <h4>DebugClientBase.__compileFileSource</h4> |
|
249 <b>__compileFileSource</b>(<i>filename, mode='exec'</i>) |
|
250 <p> |
|
251 Private method to compile source code read from a file. |
|
252 </p><dl> |
|
253 <dt><i>filename</i></dt> |
|
254 <dd> |
|
255 name of the source file (string) |
|
256 </dd><dt><i>mode</i></dt> |
|
257 <dd> |
|
258 kind of code to be generated (string, exec or eval) |
|
259 </dd> |
|
260 </dl><dl> |
|
261 <dt>Returns:</dt> |
|
262 <dd> |
|
263 compiled code object (None in case of errors) |
|
264 </dd> |
|
265 </dl><a NAME="DebugClientBase.__completionList" ID="DebugClientBase.__completionList"></a> |
|
266 <h4>DebugClientBase.__completionList</h4> |
|
267 <b>__completionList</b>(<i>text</i>) |
|
268 <p> |
|
269 Private slot to handle the request for a commandline completion list. |
|
270 </p><dl> |
|
271 <dt><i>text</i></dt> |
|
272 <dd> |
|
273 the text to be completed (string) |
|
274 </dd> |
|
275 </dl><a NAME="DebugClientBase.__dumpVariable" ID="DebugClientBase.__dumpVariable"></a> |
|
276 <h4>DebugClientBase.__dumpVariable</h4> |
|
277 <b>__dumpVariable</b>(<i>var, frmnr, scope, filter</i>) |
|
278 <p> |
|
279 Private method to return the variables of a frame to the debug server. |
|
280 </p><dl> |
|
281 <dt><i>var</i></dt> |
|
282 <dd> |
|
283 list encoded name of the requested variable |
|
284 (list of strings) |
|
285 </dd><dt><i>frmnr</i></dt> |
|
286 <dd> |
|
287 distance of frame reported on. 0 is the current frame |
|
288 (int) |
|
289 </dd><dt><i>scope</i></dt> |
|
290 <dd> |
|
291 1 to report global variables, 0 for local variables (int) |
|
292 </dd><dt><i>filter</i></dt> |
|
293 <dd> |
|
294 the indices of variable types to be filtered |
|
295 (list of int) |
|
296 </dd> |
|
297 </dl><a NAME="DebugClientBase.__dumpVariables" ID="DebugClientBase.__dumpVariables"></a> |
|
298 <h4>DebugClientBase.__dumpVariables</h4> |
|
299 <b>__dumpVariables</b>(<i>frmnr, scope, filter</i>) |
|
300 <p> |
|
301 Private method to return the variables of a frame to the debug server. |
|
302 </p><dl> |
|
303 <dt><i>frmnr</i></dt> |
|
304 <dd> |
|
305 distance of frame reported on. 0 is the current frame |
|
306 (int) |
|
307 </dd><dt><i>scope</i></dt> |
|
308 <dd> |
|
309 1 to report global variables, 0 for local variables (int) |
|
310 </dd><dt><i>filter</i></dt> |
|
311 <dd> |
|
312 the indices of variable types to be filtered |
|
313 (list of int) |
|
314 </dd> |
|
315 </dl><a NAME="DebugClientBase.__extractIndicators" ID="DebugClientBase.__extractIndicators"></a> |
|
316 <h4>DebugClientBase.__extractIndicators</h4> |
|
317 <b>__extractIndicators</b>(<i>var</i>) |
|
318 <p> |
|
319 Private method to extract the indicator string from a variable text. |
|
320 </p><dl> |
|
321 <dt><i>var</i> (str)</dt> |
|
322 <dd> |
|
323 variable text |
|
324 </dd> |
|
325 </dl><dl> |
|
326 <dt>Returns:</dt> |
|
327 <dd> |
|
328 tuple containing the variable text without indicators and the |
|
329 indicator string |
|
330 </dd> |
|
331 </dl><dl> |
|
332 <dt>Return Type:</dt> |
|
333 <dd> |
|
334 tuple of two str |
|
335 </dd> |
|
336 </dl><a NAME="DebugClientBase.__formatQtVariable" ID="DebugClientBase.__formatQtVariable"></a> |
|
337 <h4>DebugClientBase.__formatQtVariable</h4> |
|
338 <b>__formatQtVariable</b>(<i>value, qttype</i>) |
|
339 <p> |
|
340 Private method to produce a formatted output of a simple Qt4/Qt5 type. |
|
341 </p><dl> |
|
342 <dt><i>value</i></dt> |
|
343 <dd> |
|
344 variable to be formatted |
|
345 </dd><dt><i>qttype</i></dt> |
|
346 <dd> |
|
347 type of the Qt variable to be formatted (string) |
|
348 </dd> |
|
349 </dl><dl> |
|
350 <dt>Returns:</dt> |
|
351 <dd> |
|
352 A tuple consisting of a list of formatted variables. Each |
|
353 variable entry is a tuple of three elements, the variable name, |
|
354 its type and value. |
|
355 </dd> |
|
356 </dl><a NAME="DebugClientBase.__formatVariablesList" ID="DebugClientBase.__formatVariablesList"></a> |
|
357 <h4>DebugClientBase.__formatVariablesList</h4> |
|
358 <b>__formatVariablesList</b>(<i>keylist, dict_, scope, filter=[], formatSequences=False</i>) |
|
359 <p> |
|
360 Private method to produce a formated variables list. |
|
361 </p><p> |
|
362 The dictionary passed in to it is scanned. Variables are |
|
363 only added to the list, if their type is not contained |
|
364 in the filter list and their name doesn't match any of the filter |
|
365 expressions. The formated variables list (a list of tuples of 3 |
|
366 values) is returned. |
|
367 </p><dl> |
|
368 <dt><i>keylist</i></dt> |
|
369 <dd> |
|
370 keys of the dictionary |
|
371 </dd><dt><i>dict_</i></dt> |
|
372 <dd> |
|
373 the dictionary to be scanned |
|
374 </dd><dt><i>scope</i></dt> |
|
375 <dd> |
|
376 1 to filter using the globals filter, 0 using the locals |
|
377 filter (int). |
|
378 Variables are only added to the list, if their name do not match |
|
379 any of the filter expressions. |
|
380 </dd><dt><i>filter</i></dt> |
|
381 <dd> |
|
382 the indices of variable types to be filtered. Variables |
|
383 are only added to the list, if their type is not contained in the |
|
384 filter list. |
|
385 </dd><dt><i>formatSequences</i></dt> |
|
386 <dd> |
|
387 flag indicating, that sequence or dictionary |
|
388 variables should be formatted. If it is 0 (or false), just the |
|
389 number of items contained in these variables is returned. (boolean) |
|
390 </dd> |
|
391 </dl><dl> |
|
392 <dt>Returns:</dt> |
|
393 <dd> |
|
394 A tuple consisting of a list of formatted variables. Each |
|
395 variable entry is a tuple of three elements, the variable name, |
|
396 its type and value. |
|
397 </dd> |
|
398 </dl><a NAME="DebugClientBase.__generateFilterObjects" ID="DebugClientBase.__generateFilterObjects"></a> |
|
399 <h4>DebugClientBase.__generateFilterObjects</h4> |
|
400 <b>__generateFilterObjects</b>(<i>scope, filterString</i>) |
|
401 <p> |
|
402 Private slot to convert a filter string to a list of filter objects. |
|
403 </p><dl> |
|
404 <dt><i>scope</i></dt> |
|
405 <dd> |
|
406 1 to generate filter for global variables, 0 for local |
|
407 variables (int) |
|
408 </dd><dt><i>filterString</i></dt> |
|
409 <dd> |
|
410 string of filter patterns separated by ';' |
|
411 </dd> |
|
412 </dl><a NAME="DebugClientBase.__getCompletionList" ID="DebugClientBase.__getCompletionList"></a> |
|
413 <h4>DebugClientBase.__getCompletionList</h4> |
|
414 <b>__getCompletionList</b>(<i>text, completer, completions</i>) |
|
415 <p> |
|
416 Private method to create a completions list. |
|
417 </p><dl> |
|
418 <dt><i>text</i></dt> |
|
419 <dd> |
|
420 text to complete (string) |
|
421 </dd><dt><i>completer</i></dt> |
|
422 <dd> |
|
423 completer methode |
|
424 </dd><dt><i>completions</i></dt> |
|
425 <dd> |
|
426 set where to add new completions strings (set) |
|
427 </dd> |
|
428 </dl><a NAME="DebugClientBase.__getSysPath" ID="DebugClientBase.__getSysPath"></a> |
|
429 <h4>DebugClientBase.__getSysPath</h4> |
|
430 <b>__getSysPath</b>(<i>firstEntry</i>) |
|
431 <p> |
|
432 Private slot to calculate a path list including the PYTHONPATH |
|
433 environment variable. |
|
434 </p><dl> |
|
435 <dt><i>firstEntry</i></dt> |
|
436 <dd> |
|
437 entry to be put first in sys.path (string) |
|
438 </dd> |
|
439 </dl><dl> |
|
440 <dt>Returns:</dt> |
|
441 <dd> |
|
442 path list for use as sys.path (list of strings) |
|
443 </dd> |
|
444 </dl><a NAME="DebugClientBase.__interact" ID="DebugClientBase.__interact"></a> |
|
445 <h4>DebugClientBase.__interact</h4> |
|
446 <b>__interact</b>(<i></i>) |
|
447 <p> |
|
448 Private method to interact with the debugger. |
|
449 </p><a NAME="DebugClientBase.__interceptSignals" ID="DebugClientBase.__interceptSignals"></a> |
|
450 <h4>DebugClientBase.__interceptSignals</h4> |
|
451 <b>__interceptSignals</b>(<i></i>) |
|
452 <p> |
|
453 Private method to intercept common signals. |
|
454 </p><a NAME="DebugClientBase.__resolveHost" ID="DebugClientBase.__resolveHost"></a> |
|
455 <h4>DebugClientBase.__resolveHost</h4> |
|
456 <b>__resolveHost</b>(<i>host</i>) |
|
457 <p> |
|
458 Private method to resolve a hostname to an IP address. |
|
459 </p><dl> |
|
460 <dt><i>host</i></dt> |
|
461 <dd> |
|
462 hostname of the debug server (string) |
|
463 </dd> |
|
464 </dl><dl> |
|
465 <dt>Returns:</dt> |
|
466 <dd> |
|
467 IP address (string) |
|
468 </dd> |
|
469 </dl><a NAME="DebugClientBase.__setCoding" ID="DebugClientBase.__setCoding"></a> |
|
470 <h4>DebugClientBase.__setCoding</h4> |
|
471 <b>__setCoding</b>(<i>filename</i>) |
|
472 <p> |
|
473 Private method to set the coding used by a python file. |
|
474 </p><dl> |
|
475 <dt><i>filename</i></dt> |
|
476 <dd> |
|
477 name of the file to inspect (string) |
|
478 </dd> |
|
479 </dl><a NAME="DebugClientBase.__signalHandler" ID="DebugClientBase.__signalHandler"></a> |
|
480 <h4>DebugClientBase.__signalHandler</h4> |
|
481 <b>__signalHandler</b>(<i>signalNumber, stackFrame</i>) |
|
482 <p> |
|
483 Private method to handle signals. |
|
484 </p><dl> |
|
485 <dt><i>signalNumber</i> (int)</dt> |
|
486 <dd> |
|
487 number of the signal to be handled |
|
488 </dd><dt><i>stackFrame</i> (frame object)</dt> |
|
489 <dd> |
|
490 current stack frame |
|
491 </dd> |
|
492 </dl><a NAME="DebugClientBase.__unhandled_exception" ID="DebugClientBase.__unhandled_exception"></a> |
|
493 <h4>DebugClientBase.__unhandled_exception</h4> |
|
494 <b>__unhandled_exception</b>(<i>exctype, excval, exctb</i>) |
|
495 <p> |
|
496 Private method called to report an uncaught exception. |
|
497 </p><dl> |
|
498 <dt><i>exctype</i></dt> |
|
499 <dd> |
|
500 the type of the exception |
|
501 </dd><dt><i>excval</i></dt> |
|
502 <dd> |
|
503 data about the exception |
|
504 </dd><dt><i>exctb</i></dt> |
|
505 <dd> |
|
506 traceback for the exception |
|
507 </dd> |
|
508 </dl><a NAME="DebugClientBase.absPath" ID="DebugClientBase.absPath"></a> |
|
509 <h4>DebugClientBase.absPath</h4> |
|
510 <b>absPath</b>(<i>fn</i>) |
|
511 <p> |
|
512 Public method to convert a filename to an absolute name. |
|
513 </p><p> |
|
514 sys.path is used as a set of possible prefixes. The name stays |
|
515 relative if a file could not be found. |
|
516 </p><dl> |
|
517 <dt><i>fn</i></dt> |
|
518 <dd> |
|
519 filename (string) |
|
520 </dd> |
|
521 </dl><dl> |
|
522 <dt>Returns:</dt> |
|
523 <dd> |
|
524 the converted filename (string) |
|
525 </dd> |
|
526 </dl><a NAME="DebugClientBase.close" ID="DebugClientBase.close"></a> |
|
527 <h4>DebugClientBase.close</h4> |
|
528 <b>close</b>(<i>fd</i>) |
|
529 <p> |
|
530 Public method implementing a close method as a replacement for |
|
531 os.close(). |
|
532 </p><p> |
|
533 It prevents the debugger connections from being closed. |
|
534 </p><dl> |
|
535 <dt><i>fd</i></dt> |
|
536 <dd> |
|
537 file descriptor to be closed (integer) |
|
538 </dd> |
|
539 </dl><a NAME="DebugClientBase.connectDebugger" ID="DebugClientBase.connectDebugger"></a> |
|
540 <h4>DebugClientBase.connectDebugger</h4> |
|
541 <b>connectDebugger</b>(<i>port, remoteAddress=None, redirect=True</i>) |
|
542 <p> |
|
543 Public method to establish a session with the debugger. |
|
544 </p><p> |
|
545 It opens a network connection to the debugger, connects it to stdin, |
|
546 stdout and stderr and saves these file objects in case the application |
|
547 being debugged redirects them itself. |
|
548 </p><dl> |
|
549 <dt><i>port</i></dt> |
|
550 <dd> |
|
551 the port number to connect to (int) |
|
552 </dd><dt><i>remoteAddress</i></dt> |
|
553 <dd> |
|
554 the network address of the debug server host |
|
555 (string) |
|
556 </dd><dt><i>redirect</i></dt> |
|
557 <dd> |
|
558 flag indicating redirection of stdin, stdout and |
|
559 stderr (boolean) |
|
560 </dd> |
|
561 </dl><a NAME="DebugClientBase.eventLoop" ID="DebugClientBase.eventLoop"></a> |
|
562 <h4>DebugClientBase.eventLoop</h4> |
|
563 <b>eventLoop</b>(<i>disablePolling=False</i>) |
|
564 <p> |
|
565 Public method implementing our event loop. |
|
566 </p><dl> |
|
567 <dt><i>disablePolling</i></dt> |
|
568 <dd> |
|
569 flag indicating to enter an event loop with |
|
570 polling disabled (boolean) |
|
571 </dd> |
|
572 </dl><a NAME="DebugClientBase.eventPoll" ID="DebugClientBase.eventPoll"></a> |
|
573 <h4>DebugClientBase.eventPoll</h4> |
|
574 <b>eventPoll</b>(<i></i>) |
|
575 <p> |
|
576 Public method to poll for events like 'set break point'. |
|
577 </p><a NAME="DebugClientBase.fork" ID="DebugClientBase.fork"></a> |
|
578 <h4>DebugClientBase.fork</h4> |
|
579 <b>fork</b>(<i></i>) |
|
580 <p> |
|
581 Public method implementing a fork routine deciding which branch |
|
582 to follow. |
|
583 </p><dl> |
|
584 <dt>Returns:</dt> |
|
585 <dd> |
|
586 process ID (integer) |
|
587 </dd> |
|
588 </dl><a NAME="DebugClientBase.getCoding" ID="DebugClientBase.getCoding"></a> |
|
589 <h4>DebugClientBase.getCoding</h4> |
|
590 <b>getCoding</b>(<i></i>) |
|
591 <p> |
|
592 Public method to return the current coding. |
|
593 </p><dl> |
|
594 <dt>Returns:</dt> |
|
595 <dd> |
|
596 codec name (string) |
|
597 </dd> |
|
598 </dl><a NAME="DebugClientBase.getRunning" ID="DebugClientBase.getRunning"></a> |
|
599 <h4>DebugClientBase.getRunning</h4> |
|
600 <b>getRunning</b>(<i></i>) |
|
601 <p> |
|
602 Public method to return the main script we are currently running. |
|
603 </p><dl> |
|
604 <dt>Returns:</dt> |
|
605 <dd> |
|
606 flag indicating a running debug session (boolean) |
|
607 </dd> |
|
608 </dl><a NAME="DebugClientBase.handleJsonCommand" ID="DebugClientBase.handleJsonCommand"></a> |
|
609 <h4>DebugClientBase.handleJsonCommand</h4> |
|
610 <b>handleJsonCommand</b>(<i>jsonStr</i>) |
|
611 <p> |
|
612 Public method to handle a command serialized as a JSON string. |
|
613 </p><dl> |
|
614 <dt><i>jsonStr</i> (str)</dt> |
|
615 <dd> |
|
616 string containing the command received from the IDE |
|
617 </dd> |
|
618 </dl><a NAME="DebugClientBase.handleLine" ID="DebugClientBase.handleLine"></a> |
|
619 <h4>DebugClientBase.handleLine</h4> |
|
620 <b>handleLine</b>(<i>line</i>) |
|
621 <p> |
|
622 Public method to handle the receipt of a complete line. |
|
623 </p><p> |
|
624 It first looks for a valid protocol token at the start of the line. |
|
625 Thereafter it trys to execute the lines accumulated so far. |
|
626 </p><dl> |
|
627 <dt><i>line</i></dt> |
|
628 <dd> |
|
629 the received line |
|
630 </dd> |
|
631 </dl><a NAME="DebugClientBase.input" ID="DebugClientBase.input"></a> |
|
632 <h4>DebugClientBase.input</h4> |
|
633 <b>input</b>(<i>prompt</i>) |
|
634 <p> |
|
635 Public method to implement input() (Python 2) using the event loop. |
|
636 </p><dl> |
|
637 <dt><i>prompt</i></dt> |
|
638 <dd> |
|
639 the prompt to be shown (string) |
|
640 </dd> |
|
641 </dl><dl> |
|
642 <dt>Returns:</dt> |
|
643 <dd> |
|
644 the entered string evaluated as a Python expresion |
|
645 </dd> |
|
646 </dl><a NAME="DebugClientBase.main" ID="DebugClientBase.main"></a> |
|
647 <h4>DebugClientBase.main</h4> |
|
648 <b>main</b>(<i></i>) |
|
649 <p> |
|
650 Public method implementing the main method. |
|
651 </p><a NAME="DebugClientBase.progTerminated" ID="DebugClientBase.progTerminated"></a> |
|
652 <h4>DebugClientBase.progTerminated</h4> |
|
653 <b>progTerminated</b>(<i>status, message=""</i>) |
|
654 <p> |
|
655 Public method to tell the debugger that the program has terminated. |
|
656 </p><dl> |
|
657 <dt><i>status</i> (int)</dt> |
|
658 <dd> |
|
659 return status |
|
660 </dd><dt><i>message</i> (str)</dt> |
|
661 <dd> |
|
662 status message |
|
663 </dd> |
|
664 </dl><a NAME="DebugClientBase.raw_input" ID="DebugClientBase.raw_input"></a> |
|
665 <h4>DebugClientBase.raw_input</h4> |
|
666 <b>raw_input</b>(<i>prompt, echo</i>) |
|
667 <p> |
|
668 Public method to implement raw_input() / input() using the event loop. |
|
669 </p><dl> |
|
670 <dt><i>prompt</i></dt> |
|
671 <dd> |
|
672 the prompt to be shown (string) |
|
673 </dd><dt><i>echo</i></dt> |
|
674 <dd> |
|
675 Flag indicating echoing of the input (boolean) |
|
676 </dd> |
|
677 </dl><dl> |
|
678 <dt>Returns:</dt> |
|
679 <dd> |
|
680 the entered string |
|
681 </dd> |
|
682 </dl><a NAME="DebugClientBase.readReady" ID="DebugClientBase.readReady"></a> |
|
683 <h4>DebugClientBase.readReady</h4> |
|
684 <b>readReady</b>(<i>stream</i>) |
|
685 <p> |
|
686 Public method called when there is data ready to be read. |
|
687 </p><dl> |
|
688 <dt><i>stream</i></dt> |
|
689 <dd> |
|
690 file like object that has data to be written |
|
691 </dd> |
|
692 </dl><a NAME="DebugClientBase.run_call" ID="DebugClientBase.run_call"></a> |
|
693 <h4>DebugClientBase.run_call</h4> |
|
694 <b>run_call</b>(<i>scriptname, func, *args</i>) |
|
695 <p> |
|
696 Public method used to start the remote debugger and call a function. |
|
697 </p><dl> |
|
698 <dt><i>scriptname</i></dt> |
|
699 <dd> |
|
700 name of the script to be debugged (string) |
|
701 </dd><dt><i>func</i></dt> |
|
702 <dd> |
|
703 function to be called |
|
704 </dd><dt><i>*args</i></dt> |
|
705 <dd> |
|
706 arguments being passed to func |
|
707 </dd> |
|
708 </dl><dl> |
|
709 <dt>Returns:</dt> |
|
710 <dd> |
|
711 result of the function call |
|
712 </dd> |
|
713 </dl><a NAME="DebugClientBase.sendCallTrace" ID="DebugClientBase.sendCallTrace"></a> |
|
714 <h4>DebugClientBase.sendCallTrace</h4> |
|
715 <b>sendCallTrace</b>(<i>event, fromInfo, toInfo</i>) |
|
716 <p> |
|
717 Public method to send a call trace entry. |
|
718 </p><dl> |
|
719 <dt><i>event</i> (str)</dt> |
|
720 <dd> |
|
721 trace event (call or return) |
|
722 </dd><dt><i>fromInfo</i> (dict with 'filename', 'linenumber' and 'codename')</dt> |
|
723 <dd> |
|
724 dictionary containing the origin info |
|
725 as keys |
|
726 </dd><dt><i>toInfo</i> (dict with 'filename', 'linenumber' and 'codename')</dt> |
|
727 <dd> |
|
728 dictionary containing the target info |
|
729 as keys |
|
730 </dd> |
|
731 </dl><a NAME="DebugClientBase.sendClearTemporaryBreakpoint" ID="DebugClientBase.sendClearTemporaryBreakpoint"></a> |
|
732 <h4>DebugClientBase.sendClearTemporaryBreakpoint</h4> |
|
733 <b>sendClearTemporaryBreakpoint</b>(<i>filename, lineno</i>) |
|
734 <p> |
|
735 Public method to signal the deletion of a temporary breakpoint. |
|
736 </p><dl> |
|
737 <dt><i>filename</i> (str)</dt> |
|
738 <dd> |
|
739 name of the file the bp belongs to |
|
740 </dd><dt><i>lineno</i> (int)</dt> |
|
741 <dd> |
|
742 linenumber of the bp |
|
743 </dd> |
|
744 </dl><a NAME="DebugClientBase.sendClearTemporaryWatch" ID="DebugClientBase.sendClearTemporaryWatch"></a> |
|
745 <h4>DebugClientBase.sendClearTemporaryWatch</h4> |
|
746 <b>sendClearTemporaryWatch</b>(<i>condition</i>) |
|
747 <p> |
|
748 Public method to signal the deletion of a temporary watch expression. |
|
749 </p><dl> |
|
750 <dt><i>condition</i> (str)</dt> |
|
751 <dd> |
|
752 condition of the watch expression to be cleared |
|
753 </dd> |
|
754 </dl><a NAME="DebugClientBase.sendException" ID="DebugClientBase.sendException"></a> |
|
755 <h4>DebugClientBase.sendException</h4> |
|
756 <b>sendException</b>(<i>exceptionType, exceptionMessage, stack</i>) |
|
757 <p> |
|
758 Public method to send information for an exception. |
|
759 </p><dl> |
|
760 <dt><i>exceptionType</i> (str)</dt> |
|
761 <dd> |
|
762 type of exception raised |
|
763 </dd><dt><i>exceptionMessage</i> (str)</dt> |
|
764 <dd> |
|
765 message of the exception |
|
766 </dd><dt><i>stack</i> (list)</dt> |
|
767 <dd> |
|
768 stack trace information |
|
769 </dd> |
|
770 </dl><a NAME="DebugClientBase.sendJsonCommand" ID="DebugClientBase.sendJsonCommand"></a> |
|
771 <h4>DebugClientBase.sendJsonCommand</h4> |
|
772 <b>sendJsonCommand</b>(<i>method, params</i>) |
|
773 <p> |
|
774 Public method to send a single command or response to the IDE. |
|
775 </p><dl> |
|
776 <dt><i>method</i> (str)</dt> |
|
777 <dd> |
|
778 command or response command name to be sent |
|
779 </dd><dt><i>params</i> (dict)</dt> |
|
780 <dd> |
|
781 dictionary of named parameters for the command or |
|
782 response |
|
783 </dd> |
|
784 </dl><a NAME="DebugClientBase.sendPassiveStartup" ID="DebugClientBase.sendPassiveStartup"></a> |
|
785 <h4>DebugClientBase.sendPassiveStartup</h4> |
|
786 <b>sendPassiveStartup</b>(<i>filename, exceptions</i>) |
|
787 <p> |
|
788 Public method to send the passive start information. |
|
789 </p><dl> |
|
790 <dt><i>filename</i> (str)</dt> |
|
791 <dd> |
|
792 name of the script |
|
793 </dd><dt><i>exceptions</i> (bool)</dt> |
|
794 <dd> |
|
795 flag to enable exception reporting of the IDE |
|
796 </dd> |
|
797 </dl><a NAME="DebugClientBase.sendResponseLine" ID="DebugClientBase.sendResponseLine"></a> |
|
798 <h4>DebugClientBase.sendResponseLine</h4> |
|
799 <b>sendResponseLine</b>(<i>stack</i>) |
|
800 <p> |
|
801 Public method to send the current call stack. |
|
802 </p><dl> |
|
803 <dt><i>stack</i> (list)</dt> |
|
804 <dd> |
|
805 call stack |
|
806 </dd> |
|
807 </dl><a NAME="DebugClientBase.sendSyntaxError" ID="DebugClientBase.sendSyntaxError"></a> |
|
808 <h4>DebugClientBase.sendSyntaxError</h4> |
|
809 <b>sendSyntaxError</b>(<i>message, filename, lineno, charno</i>) |
|
810 <p> |
|
811 Public method to send information for a syntax error. |
|
812 </p><dl> |
|
813 <dt><i>message</i> (str)</dt> |
|
814 <dd> |
|
815 syntax error message |
|
816 </dd><dt><i>filename</i> (str)</dt> |
|
817 <dd> |
|
818 name of the faulty file |
|
819 </dd><dt><i>lineno</i> (int)</dt> |
|
820 <dd> |
|
821 line number info |
|
822 </dd><dt><i>charno</i> (int)</dt> |
|
823 <dd> |
|
824 character number info |
|
825 </dd> |
|
826 </dl><a NAME="DebugClientBase.sessionClose" ID="DebugClientBase.sessionClose"></a> |
|
827 <h4>DebugClientBase.sessionClose</h4> |
|
828 <b>sessionClose</b>(<i>exit=True</i>) |
|
829 <p> |
|
830 Public method to close the session with the debugger and optionally |
|
831 terminate. |
|
832 </p><dl> |
|
833 <dt><i>exit</i></dt> |
|
834 <dd> |
|
835 flag indicating to terminate (boolean) |
|
836 </dd> |
|
837 </dl><a NAME="DebugClientBase.startDebugger" ID="DebugClientBase.startDebugger"></a> |
|
838 <h4>DebugClientBase.startDebugger</h4> |
|
839 <b>startDebugger</b>(<i>filename=None, host=None, port=None, enableTrace=True, exceptions=True, tracePython=False, redirect=True</i>) |
|
840 <p> |
|
841 Public method used to start the remote debugger. |
|
842 </p><dl> |
|
843 <dt><i>filename</i></dt> |
|
844 <dd> |
|
845 the program to be debugged (string) |
|
846 </dd><dt><i>host</i></dt> |
|
847 <dd> |
|
848 hostname of the debug server (string) |
|
849 </dd><dt><i>port</i></dt> |
|
850 <dd> |
|
851 portnumber of the debug server (int) |
|
852 </dd><dt><i>enableTrace</i></dt> |
|
853 <dd> |
|
854 flag to enable the tracing function (boolean) |
|
855 </dd><dt><i>exceptions</i></dt> |
|
856 <dd> |
|
857 flag to enable exception reporting of the IDE |
|
858 (boolean) |
|
859 </dd><dt><i>tracePython</i></dt> |
|
860 <dd> |
|
861 flag to enable tracing into the Python library |
|
862 (boolean) |
|
863 </dd><dt><i>redirect</i></dt> |
|
864 <dd> |
|
865 flag indicating redirection of stdin, stdout and |
|
866 stderr (boolean) |
|
867 </dd> |
|
868 </dl><a NAME="DebugClientBase.startProgInDebugger" ID="DebugClientBase.startProgInDebugger"></a> |
|
869 <h4>DebugClientBase.startProgInDebugger</h4> |
|
870 <b>startProgInDebugger</b>(<i>progargs, wd='', host=None, port=None, exceptions=True, tracePython=False, redirect=True</i>) |
|
871 <p> |
|
872 Public method used to start the remote debugger. |
|
873 </p><dl> |
|
874 <dt><i>progargs</i></dt> |
|
875 <dd> |
|
876 commandline for the program to be debugged |
|
877 (list of strings) |
|
878 </dd><dt><i>wd</i></dt> |
|
879 <dd> |
|
880 working directory for the program execution (string) |
|
881 </dd><dt><i>host</i></dt> |
|
882 <dd> |
|
883 hostname of the debug server (string) |
|
884 </dd><dt><i>port</i></dt> |
|
885 <dd> |
|
886 portnumber of the debug server (int) |
|
887 </dd><dt><i>exceptions</i></dt> |
|
888 <dd> |
|
889 flag to enable exception reporting of the IDE |
|
890 (boolean) |
|
891 </dd><dt><i>tracePython</i></dt> |
|
892 <dd> |
|
893 flag to enable tracing into the Python library |
|
894 (boolean) |
|
895 </dd><dt><i>redirect</i></dt> |
|
896 <dd> |
|
897 flag indicating redirection of stdin, stdout and |
|
898 stderr (boolean) |
|
899 </dd> |
|
900 </dl><a NAME="DebugClientBase.writeReady" ID="DebugClientBase.writeReady"></a> |
|
901 <h4>DebugClientBase.writeReady</h4> |
|
902 <b>writeReady</b>(<i>stream</i>) |
|
903 <p> |
|
904 Public method called when we are ready to write data. |
|
905 </p><dl> |
|
906 <dt><i>stream</i></dt> |
|
907 <dd> |
|
908 file like object that has data to be written |
|
909 </dd> |
|
910 </dl> |
|
911 <div align="right"><a href="#top">Up</a></div> |
|
912 <hr /><hr /> |
|
913 <a NAME="DebugClientClose" ID="DebugClientClose"></a> |
|
914 <h2>DebugClientClose</h2> |
|
915 <b>DebugClientClose</b>(<i>fd</i>) |
|
916 <p> |
|
917 Replacement for the standard os.close(fd). |
|
918 </p><dl> |
|
919 <dt><i>fd</i></dt> |
|
920 <dd> |
|
921 open file descriptor to be closed (integer) |
|
922 </dd> |
|
923 </dl> |
|
924 <div align="right"><a href="#top">Up</a></div> |
|
925 <hr /><hr /> |
|
926 <a NAME="DebugClientFork" ID="DebugClientFork"></a> |
|
927 <h2>DebugClientFork</h2> |
|
928 <b>DebugClientFork</b>(<i></i>) |
|
929 <p> |
|
930 Replacement for the standard os.fork(). |
|
931 </p><dl> |
|
932 <dt>Returns:</dt> |
|
933 <dd> |
|
934 result of the fork() call |
|
935 </dd> |
|
936 </dl> |
|
937 <div align="right"><a href="#top">Up</a></div> |
|
938 <hr /><hr /> |
|
939 <a NAME="DebugClientInput" ID="DebugClientInput"></a> |
|
940 <h2>DebugClientInput</h2> |
|
941 <b>DebugClientInput</b>(<i>prompt="", echo=True</i>) |
|
942 <p> |
|
943 Replacement for the standard input builtin. |
|
944 </p><p> |
|
945 This function works with the split debugger. |
|
946 </p><dl> |
|
947 <dt><i>prompt</i></dt> |
|
948 <dd> |
|
949 prompt to be shown (string) |
|
950 </dd><dt><i>echo</i></dt> |
|
951 <dd> |
|
952 flag indicating to echo the output (boolean) |
|
953 </dd> |
|
954 </dl><dl> |
|
955 <dt>Returns:</dt> |
|
956 <dd> |
|
957 result of the input() call |
|
958 </dd> |
|
959 </dl> |
|
960 <div align="right"><a href="#top">Up</a></div> |
|
961 <hr /><hr /> |
|
962 <a NAME="DebugClientRawInput" ID="DebugClientRawInput"></a> |
|
963 <h2>DebugClientRawInput</h2> |
|
964 <b>DebugClientRawInput</b>(<i>prompt="", echo=True</i>) |
|
965 <p> |
|
966 Replacement for the standard raw_input builtin. |
|
967 </p><p> |
|
968 This function works with the split debugger. |
|
969 </p><dl> |
|
970 <dt><i>prompt</i></dt> |
|
971 <dd> |
|
972 prompt to be shown. (string) |
|
973 </dd><dt><i>echo</i></dt> |
|
974 <dd> |
|
975 flag indicating echoing of the input (boolean) |
|
976 </dd> |
|
977 </dl><dl> |
|
978 <dt>Returns:</dt> |
|
979 <dd> |
|
980 result of the raw_input() call |
|
981 </dd> |
|
982 </dl> |
|
983 <div align="right"><a href="#top">Up</a></div> |
|
984 <hr /><hr /> |
|
985 <a NAME="DebugClientSetRecursionLimit" ID="DebugClientSetRecursionLimit"></a> |
|
986 <h2>DebugClientSetRecursionLimit</h2> |
|
987 <b>DebugClientSetRecursionLimit</b>(<i>limit</i>) |
|
988 <p> |
|
989 Replacement for the standard sys.setrecursionlimit(limit). |
|
990 </p><dl> |
|
991 <dt><i>limit</i></dt> |
|
992 <dd> |
|
993 recursion limit (integer) |
|
994 </dd> |
|
995 </dl> |
|
996 <div align="right"><a href="#top">Up</a></div> |
|
997 <hr /> |
|
998 </body></html> |