5 <link rel="stylesheet" href="styles.css"> |
5 <link rel="stylesheet" href="styles.css"> |
6 </head> |
6 </head> |
7 <body> |
7 <body> |
8 <a NAME="top" ID="top"></a> |
8 <a NAME="top" ID="top"></a> |
9 <h1>eric7.DebugClients.Python.DebugBase</h1> |
9 <h1>eric7.DebugClients.Python.DebugBase</h1> |
10 |
|
11 <p> |
10 <p> |
12 Module implementing the debug base class which based originally on bdb. |
11 Module implementing the debug base class which based originally on bdb. |
13 </p> |
12 </p> |
|
13 |
14 <h3>Global Attributes</h3> |
14 <h3>Global Attributes</h3> |
15 |
|
16 <table> |
15 <table> |
17 <tr><td>GENERATOR_AND_COROUTINE_FLAGS</td></tr><tr><td>gRecursionLimit</td></tr> |
16 <tr><td>GENERATOR_AND_COROUTINE_FLAGS</td></tr> |
|
17 <tr><td>gRecursionLimit</td></tr> |
18 </table> |
18 </table> |
|
19 |
19 <h3>Classes</h3> |
20 <h3>Classes</h3> |
20 |
|
21 <table> |
21 <table> |
22 |
|
23 <tr> |
22 <tr> |
24 <td><a href="#DebugBase">DebugBase</a></td> |
23 <td><a href="#DebugBase">DebugBase</a></td> |
25 <td>Class implementing base class of the debugger.</td> |
24 <td>Class implementing base class of the debugger.</td> |
26 </tr> |
25 </tr> |
27 </table> |
26 </table> |
|
27 |
28 <h3>Functions</h3> |
28 <h3>Functions</h3> |
29 |
|
30 <table> |
29 <table> |
31 |
|
32 <tr> |
30 <tr> |
33 <td><a href="#printerr">printerr</a></td> |
31 <td><a href="#printerr">printerr</a></td> |
34 <td>Module function used for debugging the debug client.</td> |
32 <td>Module function used for debugging the debug client.</td> |
35 </tr> |
33 </tr> |
36 <tr> |
34 <tr> |
37 <td><a href="#setRecursionLimit">setRecursionLimit</a></td> |
35 <td><a href="#setRecursionLimit">setRecursionLimit</a></td> |
38 <td>Module function to set the recursion limit.</td> |
36 <td>Module function to set the recursion limit.</td> |
39 </tr> |
37 </tr> |
40 </table> |
38 </table> |
|
39 |
41 <hr /> |
40 <hr /> |
42 <hr /> |
41 <hr /> |
43 <a NAME="DebugBase" ID="DebugBase"></a> |
42 <a NAME="DebugBase" ID="DebugBase"></a> |
44 <h2>DebugBase</h2> |
43 <h2>DebugBase</h2> |
45 |
|
46 <p> |
44 <p> |
47 Class implementing base class of the debugger. |
45 Class implementing base class of the debugger. |
48 </p> |
46 </p> |
49 <p> |
47 <p> |
50 Provides methods for the 'owning' client to call to step etc. |
48 Provides methods for the 'owning' client to call to step etc. |
51 </p> |
49 </p> |
|
50 |
52 <h3>Derived from</h3> |
51 <h3>Derived from</h3> |
53 None |
52 None |
54 <h3>Class Attributes</h3> |
53 <h3>Class Attributes</h3> |
55 |
|
56 <table> |
54 <table> |
57 <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> |
55 <tr><td>_fnCache</td></tr> |
|
56 <tr><td>filesToSkip</td></tr> |
|
57 <tr><td>lib</td></tr> |
|
58 <tr><td>pathsToSkip</td></tr> |
|
59 <tr><td>pollTimerEnabled</td></tr> |
58 </table> |
60 </table> |
|
61 |
59 <h3>Class Methods</h3> |
62 <h3>Class Methods</h3> |
60 |
|
61 <table> |
63 <table> |
62 <tr><td>None</td></tr> |
64 <tr><td>None</td></tr> |
63 </table> |
65 </table> |
|
66 |
64 <h3>Methods</h3> |
67 <h3>Methods</h3> |
65 |
|
66 <table> |
68 <table> |
67 |
|
68 <tr> |
69 <tr> |
69 <td><a href="#DebugBase.__init__">DebugBase</a></td> |
70 <td><a href="#DebugBase.__init__">DebugBase</a></td> |
70 <td>Constructor</td> |
71 <td>Constructor</td> |
71 </tr> |
72 </tr> |
72 <tr> |
73 <tr> |
220 <tr> |
221 <tr> |
221 <td><a href="#DebugBase.user_line">user_line</a></td> |
222 <td><a href="#DebugBase.user_line">user_line</a></td> |
222 <td>Public method reimplemented to handle the program about to execute a particular line.</td> |
223 <td>Public method reimplemented to handle the program about to execute a particular line.</td> |
223 </tr> |
224 </tr> |
224 </table> |
225 </table> |
|
226 |
225 <h3>Static Methods</h3> |
227 <h3>Static Methods</h3> |
226 |
|
227 <table> |
228 <table> |
228 <tr><td>None</td></tr> |
229 <tr><td>None</td></tr> |
229 </table> |
230 </table> |
230 |
231 |
|
232 |
231 <a NAME="DebugBase.__init__" ID="DebugBase.__init__"></a> |
233 <a NAME="DebugBase.__init__" ID="DebugBase.__init__"></a> |
232 <h4>DebugBase (Constructor)</h4> |
234 <h4>DebugBase (Constructor)</h4> |
233 <b>DebugBase</b>(<i>dbgClient</i>) |
235 <b>DebugBase</b>(<i>dbgClient</i>) |
234 |
|
235 <p> |
236 <p> |
236 Constructor |
237 Constructor |
237 </p> |
238 </p> |
|
239 |
238 <dl> |
240 <dl> |
239 |
241 |
240 <dt><i>dbgClient</i> (DebugClient)</dt> |
242 <dt><i>dbgClient</i> (DebugClient)</dt> |
241 <dd> |
243 <dd> |
242 the owning client |
244 the owning client |
243 </dd> |
245 </dd> |
244 </dl> |
246 </dl> |
245 <a NAME="DebugBase.__checkBreakInFrame" ID="DebugBase.__checkBreakInFrame"></a> |
247 <a NAME="DebugBase.__checkBreakInFrame" ID="DebugBase.__checkBreakInFrame"></a> |
246 <h4>DebugBase.__checkBreakInFrame</h4> |
248 <h4>DebugBase.__checkBreakInFrame</h4> |
247 <b>__checkBreakInFrame</b>(<i>frame</i>) |
249 <b>__checkBreakInFrame</b>(<i>frame</i>) |
248 |
|
249 <p> |
250 <p> |
250 Private method to check if the function / method has a line number |
251 Private method to check if the function / method has a line number |
251 which is a breakpoint. |
252 which is a breakpoint. |
252 </p> |
253 </p> |
|
254 |
253 <dl> |
255 <dl> |
254 |
256 |
255 <dt><i>frame</i> (frame object)</dt> |
257 <dt><i>frame</i> (frame object)</dt> |
256 <dd> |
258 <dd> |
257 the frame object |
259 the frame object |
314 </dd> |
316 </dd> |
315 </dl> |
317 </dl> |
316 <a NAME="DebugBase.__do_clearWatch" ID="DebugBase.__do_clearWatch"></a> |
318 <a NAME="DebugBase.__do_clearWatch" ID="DebugBase.__do_clearWatch"></a> |
317 <h4>DebugBase.__do_clearWatch</h4> |
319 <h4>DebugBase.__do_clearWatch</h4> |
318 <b>__do_clearWatch</b>(<i>cond</i>) |
320 <b>__do_clearWatch</b>(<i>cond</i>) |
319 |
|
320 <p> |
321 <p> |
321 Private method called to clear a temporary watch expression. |
322 Private method called to clear a temporary watch expression. |
322 </p> |
323 </p> |
|
324 |
323 <dl> |
325 <dl> |
324 |
326 |
325 <dt><i>cond</i> (str)</dt> |
327 <dt><i>cond</i> (str)</dt> |
326 <dd> |
328 <dd> |
327 expression of the watch expression to be cleared |
329 expression of the watch expression to be cleared |
328 </dd> |
330 </dd> |
329 </dl> |
331 </dl> |
330 <a NAME="DebugBase.__eventPollTimer" ID="DebugBase.__eventPollTimer"></a> |
332 <a NAME="DebugBase.__eventPollTimer" ID="DebugBase.__eventPollTimer"></a> |
331 <h4>DebugBase.__eventPollTimer</h4> |
333 <h4>DebugBase.__eventPollTimer</h4> |
332 <b>__eventPollTimer</b>(<i></i>) |
334 <b>__eventPollTimer</b>(<i></i>) |
333 |
|
334 <p> |
335 <p> |
335 Private method to set a flag every 0.5 s to check for new messages. |
336 Private method to set a flag every 0.5 s to check for new messages. |
336 </p> |
337 </p> |
|
338 |
337 <a NAME="DebugBase.__extractExceptionName" ID="DebugBase.__extractExceptionName"></a> |
339 <a NAME="DebugBase.__extractExceptionName" ID="DebugBase.__extractExceptionName"></a> |
338 <h4>DebugBase.__extractExceptionName</h4> |
340 <h4>DebugBase.__extractExceptionName</h4> |
339 <b>__extractExceptionName</b>(<i>exctype</i>) |
341 <b>__extractExceptionName</b>(<i>exctype</i>) |
340 |
|
341 <p> |
342 <p> |
342 Private method to extract the exception name given the exception |
343 Private method to extract the exception name given the exception |
343 type object. |
344 type object. |
344 </p> |
345 </p> |
|
346 |
345 <dl> |
347 <dl> |
346 |
348 |
347 <dt><i>exctype</i> (type)</dt> |
349 <dt><i>exctype</i> (type)</dt> |
348 <dd> |
350 <dd> |
349 type of the exception |
351 type of the exception |
670 </dd> |
672 </dd> |
671 </dl> |
673 </dl> |
672 <a NAME="DebugBase.go" ID="DebugBase.go"></a> |
674 <a NAME="DebugBase.go" ID="DebugBase.go"></a> |
673 <h4>DebugBase.go</h4> |
675 <h4>DebugBase.go</h4> |
674 <b>go</b>(<i>special</i>) |
676 <b>go</b>(<i>special</i>) |
675 |
|
676 <p> |
677 <p> |
677 Public method to resume the thread. |
678 Public method to resume the thread. |
678 </p> |
679 </p> |
679 <p> |
680 <p> |
680 It resumes the thread stopping only at breakpoints or exceptions. |
681 It resumes the thread stopping only at breakpoints or exceptions. |
681 </p> |
682 </p> |
|
683 |
682 <dl> |
684 <dl> |
683 |
685 |
684 <dt><i>special</i> (bool)</dt> |
686 <dt><i>special</i> (bool)</dt> |
685 <dd> |
687 <dd> |
686 flag indicating a special continue operation |
688 flag indicating a special continue operation |
687 </dd> |
689 </dd> |
688 </dl> |
690 </dl> |
689 <a NAME="DebugBase.move_instruction_pointer" ID="DebugBase.move_instruction_pointer"></a> |
691 <a NAME="DebugBase.move_instruction_pointer" ID="DebugBase.move_instruction_pointer"></a> |
690 <h4>DebugBase.move_instruction_pointer</h4> |
692 <h4>DebugBase.move_instruction_pointer</h4> |
691 <b>move_instruction_pointer</b>(<i>lineno</i>) |
693 <b>move_instruction_pointer</b>(<i>lineno</i>) |
692 |
|
693 <p> |
694 <p> |
694 Public method to move the instruction pointer to another line. |
695 Public method to move the instruction pointer to another line. |
695 </p> |
696 </p> |
|
697 |
696 <dl> |
698 <dl> |
697 |
699 |
698 <dt><i>lineno</i> (int)</dt> |
700 <dt><i>lineno</i> (int)</dt> |
699 <dd> |
701 <dd> |
700 new line number |
702 new line number |
701 </dd> |
703 </dd> |
702 </dl> |
704 </dl> |
703 <a NAME="DebugBase.profile" ID="DebugBase.profile"></a> |
705 <a NAME="DebugBase.profile" ID="DebugBase.profile"></a> |
704 <h4>DebugBase.profile</h4> |
706 <h4>DebugBase.profile</h4> |
705 <b>profile</b>(<i>frame, event, arg</i>) |
707 <b>profile</b>(<i>frame, event, arg</i>) |
706 |
|
707 <p> |
708 <p> |
708 Public method used to trace some stuff independent of the debugger |
709 Public method used to trace some stuff independent of the debugger |
709 trace function. |
710 trace function. |
710 </p> |
711 </p> |
|
712 |
711 <dl> |
713 <dl> |
712 |
714 |
713 <dt><i>frame</i> (frame object)</dt> |
715 <dt><i>frame</i> (frame object)</dt> |
714 <dd> |
716 <dd> |
715 current stack frame |
717 current stack frame |
797 </dd> |
799 </dd> |
798 </dl> |
800 </dl> |
799 <a NAME="DebugBase.setRecursionDepth" ID="DebugBase.setRecursionDepth"></a> |
801 <a NAME="DebugBase.setRecursionDepth" ID="DebugBase.setRecursionDepth"></a> |
800 <h4>DebugBase.setRecursionDepth</h4> |
802 <h4>DebugBase.setRecursionDepth</h4> |
801 <b>setRecursionDepth</b>(<i>frame</i>) |
803 <b>setRecursionDepth</b>(<i>frame</i>) |
802 |
|
803 <p> |
804 <p> |
804 Public method to determine the current recursion depth. |
805 Public method to determine the current recursion depth. |
805 </p> |
806 </p> |
|
807 |
806 <dl> |
808 <dl> |
807 |
809 |
808 <dt><i>frame</i> (frame object)</dt> |
810 <dt><i>frame</i> (frame object)</dt> |
809 <dd> |
811 <dd> |
810 The current stack frame. |
812 The current stack frame. |
811 </dd> |
813 </dd> |
812 </dl> |
814 </dl> |
813 <a NAME="DebugBase.set_continue" ID="DebugBase.set_continue"></a> |
815 <a NAME="DebugBase.set_continue" ID="DebugBase.set_continue"></a> |
814 <h4>DebugBase.set_continue</h4> |
816 <h4>DebugBase.set_continue</h4> |
815 <b>set_continue</b>(<i>special</i>) |
817 <b>set_continue</b>(<i>special</i>) |
816 |
|
817 <p> |
818 <p> |
818 Public method to stop only on next breakpoint. |
819 Public method to stop only on next breakpoint. |
819 </p> |
820 </p> |
|
821 |
820 <dl> |
822 <dl> |
821 |
823 |
822 <dt><i>special</i> (bool)</dt> |
824 <dt><i>special</i> (bool)</dt> |
823 <dd> |
825 <dd> |
824 flag indicating a special continue operation |
826 flag indicating a special continue operation |
825 </dd> |
827 </dd> |
826 </dl> |
828 </dl> |
827 <a NAME="DebugBase.set_next" ID="DebugBase.set_next"></a> |
829 <a NAME="DebugBase.set_next" ID="DebugBase.set_next"></a> |
828 <h4>DebugBase.set_next</h4> |
830 <h4>DebugBase.set_next</h4> |
829 <b>set_next</b>(<i>frame</i>) |
831 <b>set_next</b>(<i>frame</i>) |
830 |
|
831 <p> |
832 <p> |
832 Public method to stop on the next line in or below the given frame. |
833 Public method to stop on the next line in or below the given frame. |
833 </p> |
834 </p> |
|
835 |
834 <dl> |
836 <dl> |
835 |
837 |
836 <dt><i>frame</i> (frame object)</dt> |
838 <dt><i>frame</i> (frame object)</dt> |
837 <dd> |
839 <dd> |
838 the frame object |
840 the frame object |
839 </dd> |
841 </dd> |
840 </dl> |
842 </dl> |
841 <a NAME="DebugBase.set_quit" ID="DebugBase.set_quit"></a> |
843 <a NAME="DebugBase.set_quit" ID="DebugBase.set_quit"></a> |
842 <h4>DebugBase.set_quit</h4> |
844 <h4>DebugBase.set_quit</h4> |
843 <b>set_quit</b>(<i></i>) |
845 <b>set_quit</b>(<i></i>) |
844 |
|
845 <p> |
846 <p> |
846 Public method to quit. |
847 Public method to quit. |
847 </p> |
848 </p> |
848 <p> |
849 <p> |
849 Disables the trace functions and resets all frame pointer. |
850 Disables the trace functions and resets all frame pointer. |
850 </p> |
851 </p> |
|
852 |
851 <a NAME="DebugBase.set_return" ID="DebugBase.set_return"></a> |
853 <a NAME="DebugBase.set_return" ID="DebugBase.set_return"></a> |
852 <h4>DebugBase.set_return</h4> |
854 <h4>DebugBase.set_return</h4> |
853 <b>set_return</b>(<i>frame</i>) |
855 <b>set_return</b>(<i>frame</i>) |
854 |
|
855 <p> |
856 <p> |
856 Public method to stop when returning from the given frame. |
857 Public method to stop when returning from the given frame. |
857 </p> |
858 </p> |
|
859 |
858 <dl> |
860 <dl> |
859 |
861 |
860 <dt><i>frame</i> (frame object)</dt> |
862 <dt><i>frame</i> (frame object)</dt> |
861 <dd> |
863 <dd> |
862 the frame object |
864 the frame object |
863 </dd> |
865 </dd> |
864 </dl> |
866 </dl> |
865 <a NAME="DebugBase.set_step" ID="DebugBase.set_step"></a> |
867 <a NAME="DebugBase.set_step" ID="DebugBase.set_step"></a> |
866 <h4>DebugBase.set_step</h4> |
868 <h4>DebugBase.set_step</h4> |
867 <b>set_step</b>(<i></i>) |
869 <b>set_step</b>(<i></i>) |
868 |
|
869 <p> |
870 <p> |
870 Public method to stop after one line of code. |
871 Public method to stop after one line of code. |
871 </p> |
872 </p> |
|
873 |
872 <a NAME="DebugBase.set_trace" ID="DebugBase.set_trace"></a> |
874 <a NAME="DebugBase.set_trace" ID="DebugBase.set_trace"></a> |
873 <h4>DebugBase.set_trace</h4> |
875 <h4>DebugBase.set_trace</h4> |
874 <b>set_trace</b>(<i>frame=None</i>) |
876 <b>set_trace</b>(<i>frame=None</i>) |
875 |
|
876 <p> |
877 <p> |
877 Public method to start debugging from 'frame'. |
878 Public method to start debugging from 'frame'. |
878 </p> |
879 </p> |
879 <p> |
880 <p> |
880 If frame is not specified, debugging starts from caller's frame. |
881 If frame is not specified, debugging starts from caller's frame. |
881 Because of jump optimizations it's not possible to use sys.breakpoint() |
882 Because of jump optimizations it's not possible to use sys.breakpoint() |
882 as last instruction in a function or method. |
883 as last instruction in a function or method. |
883 </p> |
884 </p> |
|
885 |
884 <dl> |
886 <dl> |
885 |
887 |
886 <dt><i>frame</i> (frame object)</dt> |
888 <dt><i>frame</i> (frame object)</dt> |
887 <dd> |
889 <dd> |
888 frame to start debugging from |
890 frame to start debugging from |
889 </dd> |
891 </dd> |
890 </dl> |
892 </dl> |
891 <a NAME="DebugBase.set_until" ID="DebugBase.set_until"></a> |
893 <a NAME="DebugBase.set_until" ID="DebugBase.set_until"></a> |
892 <h4>DebugBase.set_until</h4> |
894 <h4>DebugBase.set_until</h4> |
893 <b>set_until</b>(<i>frame=None, lineno=None</i>) |
895 <b>set_until</b>(<i>frame=None, lineno=None</i>) |
894 |
|
895 <p> |
896 <p> |
896 Public method to stop when the line with the lineno greater than the |
897 Public method to stop when the line with the lineno greater than the |
897 current one is reached or when returning from current frame. |
898 current one is reached or when returning from current frame. |
898 </p> |
899 </p> |
|
900 |
899 <dl> |
901 <dl> |
900 |
902 |
901 <dt><i>frame</i> (frame object)</dt> |
903 <dt><i>frame</i> (frame object)</dt> |
902 <dd> |
904 <dd> |
903 reference to the frame object |
905 reference to the frame object |
923 </dd> |
925 </dd> |
924 </dl> |
926 </dl> |
925 <a NAME="DebugBase.stepOut" ID="DebugBase.stepOut"></a> |
927 <a NAME="DebugBase.stepOut" ID="DebugBase.stepOut"></a> |
926 <h4>DebugBase.stepOut</h4> |
928 <h4>DebugBase.stepOut</h4> |
927 <b>stepOut</b>(<i></i>) |
929 <b>stepOut</b>(<i></i>) |
928 |
|
929 <p> |
930 <p> |
930 Public method to perform a step out of the current call. |
931 Public method to perform a step out of the current call. |
931 </p> |
932 </p> |
|
933 |
932 <a NAME="DebugBase.stop_here" ID="DebugBase.stop_here"></a> |
934 <a NAME="DebugBase.stop_here" ID="DebugBase.stop_here"></a> |
933 <h4>DebugBase.stop_here</h4> |
935 <h4>DebugBase.stop_here</h4> |
934 <b>stop_here</b>(<i>frame</i>) |
936 <b>stop_here</b>(<i>frame</i>) |
935 |
|
936 <p> |
937 <p> |
937 Public method reimplemented to filter out debugger files. |
938 Public method reimplemented to filter out debugger files. |
938 </p> |
939 </p> |
939 <p> |
940 <p> |
940 Tracing is turned off for files that are part of the |
941 Tracing is turned off for files that are part of the |
941 debugger that are called from the application being debugged. |
942 debugger that are called from the application being debugged. |
942 </p> |
943 </p> |
|
944 |
943 <dl> |
945 <dl> |
944 |
946 |
945 <dt><i>frame</i> (frame object)</dt> |
947 <dt><i>frame</i> (frame object)</dt> |
946 <dd> |
948 <dd> |
947 the frame object |
949 the frame object |
976 </dd> |
978 </dd> |
977 </dl> |
979 </dl> |
978 <a NAME="DebugBase.tracePythonLibs" ID="DebugBase.tracePythonLibs"></a> |
980 <a NAME="DebugBase.tracePythonLibs" ID="DebugBase.tracePythonLibs"></a> |
979 <h4>DebugBase.tracePythonLibs</h4> |
981 <h4>DebugBase.tracePythonLibs</h4> |
980 <b>tracePythonLibs</b>(<i>enable</i>) |
982 <b>tracePythonLibs</b>(<i>enable</i>) |
981 |
|
982 <p> |
983 <p> |
983 Public method to update the settings to trace into Python libraries. |
984 Public method to update the settings to trace into Python libraries. |
984 </p> |
985 </p> |
|
986 |
985 <dl> |
987 <dl> |
986 |
988 |
987 <dt><i>enable</i> (bool)</dt> |
989 <dt><i>enable</i> (bool)</dt> |
988 <dd> |
990 <dd> |
989 flag to debug into Python libraries |
991 flag to debug into Python libraries |
990 </dd> |
992 </dd> |
991 </dl> |
993 </dl> |
992 <a NAME="DebugBase.trace_dispatch" ID="DebugBase.trace_dispatch"></a> |
994 <a NAME="DebugBase.trace_dispatch" ID="DebugBase.trace_dispatch"></a> |
993 <h4>DebugBase.trace_dispatch</h4> |
995 <h4>DebugBase.trace_dispatch</h4> |
994 <b>trace_dispatch</b>(<i>frame, event, arg</i>) |
996 <b>trace_dispatch</b>(<i>frame, event, arg</i>) |
995 |
|
996 <p> |
997 <p> |
997 Public method reimplemented from bdb.py to do some special things. |
998 Public method reimplemented from bdb.py to do some special things. |
998 </p> |
999 </p> |
999 <p> |
1000 <p> |
1000 This specialty is to check the connection to the debug server |
1001 This specialty is to check the connection to the debug server |
1001 for new events (i.e. new breakpoints) while we are going through |
1002 for new events (i.e. new breakpoints) while we are going through |
1002 the code. |
1003 the code. |
1003 </p> |
1004 </p> |
|
1005 |
1004 <dl> |
1006 <dl> |
1005 |
1007 |
1006 <dt><i>frame</i> (frame object)</dt> |
1008 <dt><i>frame</i> (frame object)</dt> |
1007 <dd> |
1009 <dd> |
1008 The current stack frame |
1010 The current stack frame |