|
1 <!DOCTYPE html> |
|
2 <html><head> |
|
3 <title>eric6.DebugClients.Python.DebugBase</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.DebugBase</h1> |
|
23 <p> |
|
24 Module implementing the debug base class which based originally on bdb. |
|
25 </p> |
|
26 <h3>Global Attributes</h3> |
|
27 <table> |
|
28 <tr><td>gRecursionLimit</td></tr> |
|
29 </table> |
|
30 <h3>Classes</h3> |
|
31 <table> |
|
32 <tr> |
|
33 <td><a href="#DebugBase">DebugBase</a></td> |
|
34 <td>Class implementing base class of the debugger.</td> |
|
35 </tr> |
|
36 </table> |
|
37 <h3>Functions</h3> |
|
38 <table> |
|
39 <tr> |
|
40 <td><a href="#printerr">printerr</a></td> |
|
41 <td>Module function used for debugging the debug client.</td> |
|
42 </tr><tr> |
|
43 <td><a href="#setRecursionLimit">setRecursionLimit</a></td> |
|
44 <td>Module function to set the recursion limit.</td> |
|
45 </tr> |
|
46 </table> |
|
47 <hr /><hr /> |
|
48 <a NAME="DebugBase" ID="DebugBase"></a> |
|
49 <h2>DebugBase</h2> |
|
50 <p> |
|
51 Class implementing base class of the debugger. |
|
52 </p><p> |
|
53 Provides methods for the 'owning' client to call to step etc. |
|
54 </p> |
|
55 <h3>Derived from</h3> |
|
56 object |
|
57 <h3>Class Attributes</h3> |
|
58 <table> |
|
59 <tr><td>_fnCache</td></tr><tr><td>filesToSkip</td></tr><tr><td>lib</td></tr><tr><td>pathsToSkip</td></tr><tr><td>pollTimerEnabled</td></tr> |
|
60 </table> |
|
61 <h3>Class Methods</h3> |
|
62 <table> |
|
63 <tr><td>None</td></tr> |
|
64 </table> |
|
65 <h3>Methods</h3> |
|
66 <table> |
|
67 <tr> |
|
68 <td><a href="#DebugBase.__init__">DebugBase</a></td> |
|
69 <td>Constructor</td> |
|
70 </tr><tr> |
|
71 <td><a href="#DebugBase.__checkBreakInFrame">__checkBreakInFrame</a></td> |
|
72 <td>Private method to check if the function / method has a line number which is a breakpoint.</td> |
|
73 </tr><tr> |
|
74 <td><a href="#DebugBase.__do_clearBreak">__do_clearBreak</a></td> |
|
75 <td>Private method called to clear a temporary breakpoint.</td> |
|
76 </tr><tr> |
|
77 <td><a href="#DebugBase.__do_clearWatch">__do_clearWatch</a></td> |
|
78 <td>Private method called to clear a temporary watch expression.</td> |
|
79 </tr><tr> |
|
80 <td><a href="#DebugBase.__eventPollTimer">__eventPollTimer</a></td> |
|
81 <td>Private method to set a flag every 0.5 s to check for new messages.</td> |
|
82 </tr><tr> |
|
83 <td><a href="#DebugBase.__extractExceptionName">__extractExceptionName</a></td> |
|
84 <td>Private method to extract the exception name given the exception type object.</td> |
|
85 </tr><tr> |
|
86 <td><a href="#DebugBase.__extractSystemExitMessage">__extractSystemExitMessage</a></td> |
|
87 <td>Private method to get the SystemExit code and message.</td> |
|
88 </tr><tr> |
|
89 <td><a href="#DebugBase.__extract_stack">__extract_stack</a></td> |
|
90 <td>Private member to return a list of stack frames.</td> |
|
91 </tr><tr> |
|
92 <td><a href="#DebugBase.__sendCallTrace">__sendCallTrace</a></td> |
|
93 <td>Private method to send a call/return trace.</td> |
|
94 </tr><tr> |
|
95 <td><a href="#DebugBase.__skipFrame">__skipFrame</a></td> |
|
96 <td>Private method to filter out debugger files.</td> |
|
97 </tr><tr> |
|
98 <td><a href="#DebugBase._set_stopinfo">_set_stopinfo</a></td> |
|
99 <td>Protected method to update the frame pointers.</td> |
|
100 </tr><tr> |
|
101 <td><a href="#DebugBase.bootstrap">bootstrap</a></td> |
|
102 <td>Public method to bootstrap a thread.</td> |
|
103 </tr><tr> |
|
104 <td><a href="#DebugBase.break_here">break_here</a></td> |
|
105 <td>Public method reimplemented from bdb.py to fix the filename from the frame.</td> |
|
106 </tr><tr> |
|
107 <td><a href="#DebugBase.fix_frame_filename">fix_frame_filename</a></td> |
|
108 <td>Public method used to fixup the filename for a given frame.</td> |
|
109 </tr><tr> |
|
110 <td><a href="#DebugBase.getCurrentFrame">getCurrentFrame</a></td> |
|
111 <td>Public method to return the current frame.</td> |
|
112 </tr><tr> |
|
113 <td><a href="#DebugBase.getFrameLocals">getFrameLocals</a></td> |
|
114 <td>Public method to return the locals dictionary of the current frame or a frame below.</td> |
|
115 </tr><tr> |
|
116 <td><a href="#DebugBase.getStack">getStack</a></td> |
|
117 <td>Public method to get the stack.</td> |
|
118 </tr><tr> |
|
119 <td><a href="#DebugBase.go">go</a></td> |
|
120 <td>Public method to resume the thread.</td> |
|
121 </tr><tr> |
|
122 <td><a href="#DebugBase.move_instruction_pointer">move_instruction_pointer</a></td> |
|
123 <td>Public methode to move the instruction pointer to another line.</td> |
|
124 </tr><tr> |
|
125 <td><a href="#DebugBase.profile">profile</a></td> |
|
126 <td>Public method used to trace some stuff independent of the debugger trace function.</td> |
|
127 </tr><tr> |
|
128 <td><a href="#DebugBase.profileWithRecursion">profileWithRecursion</a></td> |
|
129 <td>Public method used to trace some stuff independent of the debugger trace function.</td> |
|
130 </tr><tr> |
|
131 <td><a href="#DebugBase.run">run</a></td> |
|
132 <td>Public method to start a given command under debugger control.</td> |
|
133 </tr><tr> |
|
134 <td><a href="#DebugBase.setRecursionDepth">setRecursionDepth</a></td> |
|
135 <td>Public method to determine the current recursion depth.</td> |
|
136 </tr><tr> |
|
137 <td><a href="#DebugBase.set_continue">set_continue</a></td> |
|
138 <td>Public method to stop only on next breakpoint.</td> |
|
139 </tr><tr> |
|
140 <td><a href="#DebugBase.set_next">set_next</a></td> |
|
141 <td>Public method to stop on the next line in or below the given frame.</td> |
|
142 </tr><tr> |
|
143 <td><a href="#DebugBase.set_quit">set_quit</a></td> |
|
144 <td>Public method to quit.</td> |
|
145 </tr><tr> |
|
146 <td><a href="#DebugBase.set_return">set_return</a></td> |
|
147 <td>Public method to stop when returning from the given frame.</td> |
|
148 </tr><tr> |
|
149 <td><a href="#DebugBase.set_step">set_step</a></td> |
|
150 <td>Public method to stop after one line of code.</td> |
|
151 </tr><tr> |
|
152 <td><a href="#DebugBase.set_trace">set_trace</a></td> |
|
153 <td>Public method to start debugging from 'frame'.</td> |
|
154 </tr><tr> |
|
155 <td><a href="#DebugBase.step">step</a></td> |
|
156 <td>Public method to perform a step operation in this thread.</td> |
|
157 </tr><tr> |
|
158 <td><a href="#DebugBase.stepOut">stepOut</a></td> |
|
159 <td>Public method to perform a step out of the current call.</td> |
|
160 </tr><tr> |
|
161 <td><a href="#DebugBase.stop_here">stop_here</a></td> |
|
162 <td>Public method reimplemented to filter out debugger files.</td> |
|
163 </tr><tr> |
|
164 <td><a href="#DebugBase.storeFrameLocals">storeFrameLocals</a></td> |
|
165 <td>Public method to store the locals into the frame, so an access to frame.f_locals returns the last data.</td> |
|
166 </tr><tr> |
|
167 <td><a href="#DebugBase.tracePythonLibs">tracePythonLibs</a></td> |
|
168 <td>Public method to update the settings to trace into Python libraries.</td> |
|
169 </tr><tr> |
|
170 <td><a href="#DebugBase.trace_dispatch">trace_dispatch</a></td> |
|
171 <td>Public method reimplemented from bdb.py to do some special things.</td> |
|
172 </tr><tr> |
|
173 <td><a href="#DebugBase.user_exception">user_exception</a></td> |
|
174 <td>Public method reimplemented to report an exception to the debug server.</td> |
|
175 </tr><tr> |
|
176 <td><a href="#DebugBase.user_line">user_line</a></td> |
|
177 <td>Public method reimplemented to handle the program about to execute a particular line.</td> |
|
178 </tr> |
|
179 </table> |
|
180 <h3>Static Methods</h3> |
|
181 <table> |
|
182 <tr><td>None</td></tr> |
|
183 </table> |
|
184 <a NAME="DebugBase.__init__" ID="DebugBase.__init__"></a> |
|
185 <h4>DebugBase (Constructor)</h4> |
|
186 <b>DebugBase</b>(<i>dbgClient</i>) |
|
187 <p> |
|
188 Constructor |
|
189 </p><dl> |
|
190 <dt><i>dbgClient</i></dt> |
|
191 <dd> |
|
192 the owning client |
|
193 </dd> |
|
194 </dl><a NAME="DebugBase.__checkBreakInFrame" ID="DebugBase.__checkBreakInFrame"></a> |
|
195 <h4>DebugBase.__checkBreakInFrame</h4> |
|
196 <b>__checkBreakInFrame</b>(<i>frame</i>) |
|
197 <p> |
|
198 Private method to check if the function / method has a line number |
|
199 which is a breakpoint. |
|
200 </p><dl> |
|
201 <dt><i>frame</i> (frame object)</dt> |
|
202 <dd> |
|
203 the frame object |
|
204 </dd> |
|
205 </dl><dl> |
|
206 <dt>Returns:</dt> |
|
207 <dd> |
|
208 Flag indicating a function / method with breakpoint |
|
209 </dd> |
|
210 </dl><dl> |
|
211 <dt>Return Type:</dt> |
|
212 <dd> |
|
213 bool |
|
214 </dd> |
|
215 </dl><a NAME="DebugBase.__do_clearBreak" ID="DebugBase.__do_clearBreak"></a> |
|
216 <h4>DebugBase.__do_clearBreak</h4> |
|
217 <b>__do_clearBreak</b>(<i>filename, lineno</i>) |
|
218 <p> |
|
219 Private method called to clear a temporary breakpoint. |
|
220 </p><dl> |
|
221 <dt><i>filename</i> (str)</dt> |
|
222 <dd> |
|
223 name of the file the bp belongs to |
|
224 </dd><dt><i>lineno</i> (int)</dt> |
|
225 <dd> |
|
226 linenumber of the bp |
|
227 </dd> |
|
228 </dl><a NAME="DebugBase.__do_clearWatch" ID="DebugBase.__do_clearWatch"></a> |
|
229 <h4>DebugBase.__do_clearWatch</h4> |
|
230 <b>__do_clearWatch</b>(<i>cond</i>) |
|
231 <p> |
|
232 Private method called to clear a temporary watch expression. |
|
233 </p><dl> |
|
234 <dt><i>cond</i> (str)</dt> |
|
235 <dd> |
|
236 expression of the watch expression to be cleared |
|
237 </dd> |
|
238 </dl><a NAME="DebugBase.__eventPollTimer" ID="DebugBase.__eventPollTimer"></a> |
|
239 <h4>DebugBase.__eventPollTimer</h4> |
|
240 <b>__eventPollTimer</b>(<i></i>) |
|
241 <p> |
|
242 Private method to set a flag every 0.5 s to check for new messages. |
|
243 </p><a NAME="DebugBase.__extractExceptionName" ID="DebugBase.__extractExceptionName"></a> |
|
244 <h4>DebugBase.__extractExceptionName</h4> |
|
245 <b>__extractExceptionName</b>(<i>exctype</i>) |
|
246 <p> |
|
247 Private method to extract the exception name given the exception |
|
248 type object. |
|
249 </p><dl> |
|
250 <dt><i>exctype</i></dt> |
|
251 <dd> |
|
252 type of the exception |
|
253 </dd> |
|
254 </dl><dl> |
|
255 <dt>Returns:</dt> |
|
256 <dd> |
|
257 exception name (string) |
|
258 </dd> |
|
259 </dl><a NAME="DebugBase.__extractSystemExitMessage" ID="DebugBase.__extractSystemExitMessage"></a> |
|
260 <h4>DebugBase.__extractSystemExitMessage</h4> |
|
261 <b>__extractSystemExitMessage</b>(<i>excinfo</i>) |
|
262 <p> |
|
263 Private method to get the SystemExit code and message. |
|
264 </p><dl> |
|
265 <dt><i>excinfo</i> (tuple(Exception, excval object, traceback frame object))</dt> |
|
266 <dd> |
|
267 details about the SystemExit exception |
|
268 </dd> |
|
269 </dl><dl> |
|
270 <dt>Returns:</dt> |
|
271 <dd> |
|
272 SystemExit code and message |
|
273 </dd> |
|
274 </dl><dl> |
|
275 <dt>Return Type:</dt> |
|
276 <dd> |
|
277 int, str |
|
278 </dd> |
|
279 </dl><a NAME="DebugBase.__extract_stack" ID="DebugBase.__extract_stack"></a> |
|
280 <h4>DebugBase.__extract_stack</h4> |
|
281 <b>__extract_stack</b>(<i>exctb</i>) |
|
282 <p> |
|
283 Private member to return a list of stack frames. |
|
284 </p><dl> |
|
285 <dt><i>exctb</i></dt> |
|
286 <dd> |
|
287 exception traceback |
|
288 </dd> |
|
289 </dl><dl> |
|
290 <dt>Returns:</dt> |
|
291 <dd> |
|
292 list of stack frames |
|
293 </dd> |
|
294 </dl><a NAME="DebugBase.__sendCallTrace" ID="DebugBase.__sendCallTrace"></a> |
|
295 <h4>DebugBase.__sendCallTrace</h4> |
|
296 <b>__sendCallTrace</b>(<i>event, fromFrame, toFrame</i>) |
|
297 <p> |
|
298 Private method to send a call/return trace. |
|
299 </p><dl> |
|
300 <dt><i>event</i> (str)</dt> |
|
301 <dd> |
|
302 trace event |
|
303 </dd><dt><i>fromFrame</i> (frame object)</dt> |
|
304 <dd> |
|
305 originating frame |
|
306 </dd><dt><i>toFrame</i> (frame object)</dt> |
|
307 <dd> |
|
308 destination frame |
|
309 </dd> |
|
310 </dl><a NAME="DebugBase.__skipFrame" ID="DebugBase.__skipFrame"></a> |
|
311 <h4>DebugBase.__skipFrame</h4> |
|
312 <b>__skipFrame</b>(<i>frame</i>) |
|
313 <p> |
|
314 Private method to filter out debugger files. |
|
315 </p><p> |
|
316 Tracing is turned off for files that are part of the |
|
317 debugger that are called from the application being debugged. |
|
318 </p><dl> |
|
319 <dt><i>frame</i> (frame object)</dt> |
|
320 <dd> |
|
321 the frame object |
|
322 </dd> |
|
323 </dl><dl> |
|
324 <dt>Returns:</dt> |
|
325 <dd> |
|
326 flag indicating whether the debugger should skip this frame |
|
327 </dd> |
|
328 </dl><dl> |
|
329 <dt>Return Type:</dt> |
|
330 <dd> |
|
331 bool |
|
332 </dd> |
|
333 </dl><a NAME="DebugBase._set_stopinfo" ID="DebugBase._set_stopinfo"></a> |
|
334 <h4>DebugBase._set_stopinfo</h4> |
|
335 <b>_set_stopinfo</b>(<i>stopframe, returnframe</i>) |
|
336 <p> |
|
337 Protected method to update the frame pointers. |
|
338 </p><dl> |
|
339 <dt><i>stopframe</i> (frame object)</dt> |
|
340 <dd> |
|
341 the frame object where to stop |
|
342 </dd><dt><i>returnframe</i> (frame object)</dt> |
|
343 <dd> |
|
344 the frame object where to stop on a function return |
|
345 </dd> |
|
346 </dl><a NAME="DebugBase.bootstrap" ID="DebugBase.bootstrap"></a> |
|
347 <h4>DebugBase.bootstrap</h4> |
|
348 <b>bootstrap</b>(<i>target, args, kwargs</i>) |
|
349 <p> |
|
350 Public method to bootstrap a thread. |
|
351 </p><p> |
|
352 It wraps the call to the user function to enable tracing |
|
353 before hand. |
|
354 </p><dl> |
|
355 <dt><i>target</i> (function pointer)</dt> |
|
356 <dd> |
|
357 function which is called in the new created thread |
|
358 </dd><dt><i>args</i> (tuple)</dt> |
|
359 <dd> |
|
360 arguments to pass to target |
|
361 </dd><dt><i>kwargs</i> (dict)</dt> |
|
362 <dd> |
|
363 keyword arguments to pass to target |
|
364 </dd> |
|
365 </dl><a NAME="DebugBase.break_here" ID="DebugBase.break_here"></a> |
|
366 <h4>DebugBase.break_here</h4> |
|
367 <b>break_here</b>(<i>frame</i>) |
|
368 <p> |
|
369 Public method reimplemented from bdb.py to fix the filename from the |
|
370 frame. |
|
371 </p><p> |
|
372 See fix_frame_filename for more info. |
|
373 </p><dl> |
|
374 <dt><i>frame</i> (frame object)</dt> |
|
375 <dd> |
|
376 the frame object |
|
377 </dd> |
|
378 </dl><dl> |
|
379 <dt>Returns:</dt> |
|
380 <dd> |
|
381 flag indicating the break status |
|
382 </dd> |
|
383 </dl><dl> |
|
384 <dt>Return Type:</dt> |
|
385 <dd> |
|
386 bool |
|
387 </dd> |
|
388 </dl><a NAME="DebugBase.fix_frame_filename" ID="DebugBase.fix_frame_filename"></a> |
|
389 <h4>DebugBase.fix_frame_filename</h4> |
|
390 <b>fix_frame_filename</b>(<i>frame</i>) |
|
391 <p> |
|
392 Public method used to fixup the filename for a given frame. |
|
393 </p><p> |
|
394 The logic employed here is that if a module was loaded |
|
395 from a .pyc file, then the correct .py to operate with |
|
396 should be in the same path as the .pyc. The reason this |
|
397 logic is needed is that when a .pyc file is generated, the |
|
398 filename embedded and thus what is readable in the code object |
|
399 of the frame object is the fully qualified filepath when the |
|
400 pyc is generated. If files are moved from machine to machine |
|
401 this can break debugging as the .pyc will refer to the .py |
|
402 on the original machine. Another case might be sharing |
|
403 code over a network... This logic deals with that. |
|
404 </p><dl> |
|
405 <dt><i>frame</i> (frame object)</dt> |
|
406 <dd> |
|
407 the frame object |
|
408 </dd> |
|
409 </dl><dl> |
|
410 <dt>Returns:</dt> |
|
411 <dd> |
|
412 fixed up file name |
|
413 </dd> |
|
414 </dl><dl> |
|
415 <dt>Return Type:</dt> |
|
416 <dd> |
|
417 str |
|
418 </dd> |
|
419 </dl><a NAME="DebugBase.getCurrentFrame" ID="DebugBase.getCurrentFrame"></a> |
|
420 <h4>DebugBase.getCurrentFrame</h4> |
|
421 <b>getCurrentFrame</b>(<i></i>) |
|
422 <p> |
|
423 Public method to return the current frame. |
|
424 </p><dl> |
|
425 <dt>Returns:</dt> |
|
426 <dd> |
|
427 the current frame |
|
428 </dd> |
|
429 </dl><dl> |
|
430 <dt>Return Type:</dt> |
|
431 <dd> |
|
432 frame object |
|
433 </dd> |
|
434 </dl><a NAME="DebugBase.getFrameLocals" ID="DebugBase.getFrameLocals"></a> |
|
435 <h4>DebugBase.getFrameLocals</h4> |
|
436 <b>getFrameLocals</b>(<i>frmnr=0</i>) |
|
437 <p> |
|
438 Public method to return the locals dictionary of the current frame |
|
439 or a frame below. |
|
440 </p><dl> |
|
441 <dt><i>frmnr=</i></dt> |
|
442 <dd> |
|
443 distance of frame to get locals dictionary of. 0 is |
|
444 the current frame (int) |
|
445 </dd> |
|
446 </dl><dl> |
|
447 <dt>Returns:</dt> |
|
448 <dd> |
|
449 locals dictionary of the frame |
|
450 </dd> |
|
451 </dl><a NAME="DebugBase.getStack" ID="DebugBase.getStack"></a> |
|
452 <h4>DebugBase.getStack</h4> |
|
453 <b>getStack</b>(<i>frame=None, applyTrace=False</i>) |
|
454 <p> |
|
455 Public method to get the stack. |
|
456 </p><dl> |
|
457 <dt><i>frame=</i> (frame object or list)</dt> |
|
458 <dd> |
|
459 frame object to inspect |
|
460 </dd><dt><i>applyTrace=</i> (bool)</dt> |
|
461 <dd> |
|
462 flag to assign trace function to fr.f_trace |
|
463 </dd> |
|
464 </dl><dl> |
|
465 <dt>Returns:</dt> |
|
466 <dd> |
|
467 list of lists with file name (string), line number (integer) |
|
468 and function name (string) |
|
469 </dd> |
|
470 </dl><a NAME="DebugBase.go" ID="DebugBase.go"></a> |
|
471 <h4>DebugBase.go</h4> |
|
472 <b>go</b>(<i>special</i>) |
|
473 <p> |
|
474 Public method to resume the thread. |
|
475 </p><p> |
|
476 It resumes the thread stopping only at breakpoints or exceptions. |
|
477 </p><dl> |
|
478 <dt><i>special</i></dt> |
|
479 <dd> |
|
480 flag indicating a special continue operation |
|
481 </dd> |
|
482 </dl><a NAME="DebugBase.move_instruction_pointer" ID="DebugBase.move_instruction_pointer"></a> |
|
483 <h4>DebugBase.move_instruction_pointer</h4> |
|
484 <b>move_instruction_pointer</b>(<i>lineno</i>) |
|
485 <p> |
|
486 Public methode to move the instruction pointer to another line. |
|
487 </p><dl> |
|
488 <dt><i>lineno</i> (int)</dt> |
|
489 <dd> |
|
490 new line number |
|
491 </dd> |
|
492 </dl><a NAME="DebugBase.profile" ID="DebugBase.profile"></a> |
|
493 <h4>DebugBase.profile</h4> |
|
494 <b>profile</b>(<i>frame, event, arg</i>) |
|
495 <p> |
|
496 Public method used to trace some stuff independent of the debugger |
|
497 trace function. |
|
498 </p><dl> |
|
499 <dt><i>frame</i> (frame object)</dt> |
|
500 <dd> |
|
501 current stack frame |
|
502 </dd><dt><i>event</i> (str)</dt> |
|
503 <dd> |
|
504 trace event |
|
505 </dd><dt><i>arg</i> (depends on the previous event parameter)</dt> |
|
506 <dd> |
|
507 arguments |
|
508 </dd> |
|
509 </dl><a NAME="DebugBase.profileWithRecursion" ID="DebugBase.profileWithRecursion"></a> |
|
510 <h4>DebugBase.profileWithRecursion</h4> |
|
511 <b>profileWithRecursion</b>(<i>frame, event, arg</i>) |
|
512 <p> |
|
513 Public method used to trace some stuff independent of the debugger |
|
514 trace function. |
|
515 </p><dl> |
|
516 <dt><i>frame</i> (frame object)</dt> |
|
517 <dd> |
|
518 current stack frame |
|
519 </dd><dt><i>event</i> (str)</dt> |
|
520 <dd> |
|
521 trace event |
|
522 </dd><dt><i>arg</i> (depends on the previous event parameter)</dt> |
|
523 <dd> |
|
524 arguments |
|
525 </dd> |
|
526 </dl><dl> |
|
527 <dt>Raises <b>RuntimeError</b>:</dt> |
|
528 <dd> |
|
529 raised to indicate too many recursions |
|
530 </dd> |
|
531 </dl><a NAME="DebugBase.run" ID="DebugBase.run"></a> |
|
532 <h4>DebugBase.run</h4> |
|
533 <b>run</b>(<i>cmd, globalsDict=None, localsDict=None, debug=True</i>) |
|
534 <p> |
|
535 Public method to start a given command under debugger control. |
|
536 </p><dl> |
|
537 <dt><i>cmd</i> (str or CodeType)</dt> |
|
538 <dd> |
|
539 command / code to execute under debugger control |
|
540 </dd><dt><i>globalsDict=</i> (dict)</dt> |
|
541 <dd> |
|
542 dictionary of global variables for cmd |
|
543 </dd><dt><i>localsDict=</i> (dict)</dt> |
|
544 <dd> |
|
545 dictionary of local variables for cmd |
|
546 </dd><dt><i>debug=</i> (bool)</dt> |
|
547 <dd> |
|
548 flag if command should run under debugger control |
|
549 </dd> |
|
550 </dl><a NAME="DebugBase.setRecursionDepth" ID="DebugBase.setRecursionDepth"></a> |
|
551 <h4>DebugBase.setRecursionDepth</h4> |
|
552 <b>setRecursionDepth</b>(<i>frame</i>) |
|
553 <p> |
|
554 Public method to determine the current recursion depth. |
|
555 </p><dl> |
|
556 <dt><i>frame</i></dt> |
|
557 <dd> |
|
558 The current stack frame. |
|
559 </dd> |
|
560 </dl><a NAME="DebugBase.set_continue" ID="DebugBase.set_continue"></a> |
|
561 <h4>DebugBase.set_continue</h4> |
|
562 <b>set_continue</b>(<i>special</i>) |
|
563 <p> |
|
564 Public method to stop only on next breakpoint. |
|
565 </p><dl> |
|
566 <dt><i>special</i> (bool)</dt> |
|
567 <dd> |
|
568 flag indicating a special continue operation |
|
569 </dd> |
|
570 </dl><a NAME="DebugBase.set_next" ID="DebugBase.set_next"></a> |
|
571 <h4>DebugBase.set_next</h4> |
|
572 <b>set_next</b>(<i>frame</i>) |
|
573 <p> |
|
574 Public method to stop on the next line in or below the given frame. |
|
575 </p><dl> |
|
576 <dt><i>frame</i> (frame object)</dt> |
|
577 <dd> |
|
578 the frame object |
|
579 </dd> |
|
580 </dl><a NAME="DebugBase.set_quit" ID="DebugBase.set_quit"></a> |
|
581 <h4>DebugBase.set_quit</h4> |
|
582 <b>set_quit</b>(<i></i>) |
|
583 <p> |
|
584 Public method to quit. |
|
585 </p><p> |
|
586 Disables the trace functions and resets all frame pointer. |
|
587 </p><a NAME="DebugBase.set_return" ID="DebugBase.set_return"></a> |
|
588 <h4>DebugBase.set_return</h4> |
|
589 <b>set_return</b>(<i>frame</i>) |
|
590 <p> |
|
591 Public method to stop when returning from the given frame. |
|
592 </p><dl> |
|
593 <dt><i>frame</i> (frame object)</dt> |
|
594 <dd> |
|
595 the frame object |
|
596 </dd> |
|
597 </dl><a NAME="DebugBase.set_step" ID="DebugBase.set_step"></a> |
|
598 <h4>DebugBase.set_step</h4> |
|
599 <b>set_step</b>(<i></i>) |
|
600 <p> |
|
601 Public method to stop after one line of code. |
|
602 </p><a NAME="DebugBase.set_trace" ID="DebugBase.set_trace"></a> |
|
603 <h4>DebugBase.set_trace</h4> |
|
604 <b>set_trace</b>(<i>frame=None</i>) |
|
605 <p> |
|
606 Public method to start debugging from 'frame'. |
|
607 </p><p> |
|
608 If frame is not specified, debugging starts from caller's frame. |
|
609 Because of jump optimizations it's not possible to use sys.breakpoint() |
|
610 as last instruction in a function or method. |
|
611 </p><dl> |
|
612 <dt><i>frame=</i> (frame object)</dt> |
|
613 <dd> |
|
614 frame to start debugging from |
|
615 </dd> |
|
616 </dl><a NAME="DebugBase.step" ID="DebugBase.step"></a> |
|
617 <h4>DebugBase.step</h4> |
|
618 <b>step</b>(<i>traceMode</i>) |
|
619 <p> |
|
620 Public method to perform a step operation in this thread. |
|
621 </p><dl> |
|
622 <dt><i>traceMode</i></dt> |
|
623 <dd> |
|
624 If it is True, then the step is a step into, |
|
625 otherwise it is a step over. |
|
626 </dd> |
|
627 </dl><a NAME="DebugBase.stepOut" ID="DebugBase.stepOut"></a> |
|
628 <h4>DebugBase.stepOut</h4> |
|
629 <b>stepOut</b>(<i></i>) |
|
630 <p> |
|
631 Public method to perform a step out of the current call. |
|
632 </p><a NAME="DebugBase.stop_here" ID="DebugBase.stop_here"></a> |
|
633 <h4>DebugBase.stop_here</h4> |
|
634 <b>stop_here</b>(<i>frame</i>) |
|
635 <p> |
|
636 Public method reimplemented to filter out debugger files. |
|
637 </p><p> |
|
638 Tracing is turned off for files that are part of the |
|
639 debugger that are called from the application being debugged. |
|
640 </p><dl> |
|
641 <dt><i>frame</i> (frame object)</dt> |
|
642 <dd> |
|
643 the frame object |
|
644 </dd> |
|
645 </dl><dl> |
|
646 <dt>Returns:</dt> |
|
647 <dd> |
|
648 flag indicating whether the debugger should stop here |
|
649 </dd> |
|
650 </dl><dl> |
|
651 <dt>Return Type:</dt> |
|
652 <dd> |
|
653 bool |
|
654 </dd> |
|
655 </dl><a NAME="DebugBase.storeFrameLocals" ID="DebugBase.storeFrameLocals"></a> |
|
656 <h4>DebugBase.storeFrameLocals</h4> |
|
657 <b>storeFrameLocals</b>(<i>frmnr=0</i>) |
|
658 <p> |
|
659 Public method to store the locals into the frame, so an access to |
|
660 frame.f_locals returns the last data. |
|
661 </p><dl> |
|
662 <dt><i>frmnr=</i></dt> |
|
663 <dd> |
|
664 distance of frame to store locals dictionary to. 0 is |
|
665 the current frame (int) |
|
666 </dd> |
|
667 </dl><a NAME="DebugBase.tracePythonLibs" ID="DebugBase.tracePythonLibs"></a> |
|
668 <h4>DebugBase.tracePythonLibs</h4> |
|
669 <b>tracePythonLibs</b>(<i>enable</i>) |
|
670 <p> |
|
671 Public method to update the settings to trace into Python libraries. |
|
672 </p><dl> |
|
673 <dt><i>enable</i> (bool)</dt> |
|
674 <dd> |
|
675 flag to debug into Python libraries |
|
676 </dd> |
|
677 </dl><a NAME="DebugBase.trace_dispatch" ID="DebugBase.trace_dispatch"></a> |
|
678 <h4>DebugBase.trace_dispatch</h4> |
|
679 <b>trace_dispatch</b>(<i>frame, event, arg</i>) |
|
680 <p> |
|
681 Public method reimplemented from bdb.py to do some special things. |
|
682 </p><p> |
|
683 This specialty is to check the connection to the debug server |
|
684 for new events (i.e. new breakpoints) while we are going through |
|
685 the code. |
|
686 </p><dl> |
|
687 <dt><i>frame</i> (frame object)</dt> |
|
688 <dd> |
|
689 The current stack frame |
|
690 </dd><dt><i>event</i> (str)</dt> |
|
691 <dd> |
|
692 The trace event |
|
693 </dd><dt><i>arg</i> (depends on the previous event parameter)</dt> |
|
694 <dd> |
|
695 The arguments |
|
696 </dd> |
|
697 </dl><dl> |
|
698 <dt>Returns:</dt> |
|
699 <dd> |
|
700 local trace function |
|
701 </dd> |
|
702 </dl><dl> |
|
703 <dt>Return Type:</dt> |
|
704 <dd> |
|
705 trace function or None |
|
706 </dd> |
|
707 </dl><dl> |
|
708 <dt>Raises <b>SystemExit</b>:</dt> |
|
709 <dd> |
|
710 |
|
711 </dd> |
|
712 </dl><a NAME="DebugBase.user_exception" ID="DebugBase.user_exception"></a> |
|
713 <h4>DebugBase.user_exception</h4> |
|
714 <b>user_exception</b>(<i>excinfo, unhandled=False</i>) |
|
715 <p> |
|
716 Public method reimplemented to report an exception to the debug server. |
|
717 </p><dl> |
|
718 <dt><i>excinfo</i> (tuple(Exception, excval object, traceback frame object))</dt> |
|
719 <dd> |
|
720 details about the exception |
|
721 </dd><dt><i>unhandled=</i> (bool)</dt> |
|
722 <dd> |
|
723 flag indicating an uncaught exception |
|
724 </dd> |
|
725 </dl><a NAME="DebugBase.user_line" ID="DebugBase.user_line"></a> |
|
726 <h4>DebugBase.user_line</h4> |
|
727 <b>user_line</b>(<i>frame</i>) |
|
728 <p> |
|
729 Public method reimplemented to handle the program about to execute a |
|
730 particular line. |
|
731 </p><dl> |
|
732 <dt><i>frame</i></dt> |
|
733 <dd> |
|
734 the frame object |
|
735 </dd> |
|
736 </dl> |
|
737 <div align="right"><a href="#top">Up</a></div> |
|
738 <hr /><hr /> |
|
739 <a NAME="printerr" ID="printerr"></a> |
|
740 <h2>printerr</h2> |
|
741 <b>printerr</b>(<i>s</i>) |
|
742 <p> |
|
743 Module function used for debugging the debug client. |
|
744 </p><dl> |
|
745 <dt><i>s</i></dt> |
|
746 <dd> |
|
747 data to be printed |
|
748 </dd> |
|
749 </dl> |
|
750 <div align="right"><a href="#top">Up</a></div> |
|
751 <hr /><hr /> |
|
752 <a NAME="setRecursionLimit" ID="setRecursionLimit"></a> |
|
753 <h2>setRecursionLimit</h2> |
|
754 <b>setRecursionLimit</b>(<i>limit</i>) |
|
755 <p> |
|
756 Module function to set the recursion limit. |
|
757 </p><dl> |
|
758 <dt><i>limit</i></dt> |
|
759 <dd> |
|
760 recursion limit (integer) |
|
761 </dd> |
|
762 </dl> |
|
763 <div align="right"><a href="#top">Up</a></div> |
|
764 <hr /> |
|
765 </body></html> |