eric6/Documentation/Source/eric6.DebugClients.Python.DebugClientBase.html

changeset 6942
2602857055c5
parent 6908
a56b500d7d2d
child 7015
b1a3094b33e1
equal deleted inserted replaced
6941:f99d60d6b59b 6942:2602857055c5
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.__assembleTestCasesList">__assembleTestCasesList</a></td>
93 <td>Private method to assemble a list of test cases included in a test suite.</td>
94 </tr><tr>
95 <td><a href="#DebugClientBase.__clientCapabilities">__clientCapabilities</a></td>
96 <td>Private method to determine the clients capabilities.</td>
97 </tr><tr>
98 <td><a href="#DebugClientBase.__compileFileSource">__compileFileSource</a></td>
99 <td>Private method to compile source code read from a file.</td>
100 </tr><tr>
101 <td><a href="#DebugClientBase.__completionList">__completionList</a></td>
102 <td>Private slot to handle the request for a commandline completion list.</td>
103 </tr><tr>
104 <td><a href="#DebugClientBase.__dumpVariable">__dumpVariable</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.__dumpVariables">__dumpVariables</a></td>
108 <td>Private method to return the variables of a frame to the debug server.</td>
109 </tr><tr>
110 <td><a href="#DebugClientBase.__extractIndicators">__extractIndicators</a></td>
111 <td>Private method to extract the indicator string from a variable text.</td>
112 </tr><tr>
113 <td><a href="#DebugClientBase.__formatQtVariable">__formatQtVariable</a></td>
114 <td>Private method to produce a formatted output of a simple Qt4/Qt5 type.</td>
115 </tr><tr>
116 <td><a href="#DebugClientBase.__formatVariablesList">__formatVariablesList</a></td>
117 <td>Private method to produce a formated variables list.</td>
118 </tr><tr>
119 <td><a href="#DebugClientBase.__generateFilterObjects">__generateFilterObjects</a></td>
120 <td>Private slot to convert a filter string to a list of filter objects.</td>
121 </tr><tr>
122 <td><a href="#DebugClientBase.__getCompletionList">__getCompletionList</a></td>
123 <td>Private method to create a completions list.</td>
124 </tr><tr>
125 <td><a href="#DebugClientBase.__getSysPath">__getSysPath</a></td>
126 <td>Private slot to calculate a path list including the PYTHONPATH environment variable.</td>
127 </tr><tr>
128 <td><a href="#DebugClientBase.__interact">__interact</a></td>
129 <td>Private method to interact with the debugger.</td>
130 </tr><tr>
131 <td><a href="#DebugClientBase.__interceptSignals">__interceptSignals</a></td>
132 <td>Private method to intercept common signals.</td>
133 </tr><tr>
134 <td><a href="#DebugClientBase.__resolveHost">__resolveHost</a></td>
135 <td>Private method to resolve a hostname to an IP address.</td>
136 </tr><tr>
137 <td><a href="#DebugClientBase.__setCoding">__setCoding</a></td>
138 <td>Private method to set the coding used by a python file.</td>
139 </tr><tr>
140 <td><a href="#DebugClientBase.__signalHandler">__signalHandler</a></td>
141 <td>Private method to handle signals.</td>
142 </tr><tr>
143 <td><a href="#DebugClientBase.__unhandled_exception">__unhandled_exception</a></td>
144 <td>Private method called to report an uncaught exception.</td>
145 </tr><tr>
146 <td><a href="#DebugClientBase.absPath">absPath</a></td>
147 <td>Public method to convert a filename to an absolute name.</td>
148 </tr><tr>
149 <td><a href="#DebugClientBase.close">close</a></td>
150 <td>Public method implementing a close method as a replacement for os.close().</td>
151 </tr><tr>
152 <td><a href="#DebugClientBase.connectDebugger">connectDebugger</a></td>
153 <td>Public method to establish a session with the debugger.</td>
154 </tr><tr>
155 <td><a href="#DebugClientBase.eventLoop">eventLoop</a></td>
156 <td>Public method implementing our event loop.</td>
157 </tr><tr>
158 <td><a href="#DebugClientBase.eventPoll">eventPoll</a></td>
159 <td>Public method to poll for events like 'set break point'.</td>
160 </tr><tr>
161 <td><a href="#DebugClientBase.fork">fork</a></td>
162 <td>Public method implementing a fork routine deciding which branch to follow.</td>
163 </tr><tr>
164 <td><a href="#DebugClientBase.getCoding">getCoding</a></td>
165 <td>Public method to return the current coding.</td>
166 </tr><tr>
167 <td><a href="#DebugClientBase.getRunning">getRunning</a></td>
168 <td>Public method to return the main script we are currently running.</td>
169 </tr><tr>
170 <td><a href="#DebugClientBase.handleJsonCommand">handleJsonCommand</a></td>
171 <td>Public method to handle a command serialized as a JSON string.</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.__assembleTestCasesList" ID="DebugClientBase.__assembleTestCasesList"></a>
238 <h4>DebugClientBase.__assembleTestCasesList</h4>
239 <b>__assembleTestCasesList</b>(<i>suite, start</i>)
240 <p>
241 Private method to assemble a list of test cases included in a test
242 suite.
243 </p><dl>
244 <dt><i>suite</i> (unittest.TestSuite)</dt>
245 <dd>
246 test suite to be inspected
247 </dd><dt><i>start</i> (str)</dt>
248 <dd>
249 name of directory discovery was started at
250 </dd>
251 </dl><dl>
252 <dt>Returns:</dt>
253 <dd>
254 list of tuples containing the test case ID, a short description
255 and the path of the test file name
256 </dd>
257 </dl><dl>
258 <dt>Return Type:</dt>
259 <dd>
260 list of tuples of (str, str, str)
261 </dd>
262 </dl><a NAME="DebugClientBase.__clientCapabilities" ID="DebugClientBase.__clientCapabilities"></a>
263 <h4>DebugClientBase.__clientCapabilities</h4>
264 <b>__clientCapabilities</b>(<i></i>)
265 <p>
266 Private method to determine the clients capabilities.
267 </p><dl>
268 <dt>Returns:</dt>
269 <dd>
270 client capabilities (integer)
271 </dd>
272 </dl><a NAME="DebugClientBase.__compileFileSource" ID="DebugClientBase.__compileFileSource"></a>
273 <h4>DebugClientBase.__compileFileSource</h4>
274 <b>__compileFileSource</b>(<i>filename, mode='exec'</i>)
275 <p>
276 Private method to compile source code read from a file.
277 </p><dl>
278 <dt><i>filename</i></dt>
279 <dd>
280 name of the source file (string)
281 </dd><dt><i>mode</i></dt>
282 <dd>
283 kind of code to be generated (string, exec or eval)
284 </dd>
285 </dl><dl>
286 <dt>Returns:</dt>
287 <dd>
288 compiled code object (None in case of errors)
289 </dd>
290 </dl><a NAME="DebugClientBase.__completionList" ID="DebugClientBase.__completionList"></a>
291 <h4>DebugClientBase.__completionList</h4>
292 <b>__completionList</b>(<i>text</i>)
293 <p>
294 Private slot to handle the request for a commandline completion list.
295 </p><dl>
296 <dt><i>text</i></dt>
297 <dd>
298 the text to be completed (string)
299 </dd>
300 </dl><a NAME="DebugClientBase.__dumpVariable" ID="DebugClientBase.__dumpVariable"></a>
301 <h4>DebugClientBase.__dumpVariable</h4>
302 <b>__dumpVariable</b>(<i>var, frmnr, scope, filterList, maxSize</i>)
303 <p>
304 Private method to return the variables of a frame to the debug server.
305 </p><dl>
306 <dt><i>var</i> (list of strings)</dt>
307 <dd>
308 list encoded name of the requested variable
309 </dd><dt><i>frmnr</i> (int)</dt>
310 <dd>
311 distance of frame reported on. 0 is the current frame
312 </dd><dt><i>scope</i></dt>
313 <dd>
314 1 to report global variables, 0 for local variables (int)
315 </dd><dt><i>filterList</i> (list of int)</dt>
316 <dd>
317 the indices of variable types to be filtered
318 </dd><dt><i>maxSize</i> (int)</dt>
319 <dd>
320 maximum size the formatted value of a variable will
321 be shown. If it is bigger than that, a 'too big' indication will
322 be given.
323 </dd>
324 </dl><a NAME="DebugClientBase.__dumpVariables" ID="DebugClientBase.__dumpVariables"></a>
325 <h4>DebugClientBase.__dumpVariables</h4>
326 <b>__dumpVariables</b>(<i>frmnr, scope, filterList, maxSize</i>)
327 <p>
328 Private method to return the variables of a frame to the debug server.
329 </p><dl>
330 <dt><i>frmnr</i> (int)</dt>
331 <dd>
332 distance of frame reported on. 0 is the current frame
333 </dd><dt><i>scope</i> (int)</dt>
334 <dd>
335 1 to report global variables, 0 for local variables
336 </dd><dt><i>filterList</i> (list of int)</dt>
337 <dd>
338 the indices of variable types to be filtered
339 </dd><dt><i>maxSize</i> (int)</dt>
340 <dd>
341 maximum size the formatted value of a variable will
342 be shown. If it is bigger than that, a 'too big' indication will
343 be given.
344 </dd>
345 </dl><a NAME="DebugClientBase.__extractIndicators" ID="DebugClientBase.__extractIndicators"></a>
346 <h4>DebugClientBase.__extractIndicators</h4>
347 <b>__extractIndicators</b>(<i>var</i>)
348 <p>
349 Private method to extract the indicator string from a variable text.
350 </p><dl>
351 <dt><i>var</i> (str)</dt>
352 <dd>
353 variable text
354 </dd>
355 </dl><dl>
356 <dt>Returns:</dt>
357 <dd>
358 tuple containing the variable text without indicators and the
359 indicator string
360 </dd>
361 </dl><dl>
362 <dt>Return Type:</dt>
363 <dd>
364 tuple of two str
365 </dd>
366 </dl><a NAME="DebugClientBase.__formatQtVariable" ID="DebugClientBase.__formatQtVariable"></a>
367 <h4>DebugClientBase.__formatQtVariable</h4>
368 <b>__formatQtVariable</b>(<i>value, qttype</i>)
369 <p>
370 Private method to produce a formatted output of a simple Qt4/Qt5 type.
371 </p><dl>
372 <dt><i>value</i></dt>
373 <dd>
374 variable to be formatted
375 </dd><dt><i>qttype</i></dt>
376 <dd>
377 type of the Qt variable to be formatted (string)
378 </dd>
379 </dl><dl>
380 <dt>Returns:</dt>
381 <dd>
382 A tuple consisting of a list of formatted variables. Each
383 variable entry is a tuple of three elements, the variable name,
384 its type and value.
385 </dd>
386 </dl><a NAME="DebugClientBase.__formatVariablesList" ID="DebugClientBase.__formatVariablesList"></a>
387 <h4>DebugClientBase.__formatVariablesList</h4>
388 <b>__formatVariablesList</b>(<i>keylist, dict_, scope, filterList=None, formatSequences=False, maxSize=0</i>)
389 <p>
390 Private method to produce a formated variables list.
391 </p><p>
392 The dictionary passed in to it is scanned. Variables are
393 only added to the list, if their type is not contained
394 in the filter list and their name doesn't match any of the filter
395 expressions. The formated variables list (a list of tuples of 3
396 values) is returned.
397 </p><dl>
398 <dt><i>keylist</i> (list of str)</dt>
399 <dd>
400 keys of the dictionary to be formatted
401 </dd><dt><i>dict_</i> (dict)</dt>
402 <dd>
403 the dictionary to be scanned
404 </dd><dt><i>scope</i> (int)</dt>
405 <dd>
406 1 to filter using the globals filter, 0 using the locals
407 filter.
408 Variables are only added to the list, if their name do not match
409 any of the filter expressions.
410 </dd><dt><i>filterList</i> (list of int)</dt>
411 <dd>
412 the indices of variable types to be filtered.
413 Variables are only added to the list, if their type is not
414 contained in the filter list.
415 </dd><dt><i>formatSequences</i> (bool)</dt>
416 <dd>
417 flag indicating, that sequence or dictionary
418 variables should be formatted. If it is 0 (or false), just the
419 number of items contained in these variables is returned.
420 </dd><dt><i>maxSize</i> (int)</dt>
421 <dd>
422 maximum size the formatted value of a variable will
423 be shown. If it is bigger than that, a 'too big' indication will
424 be placed in the value field.
425 </dd>
426 </dl><dl>
427 <dt>Returns:</dt>
428 <dd>
429 A tuple consisting of a list of formatted variables. Each
430 variable entry is a tuple of three elements, the variable name,
431 its type and value.
432 </dd>
433 </dl><dl>
434 <dt>Return Type:</dt>
435 <dd>
436 list of tuple of (str, str, str)
437 </dd>
438 </dl><a NAME="DebugClientBase.__generateFilterObjects" ID="DebugClientBase.__generateFilterObjects"></a>
439 <h4>DebugClientBase.__generateFilterObjects</h4>
440 <b>__generateFilterObjects</b>(<i>scope, filterString</i>)
441 <p>
442 Private slot to convert a filter string to a list of filter objects.
443 </p><dl>
444 <dt><i>scope</i></dt>
445 <dd>
446 1 to generate filter for global variables, 0 for local
447 variables (int)
448 </dd><dt><i>filterString</i></dt>
449 <dd>
450 string of filter patterns separated by ';'
451 </dd>
452 </dl><a NAME="DebugClientBase.__getCompletionList" ID="DebugClientBase.__getCompletionList"></a>
453 <h4>DebugClientBase.__getCompletionList</h4>
454 <b>__getCompletionList</b>(<i>text, completer, completions</i>)
455 <p>
456 Private method to create a completions list.
457 </p><dl>
458 <dt><i>text</i></dt>
459 <dd>
460 text to complete (string)
461 </dd><dt><i>completer</i></dt>
462 <dd>
463 completer methode
464 </dd><dt><i>completions</i></dt>
465 <dd>
466 set where to add new completions strings (set)
467 </dd>
468 </dl><a NAME="DebugClientBase.__getSysPath" ID="DebugClientBase.__getSysPath"></a>
469 <h4>DebugClientBase.__getSysPath</h4>
470 <b>__getSysPath</b>(<i>firstEntry</i>)
471 <p>
472 Private slot to calculate a path list including the PYTHONPATH
473 environment variable.
474 </p><dl>
475 <dt><i>firstEntry</i></dt>
476 <dd>
477 entry to be put first in sys.path (string)
478 </dd>
479 </dl><dl>
480 <dt>Returns:</dt>
481 <dd>
482 path list for use as sys.path (list of strings)
483 </dd>
484 </dl><a NAME="DebugClientBase.__interact" ID="DebugClientBase.__interact"></a>
485 <h4>DebugClientBase.__interact</h4>
486 <b>__interact</b>(<i></i>)
487 <p>
488 Private method to interact with the debugger.
489 </p><a NAME="DebugClientBase.__interceptSignals" ID="DebugClientBase.__interceptSignals"></a>
490 <h4>DebugClientBase.__interceptSignals</h4>
491 <b>__interceptSignals</b>(<i></i>)
492 <p>
493 Private method to intercept common signals.
494 </p><a NAME="DebugClientBase.__resolveHost" ID="DebugClientBase.__resolveHost"></a>
495 <h4>DebugClientBase.__resolveHost</h4>
496 <b>__resolveHost</b>(<i>host</i>)
497 <p>
498 Private method to resolve a hostname to an IP address.
499 </p><dl>
500 <dt><i>host</i></dt>
501 <dd>
502 hostname of the debug server (string)
503 </dd>
504 </dl><dl>
505 <dt>Returns:</dt>
506 <dd>
507 IP address (string)
508 </dd>
509 </dl><a NAME="DebugClientBase.__setCoding" ID="DebugClientBase.__setCoding"></a>
510 <h4>DebugClientBase.__setCoding</h4>
511 <b>__setCoding</b>(<i>filename</i>)
512 <p>
513 Private method to set the coding used by a python file.
514 </p><dl>
515 <dt><i>filename</i></dt>
516 <dd>
517 name of the file to inspect (string)
518 </dd>
519 </dl><a NAME="DebugClientBase.__signalHandler" ID="DebugClientBase.__signalHandler"></a>
520 <h4>DebugClientBase.__signalHandler</h4>
521 <b>__signalHandler</b>(<i>signalNumber, stackFrame</i>)
522 <p>
523 Private method to handle signals.
524 </p><dl>
525 <dt><i>signalNumber</i> (int)</dt>
526 <dd>
527 number of the signal to be handled
528 </dd><dt><i>stackFrame</i> (frame object)</dt>
529 <dd>
530 current stack frame
531 </dd>
532 </dl><a NAME="DebugClientBase.__unhandled_exception" ID="DebugClientBase.__unhandled_exception"></a>
533 <h4>DebugClientBase.__unhandled_exception</h4>
534 <b>__unhandled_exception</b>(<i>exctype, excval, exctb</i>)
535 <p>
536 Private method called to report an uncaught exception.
537 </p><dl>
538 <dt><i>exctype</i></dt>
539 <dd>
540 the type of the exception
541 </dd><dt><i>excval</i></dt>
542 <dd>
543 data about the exception
544 </dd><dt><i>exctb</i></dt>
545 <dd>
546 traceback for the exception
547 </dd>
548 </dl><a NAME="DebugClientBase.absPath" ID="DebugClientBase.absPath"></a>
549 <h4>DebugClientBase.absPath</h4>
550 <b>absPath</b>(<i>fn</i>)
551 <p>
552 Public method to convert a filename to an absolute name.
553 </p><p>
554 sys.path is used as a set of possible prefixes. The name stays
555 relative if a file could not be found.
556 </p><dl>
557 <dt><i>fn</i></dt>
558 <dd>
559 filename (string)
560 </dd>
561 </dl><dl>
562 <dt>Returns:</dt>
563 <dd>
564 the converted filename (string)
565 </dd>
566 </dl><a NAME="DebugClientBase.close" ID="DebugClientBase.close"></a>
567 <h4>DebugClientBase.close</h4>
568 <b>close</b>(<i>fd</i>)
569 <p>
570 Public method implementing a close method as a replacement for
571 os.close().
572 </p><p>
573 It prevents the debugger connections from being closed.
574 </p><dl>
575 <dt><i>fd</i></dt>
576 <dd>
577 file descriptor to be closed (integer)
578 </dd>
579 </dl><a NAME="DebugClientBase.connectDebugger" ID="DebugClientBase.connectDebugger"></a>
580 <h4>DebugClientBase.connectDebugger</h4>
581 <b>connectDebugger</b>(<i>port, remoteAddress=None, redirect=True</i>)
582 <p>
583 Public method to establish a session with the debugger.
584 </p><p>
585 It opens a network connection to the debugger, connects it to stdin,
586 stdout and stderr and saves these file objects in case the application
587 being debugged redirects them itself.
588 </p><dl>
589 <dt><i>port</i></dt>
590 <dd>
591 the port number to connect to (int)
592 </dd><dt><i>remoteAddress</i></dt>
593 <dd>
594 the network address of the debug server host
595 (string)
596 </dd><dt><i>redirect</i></dt>
597 <dd>
598 flag indicating redirection of stdin, stdout and
599 stderr (boolean)
600 </dd>
601 </dl><a NAME="DebugClientBase.eventLoop" ID="DebugClientBase.eventLoop"></a>
602 <h4>DebugClientBase.eventLoop</h4>
603 <b>eventLoop</b>(<i>disablePolling=False</i>)
604 <p>
605 Public method implementing our event loop.
606 </p><dl>
607 <dt><i>disablePolling</i></dt>
608 <dd>
609 flag indicating to enter an event loop with
610 polling disabled (boolean)
611 </dd>
612 </dl><a NAME="DebugClientBase.eventPoll" ID="DebugClientBase.eventPoll"></a>
613 <h4>DebugClientBase.eventPoll</h4>
614 <b>eventPoll</b>(<i></i>)
615 <p>
616 Public method to poll for events like 'set break point'.
617 </p><a NAME="DebugClientBase.fork" ID="DebugClientBase.fork"></a>
618 <h4>DebugClientBase.fork</h4>
619 <b>fork</b>(<i></i>)
620 <p>
621 Public method implementing a fork routine deciding which branch
622 to follow.
623 </p><dl>
624 <dt>Returns:</dt>
625 <dd>
626 process ID (integer)
627 </dd>
628 </dl><a NAME="DebugClientBase.getCoding" ID="DebugClientBase.getCoding"></a>
629 <h4>DebugClientBase.getCoding</h4>
630 <b>getCoding</b>(<i></i>)
631 <p>
632 Public method to return the current coding.
633 </p><dl>
634 <dt>Returns:</dt>
635 <dd>
636 codec name (string)
637 </dd>
638 </dl><a NAME="DebugClientBase.getRunning" ID="DebugClientBase.getRunning"></a>
639 <h4>DebugClientBase.getRunning</h4>
640 <b>getRunning</b>(<i></i>)
641 <p>
642 Public method to return the main script we are currently running.
643 </p><dl>
644 <dt>Returns:</dt>
645 <dd>
646 flag indicating a running debug session (boolean)
647 </dd>
648 </dl><a NAME="DebugClientBase.handleJsonCommand" ID="DebugClientBase.handleJsonCommand"></a>
649 <h4>DebugClientBase.handleJsonCommand</h4>
650 <b>handleJsonCommand</b>(<i>jsonStr</i>)
651 <p>
652 Public method to handle a command serialized as a JSON string.
653 </p><dl>
654 <dt><i>jsonStr</i> (str)</dt>
655 <dd>
656 string containing the command received from the IDE
657 </dd>
658 </dl><a NAME="DebugClientBase.input" ID="DebugClientBase.input"></a>
659 <h4>DebugClientBase.input</h4>
660 <b>input</b>(<i>prompt</i>)
661 <p>
662 Public method to implement input() (Python 2) using the event loop.
663 </p><dl>
664 <dt><i>prompt</i></dt>
665 <dd>
666 the prompt to be shown (string)
667 </dd>
668 </dl><dl>
669 <dt>Returns:</dt>
670 <dd>
671 the entered string evaluated as a Python expresion
672 </dd>
673 </dl><a NAME="DebugClientBase.main" ID="DebugClientBase.main"></a>
674 <h4>DebugClientBase.main</h4>
675 <b>main</b>(<i></i>)
676 <p>
677 Public method implementing the main method.
678 </p><a NAME="DebugClientBase.progTerminated" ID="DebugClientBase.progTerminated"></a>
679 <h4>DebugClientBase.progTerminated</h4>
680 <b>progTerminated</b>(<i>status, message=""</i>)
681 <p>
682 Public method to tell the debugger that the program has terminated.
683 </p><dl>
684 <dt><i>status</i> (int)</dt>
685 <dd>
686 return status
687 </dd><dt><i>message</i> (str)</dt>
688 <dd>
689 status message
690 </dd>
691 </dl><a NAME="DebugClientBase.raw_input" ID="DebugClientBase.raw_input"></a>
692 <h4>DebugClientBase.raw_input</h4>
693 <b>raw_input</b>(<i>prompt, echo</i>)
694 <p>
695 Public method to implement raw_input() / input() using the event loop.
696 </p><dl>
697 <dt><i>prompt</i></dt>
698 <dd>
699 the prompt to be shown (string)
700 </dd><dt><i>echo</i></dt>
701 <dd>
702 Flag indicating echoing of the input (boolean)
703 </dd>
704 </dl><dl>
705 <dt>Returns:</dt>
706 <dd>
707 the entered string
708 </dd>
709 </dl><a NAME="DebugClientBase.readReady" ID="DebugClientBase.readReady"></a>
710 <h4>DebugClientBase.readReady</h4>
711 <b>readReady</b>(<i>stream</i>)
712 <p>
713 Public method called when there is data ready to be read.
714 </p><dl>
715 <dt><i>stream</i></dt>
716 <dd>
717 file like object that has data to be written
718 </dd>
719 </dl><dl>
720 <dt>Returns:</dt>
721 <dd>
722 flag indicating an error condition
723 </dd>
724 </dl><dl>
725 <dt>Return Type:</dt>
726 <dd>
727 bool
728 </dd>
729 </dl><a NAME="DebugClientBase.run_call" ID="DebugClientBase.run_call"></a>
730 <h4>DebugClientBase.run_call</h4>
731 <b>run_call</b>(<i>scriptname, func, *args</i>)
732 <p>
733 Public method used to start the remote debugger and call a function.
734 </p><dl>
735 <dt><i>scriptname</i></dt>
736 <dd>
737 name of the script to be debugged (string)
738 </dd><dt><i>func</i></dt>
739 <dd>
740 function to be called
741 </dd><dt><i>*args</i></dt>
742 <dd>
743 arguments being passed to func
744 </dd>
745 </dl><dl>
746 <dt>Returns:</dt>
747 <dd>
748 result of the function call
749 </dd>
750 </dl><a NAME="DebugClientBase.sendCallTrace" ID="DebugClientBase.sendCallTrace"></a>
751 <h4>DebugClientBase.sendCallTrace</h4>
752 <b>sendCallTrace</b>(<i>event, fromInfo, toInfo</i>)
753 <p>
754 Public method to send a call trace entry.
755 </p><dl>
756 <dt><i>event</i> (str)</dt>
757 <dd>
758 trace event (call or return)
759 </dd><dt><i>fromInfo</i> (dict with 'filename', 'linenumber' and 'codename')</dt>
760 <dd>
761 dictionary containing the origin info
762 as keys
763 </dd><dt><i>toInfo</i> (dict with 'filename', 'linenumber' and 'codename')</dt>
764 <dd>
765 dictionary containing the target info
766 as keys
767 </dd>
768 </dl><a NAME="DebugClientBase.sendClearTemporaryBreakpoint" ID="DebugClientBase.sendClearTemporaryBreakpoint"></a>
769 <h4>DebugClientBase.sendClearTemporaryBreakpoint</h4>
770 <b>sendClearTemporaryBreakpoint</b>(<i>filename, lineno</i>)
771 <p>
772 Public method to signal the deletion of a temporary breakpoint.
773 </p><dl>
774 <dt><i>filename</i> (str)</dt>
775 <dd>
776 name of the file the bp belongs to
777 </dd><dt><i>lineno</i> (int)</dt>
778 <dd>
779 linenumber of the bp
780 </dd>
781 </dl><a NAME="DebugClientBase.sendClearTemporaryWatch" ID="DebugClientBase.sendClearTemporaryWatch"></a>
782 <h4>DebugClientBase.sendClearTemporaryWatch</h4>
783 <b>sendClearTemporaryWatch</b>(<i>condition</i>)
784 <p>
785 Public method to signal the deletion of a temporary watch expression.
786 </p><dl>
787 <dt><i>condition</i> (str)</dt>
788 <dd>
789 condition of the watch expression to be cleared
790 </dd>
791 </dl><a NAME="DebugClientBase.sendException" ID="DebugClientBase.sendException"></a>
792 <h4>DebugClientBase.sendException</h4>
793 <b>sendException</b>(<i>exceptionType, exceptionMessage, stack</i>)
794 <p>
795 Public method to send information for an exception.
796 </p><dl>
797 <dt><i>exceptionType</i> (str)</dt>
798 <dd>
799 type of exception raised
800 </dd><dt><i>exceptionMessage</i> (str)</dt>
801 <dd>
802 message of the exception
803 </dd><dt><i>stack</i> (list)</dt>
804 <dd>
805 stack trace information
806 </dd>
807 </dl><a NAME="DebugClientBase.sendJsonCommand" ID="DebugClientBase.sendJsonCommand"></a>
808 <h4>DebugClientBase.sendJsonCommand</h4>
809 <b>sendJsonCommand</b>(<i>method, params</i>)
810 <p>
811 Public method to send a single command or response to the IDE.
812 </p><dl>
813 <dt><i>method</i> (str)</dt>
814 <dd>
815 command or response command name to be sent
816 </dd><dt><i>params</i> (dict)</dt>
817 <dd>
818 dictionary of named parameters for the command or
819 response
820 </dd>
821 </dl><a NAME="DebugClientBase.sendPassiveStartup" ID="DebugClientBase.sendPassiveStartup"></a>
822 <h4>DebugClientBase.sendPassiveStartup</h4>
823 <b>sendPassiveStartup</b>(<i>filename, exceptions</i>)
824 <p>
825 Public method to send the passive start information.
826 </p><dl>
827 <dt><i>filename</i> (str)</dt>
828 <dd>
829 name of the script
830 </dd><dt><i>exceptions</i> (bool)</dt>
831 <dd>
832 flag to enable exception reporting of the IDE
833 </dd>
834 </dl><a NAME="DebugClientBase.sendResponseLine" ID="DebugClientBase.sendResponseLine"></a>
835 <h4>DebugClientBase.sendResponseLine</h4>
836 <b>sendResponseLine</b>(<i>stack</i>)
837 <p>
838 Public method to send the current call stack.
839 </p><dl>
840 <dt><i>stack</i> (list)</dt>
841 <dd>
842 call stack
843 </dd>
844 </dl><a NAME="DebugClientBase.sendSyntaxError" ID="DebugClientBase.sendSyntaxError"></a>
845 <h4>DebugClientBase.sendSyntaxError</h4>
846 <b>sendSyntaxError</b>(<i>message, filename, lineno, charno</i>)
847 <p>
848 Public method to send information for a syntax error.
849 </p><dl>
850 <dt><i>message</i> (str)</dt>
851 <dd>
852 syntax error message
853 </dd><dt><i>filename</i> (str)</dt>
854 <dd>
855 name of the faulty file
856 </dd><dt><i>lineno</i> (int)</dt>
857 <dd>
858 line number info
859 </dd><dt><i>charno</i> (int)</dt>
860 <dd>
861 character number info
862 </dd>
863 </dl><a NAME="DebugClientBase.sessionClose" ID="DebugClientBase.sessionClose"></a>
864 <h4>DebugClientBase.sessionClose</h4>
865 <b>sessionClose</b>(<i>terminate=True</i>)
866 <p>
867 Public method to close the session with the debugger and optionally
868 terminate.
869 </p><dl>
870 <dt><i>terminate</i></dt>
871 <dd>
872 flag indicating to terminate (boolean)
873 </dd>
874 </dl><a NAME="DebugClientBase.startDebugger" ID="DebugClientBase.startDebugger"></a>
875 <h4>DebugClientBase.startDebugger</h4>
876 <b>startDebugger</b>(<i>filename=None, host=None, port=None, enableTrace=True, exceptions=True, tracePython=False, redirect=True</i>)
877 <p>
878 Public method used to start the remote debugger.
879 </p><dl>
880 <dt><i>filename</i></dt>
881 <dd>
882 the program to be debugged (string)
883 </dd><dt><i>host</i></dt>
884 <dd>
885 hostname of the debug server (string)
886 </dd><dt><i>port</i></dt>
887 <dd>
888 portnumber of the debug server (int)
889 </dd><dt><i>enableTrace</i></dt>
890 <dd>
891 flag to enable the tracing function (boolean)
892 </dd><dt><i>exceptions</i></dt>
893 <dd>
894 flag to enable exception reporting of the IDE
895 (boolean)
896 </dd><dt><i>tracePython</i></dt>
897 <dd>
898 flag to enable tracing into the Python library
899 (boolean)
900 </dd><dt><i>redirect</i></dt>
901 <dd>
902 flag indicating redirection of stdin, stdout and
903 stderr (boolean)
904 </dd>
905 </dl><a NAME="DebugClientBase.startProgInDebugger" ID="DebugClientBase.startProgInDebugger"></a>
906 <h4>DebugClientBase.startProgInDebugger</h4>
907 <b>startProgInDebugger</b>(<i>progargs, wd='', host=None, port=None, exceptions=True, tracePython=False, redirect=True</i>)
908 <p>
909 Public method used to start the remote debugger.
910 </p><dl>
911 <dt><i>progargs</i></dt>
912 <dd>
913 commandline for the program to be debugged
914 (list of strings)
915 </dd><dt><i>wd</i></dt>
916 <dd>
917 working directory for the program execution (string)
918 </dd><dt><i>host</i></dt>
919 <dd>
920 hostname of the debug server (string)
921 </dd><dt><i>port</i></dt>
922 <dd>
923 portnumber of the debug server (int)
924 </dd><dt><i>exceptions</i></dt>
925 <dd>
926 flag to enable exception reporting of the IDE
927 (boolean)
928 </dd><dt><i>tracePython</i></dt>
929 <dd>
930 flag to enable tracing into the Python library
931 (boolean)
932 </dd><dt><i>redirect</i></dt>
933 <dd>
934 flag indicating redirection of stdin, stdout and
935 stderr (boolean)
936 </dd>
937 </dl><a NAME="DebugClientBase.writeReady" ID="DebugClientBase.writeReady"></a>
938 <h4>DebugClientBase.writeReady</h4>
939 <b>writeReady</b>(<i>stream</i>)
940 <p>
941 Public method called when we are ready to write data.
942 </p><dl>
943 <dt><i>stream</i></dt>
944 <dd>
945 file like object that has data to be written
946 </dd>
947 </dl>
948 <div align="right"><a href="#top">Up</a></div>
949 <hr /><hr />
950 <a NAME="DebugClientClose" ID="DebugClientClose"></a>
951 <h2>DebugClientClose</h2>
952 <b>DebugClientClose</b>(<i>fd</i>)
953 <p>
954 Replacement for the standard os.close(fd).
955 </p><dl>
956 <dt><i>fd</i></dt>
957 <dd>
958 open file descriptor to be closed (integer)
959 </dd>
960 </dl>
961 <div align="right"><a href="#top">Up</a></div>
962 <hr /><hr />
963 <a NAME="DebugClientFork" ID="DebugClientFork"></a>
964 <h2>DebugClientFork</h2>
965 <b>DebugClientFork</b>(<i></i>)
966 <p>
967 Replacement for the standard os.fork().
968 </p><dl>
969 <dt>Returns:</dt>
970 <dd>
971 result of the fork() call
972 </dd>
973 </dl>
974 <div align="right"><a href="#top">Up</a></div>
975 <hr /><hr />
976 <a NAME="DebugClientInput" ID="DebugClientInput"></a>
977 <h2>DebugClientInput</h2>
978 <b>DebugClientInput</b>(<i>prompt="", echo=True</i>)
979 <p>
980 Replacement for the standard input builtin.
981 </p><p>
982 This function works with the split debugger.
983 </p><dl>
984 <dt><i>prompt</i></dt>
985 <dd>
986 prompt to be shown (string)
987 </dd><dt><i>echo</i></dt>
988 <dd>
989 flag indicating to echo the output (boolean)
990 </dd>
991 </dl><dl>
992 <dt>Returns:</dt>
993 <dd>
994 result of the input() call
995 </dd>
996 </dl>
997 <div align="right"><a href="#top">Up</a></div>
998 <hr /><hr />
999 <a NAME="DebugClientRawInput" ID="DebugClientRawInput"></a>
1000 <h2>DebugClientRawInput</h2>
1001 <b>DebugClientRawInput</b>(<i>prompt="", echo=True</i>)
1002 <p>
1003 Replacement for the standard raw_input builtin.
1004 </p><p>
1005 This function works with the split debugger.
1006 </p><dl>
1007 <dt><i>prompt</i></dt>
1008 <dd>
1009 prompt to be shown. (string)
1010 </dd><dt><i>echo</i></dt>
1011 <dd>
1012 flag indicating echoing of the input (boolean)
1013 </dd>
1014 </dl><dl>
1015 <dt>Returns:</dt>
1016 <dd>
1017 result of the raw_input() call
1018 </dd>
1019 </dl>
1020 <div align="right"><a href="#top">Up</a></div>
1021 <hr /><hr />
1022 <a NAME="DebugClientSetRecursionLimit" ID="DebugClientSetRecursionLimit"></a>
1023 <h2>DebugClientSetRecursionLimit</h2>
1024 <b>DebugClientSetRecursionLimit</b>(<i>limit</i>)
1025 <p>
1026 Replacement for the standard sys.setrecursionlimit(limit).
1027 </p><dl>
1028 <dt><i>limit</i></dt>
1029 <dd>
1030 recursion limit (integer)
1031 </dd>
1032 </dl>
1033 <div align="right"><a href="#top">Up</a></div>
1034 <hr />
1035 </body></html>

eric ide

mercurial