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