1 |
@comment -*-texinfo-*- |
@comment -*-texinfo-*- |
2 |
@c This is part of the GNU Emacs Lisp Reference Manual. |
@c This is part of the GNU Emacs Lisp Reference Manual. |
3 |
@c Copyright (C) 1992, 1993, 1994, 1998, 1999 Free Software Foundation, Inc. |
@c Copyright (C) 1992, 1993, 1994, 1998, 1999 Free Software Foundation, Inc. |
4 |
@c See the file elisp.texi for copying conditions. |
@c See the file elisp.texi for copying conditions. |
5 |
|
|
6 |
@c This file can also be used by an independent Edebug User |
@c This file can also be used by an independent Edebug User |
7 |
@c Manual in which case the Edebug node below should be used |
@c Manual in which case the Edebug node below should be used |
8 |
@c with the following links to the Bugs section and to the top level: |
@c with the following links to the Bugs section and to the top level: |
9 |
|
|
10 |
@c , Bugs and Todo List, Top, Top |
@c , Bugs and Todo List, Top, Top |
35 |
Display expression results and evaluate expressions as if outside of |
Display expression results and evaluate expressions as if outside of |
36 |
Edebug. |
Edebug. |
37 |
|
|
38 |
@item |
@item |
39 |
Automatically re-evaluate a list of expressions and |
Automatically re-evaluate a list of expressions and |
40 |
display their results each time Edebug updates the display. |
display their results each time Edebug updates the display. |
41 |
|
|
117 |
@cindex stop points |
@cindex stop points |
118 |
The places within a function where Edebug can stop execution are called |
The places within a function where Edebug can stop execution are called |
119 |
@dfn{stop points}. These occur both before and after each subexpression |
@dfn{stop points}. These occur both before and after each subexpression |
120 |
that is a list, and also after each variable reference. |
that is a list, and also after each variable reference. |
121 |
Here we use periods to show the stop points in the function |
Here we use periods to show the stop points in the function |
122 |
@code{fac}: |
@code{fac}: |
123 |
|
|
142 |
@end example |
@end example |
143 |
|
|
144 |
When Edebug stops execution after an expression, it displays the |
When Edebug stops execution after an expression, it displays the |
145 |
expression's value in the echo area. |
expression's value in the echo area. |
146 |
|
|
147 |
Other frequently used commands are @kbd{b} to set a breakpoint at a stop |
Other frequently used commands are @kbd{b} to set a breakpoint at a stop |
148 |
point, @kbd{g} to execute until a breakpoint is reached, and @kbd{q} to |
point, @kbd{g} to execute until a breakpoint is reached, and @kbd{q} to |
445 |
program. |
program. |
446 |
|
|
447 |
@item u |
@item u |
448 |
Unset the breakpoint (if any) at the stop point at or after |
Unset the breakpoint (if any) at the stop point at or after |
449 |
point (@code{edebug-unset-breakpoint}). |
point (@code{edebug-unset-breakpoint}). |
450 |
|
|
451 |
@item x @var{condition} @key{RET} |
@item x @var{condition} @key{RET} |
490 |
point in the buffer. |
point in the buffer. |
491 |
|
|
492 |
@menu |
@menu |
493 |
* Global Break Condition:: Breaking on an event. |
* Global Break Condition:: Breaking on an event. |
494 |
* Source Breakpoints:: Embedding breakpoints in source code. |
* Source Breakpoints:: Embedding breakpoints in source code. |
495 |
@end menu |
@end menu |
496 |
|
|
692 |
|
|
693 |
The expressions you enter interactively (and their results) are lost |
The expressions you enter interactively (and their results) are lost |
694 |
when you continue execution; but you can set up an @dfn{evaluation list} |
when you continue execution; but you can set up an @dfn{evaluation list} |
695 |
consisting of expressions to be evaluated each time execution stops. |
consisting of expressions to be evaluated each time execution stops. |
696 |
|
|
697 |
@cindex evaluation list group |
@cindex evaluation list group |
698 |
To do this, write one or more @dfn{evaluation list groups} in the |
To do this, write one or more @dfn{evaluation list groups} in the |
771 |
printing results. The default value is @code{50}. |
printing results. The default value is @code{50}. |
772 |
@end defopt |
@end defopt |
773 |
|
|
774 |
@defopt edebug-print-level |
@defopt edebug-print-level |
775 |
If non-@code{nil}, Edebug binds @code{print-level} to this value while |
If non-@code{nil}, Edebug binds @code{print-level} to this value while |
776 |
printing results. The default value is @code{50}. |
printing results. The default value is @code{50}. |
777 |
@end defopt |
@end defopt |
794 |
structure. This notation is used for any shared elements of lists or |
structure. This notation is used for any shared elements of lists or |
795 |
vectors. |
vectors. |
796 |
|
|
797 |
@defopt edebug-print-circle |
@defopt edebug-print-circle |
798 |
If non-@code{nil}, Edebug binds @code{print-circle} to this value while |
If non-@code{nil}, Edebug binds @code{print-circle} to this value while |
799 |
printing results. The default value is @code{nil}. |
printing results. The default value is @code{nil}. |
800 |
@end defopt |
@end defopt |
900 |
@example |
@example |
901 |
(defun fac (n) |
(defun fac (n) |
902 |
(if (= n 0) (edebug)) |
(if (= n 0) (edebug)) |
903 |
;#6 1 0 =5 |
;#6 1 0 =5 |
904 |
(if (< 0 n) |
(if (< 0 n) |
905 |
;#5 = |
;#5 = |
906 |
(* n (fac (1- n))) |
(* n (fac (1- n))) |
907 |
;# 5 0 |
;# 5 0 |
908 |
1)) |
1)) |
909 |
;# 0 |
;# 0 |
910 |
@end example |
@end example |
911 |
|
|
912 |
The comment lines show that @code{fac} was called 6 times. The |
The comment lines show that @code{fac} was called 6 times. The |
939 |
program. |
program. |
940 |
|
|
941 |
@itemize @bullet |
@itemize @bullet |
942 |
@item |
@item |
943 |
@code{max-lisp-eval-depth} and @code{max-specpdl-size} are both |
@code{max-lisp-eval-depth} and @code{max-specpdl-size} are both |
944 |
incremented once to reduce Edebug's impact on the stack. You could, |
incremented once to reduce Edebug's impact on the stack. You could, |
945 |
however, still run out of stack space when using Edebug. |
however, still run out of stack space when using Edebug. |
946 |
|
|
947 |
@item |
@item |
948 |
The state of keyboard macro execution is saved and restored. While |
The state of keyboard macro execution is saved and restored. While |
949 |
Edebug is active, @code{executing-macro} is bound to |
Edebug is active, @code{executing-macro} is bound to |
950 |
@code{edebug-continue-kbd-macro}. |
@code{edebug-continue-kbd-macro}. |
958 |
@c This paragraph is not filled, because LaLiberte's conversion script |
@c This paragraph is not filled, because LaLiberte's conversion script |
959 |
@c needs an xref to be on just one line. |
@c needs an xref to be on just one line. |
960 |
When Edebug needs to display something (e.g., in trace mode), it saves |
When Edebug needs to display something (e.g., in trace mode), it saves |
961 |
the current window configuration from ``outside'' Edebug |
the current window configuration from ``outside'' Edebug |
962 |
(@pxref{Window Configurations}). When you exit Edebug (by continuing |
(@pxref{Window Configurations}). When you exit Edebug (by continuing |
963 |
the program), it restores the previous window configuration. |
the program), it restores the previous window configuration. |
964 |
|
|
974 |
error or quit signal occurs). |
error or quit signal occurs). |
975 |
|
|
976 |
@itemize @bullet |
@itemize @bullet |
977 |
@item |
@item |
978 |
@cindex current buffer point and mark (Edebug) |
@cindex current buffer point and mark (Edebug) |
979 |
Which buffer is current, and the positions of point and the mark in the |
Which buffer is current, and the positions of point and the mark in the |
980 |
current buffer, are saved and restored. |
current buffer, are saved and restored. |
981 |
|
|
982 |
@item |
@item |
983 |
@cindex window configuration (Edebug) |
@cindex window configuration (Edebug) |
984 |
The outside window configuration is saved and restored if |
The outside window configuration is saved and restored if |
985 |
@code{edebug-save-windows} is non-@code{nil} (@pxref{Edebug Display Update}). |
@code{edebug-save-windows} is non-@code{nil} (@pxref{Edebug Display Update}). |
1002 |
@code{overlay-arrow-string} are saved and restored. So you can safely |
@code{overlay-arrow-string} are saved and restored. So you can safely |
1003 |
invoke Edebug from the recursive edit elsewhere in the same buffer. |
invoke Edebug from the recursive edit elsewhere in the same buffer. |
1004 |
|
|
1005 |
@item |
@item |
1006 |
@code{cursor-in-echo-area} is locally bound to @code{nil} so that |
@code{cursor-in-echo-area} is locally bound to @code{nil} so that |
1007 |
the cursor shows up in the window. |
the cursor shows up in the window. |
1008 |
@end itemize |
@end itemize |
1047 |
by the @code{recursive-edit}, but Edebug temporarily restores them during |
by the @code{recursive-edit}, but Edebug temporarily restores them during |
1048 |
evaluations. |
evaluations. |
1049 |
|
|
1050 |
@item |
@item |
1051 |
The state of keyboard macro definition is saved and restored. While |
The state of keyboard macro definition is saved and restored. While |
1052 |
Edebug is active, @code{defining-kbd-macro} is bound to |
Edebug is active, @code{defining-kbd-macro} is bound to |
1053 |
@code{edebug-continue-kbd-macro}. |
@code{edebug-continue-kbd-macro}. |
1187 |
@item &optional |
@item &optional |
1188 |
@kindex &optional @r{(Edebug)} |
@kindex &optional @r{(Edebug)} |
1189 |
All following elements in the specification list are optional; as soon |
All following elements in the specification list are optional; as soon |
1190 |
as one does not match, Edebug stops matching at this level. |
as one does not match, Edebug stops matching at this level. |
1191 |
|
|
1192 |
To make just a few elements optional followed by non-optional elements, |
To make just a few elements optional followed by non-optional elements, |
1193 |
use @code{[&optional @var{specs}@dots{}]}. To specify that several |
use @code{[&optional @var{specs}@dots{}]}. To specify that several |
1222 |
of them match, nothing is matched, but the @code{¬} specification |
of them match, nothing is matched, but the @code{¬} specification |
1223 |
succeeds. |
succeeds. |
1224 |
|
|
1225 |
@item &define |
@item &define |
1226 |
@kindex &define @r{(Edebug)} |
@kindex &define @r{(Edebug)} |
1227 |
Indicates that the specification is for a defining form. The defining |
Indicates that the specification is for a defining form. The defining |
1228 |
form itself is not instrumented (that is, Edebug does not stop before and |
form itself is not instrumented (that is, Edebug does not stop before and |
1302 |
|
|
1303 |
@table @code |
@table @code |
1304 |
@item name |
@item name |
1305 |
The argument, a symbol, is the name of the defining form. |
The argument, a symbol, is the name of the defining form. |
1306 |
|
|
1307 |
A defining form is not required to have a name field; and it may have |
A defining form is not required to have a name field; and it may have |
1308 |
multiple name fields. |
multiple name fields. |
1349 |
exhausted. Eventually every element of the argument list must be |
exhausted. Eventually every element of the argument list must be |
1350 |
matched by some element in the specification, and every required element |
matched by some element in the specification, and every required element |
1351 |
in the specification must match some argument. |
in the specification must match some argument. |
1352 |
|
|
1353 |
When a syntax error is detected, it might not be reported until much |
When a syntax error is detected, it might not be reported until much |
1354 |
later after higher-level alternatives have been exhausted, and with the |
later after higher-level alternatives have been exhausted, and with the |
1355 |
point positioned further from the real error. But if backtracking is |
point positioned further from the real error. But if backtracking is |
1405 |
|
|
1406 |
@smallexample |
@smallexample |
1407 |
(def-edebug-spec defmacro defun) ; @r{Indirect ref to @code{defun} spec.} |
(def-edebug-spec defmacro defun) ; @r{Indirect ref to @code{defun} spec.} |
1408 |
(def-edebug-spec defun |
(def-edebug-spec defun |
1409 |
(&define name lambda-list |
(&define name lambda-list |
1410 |
[&optional stringp] ; @r{Match the doc string, if present.} |
[&optional stringp] ; @r{Match the doc string, if present.} |
1411 |
[&optional ("interactive" interactive)] |
[&optional ("interactive" interactive)] |
1412 |
def-body)) |
def-body)) |
1479 |
variable to @code{nil}. |
variable to @code{nil}. |
1480 |
|
|
1481 |
If the value is a list, only the listed windows are saved and |
If the value is a list, only the listed windows are saved and |
1482 |
restored. |
restored. |
1483 |
|
|
1484 |
You can use the @kbd{W} command in Edebug to change this variable |
You can use the @kbd{W} command in Edebug to change this variable |
1485 |
interactively. @xref{Edebug Display Update}. |
interactively. @xref{Edebug Display Update}. |
1505 |
@code{step}, @code{next}, @code{go}, @code{Go-nonstop}, @code{trace}, |
@code{step}, @code{next}, @code{go}, @code{Go-nonstop}, @code{trace}, |
1506 |
@code{Trace-fast}, @code{continue}, and @code{Continue-fast}. |
@code{Trace-fast}, @code{continue}, and @code{Continue-fast}. |
1507 |
|
|
1508 |
The default value is @code{step}. |
The default value is @code{step}. |
1509 |
@xref{Edebug Execution Modes}. |
@xref{Edebug Execution Modes}. |
1510 |
@end defopt |
@end defopt |
1511 |
|
|
1512 |
@defopt edebug-trace |
@defopt edebug-trace |
1513 |
Non-@code{nil} means display a trace of function entry and exit. |
Non-@code{nil} means display a trace of function entry and exit. |
1514 |
Tracing output is displayed in a buffer named @samp{*edebug-trace*}, one |
Tracing output is displayed in a buffer named @samp{*edebug-trace*}, one |
1515 |
function entry or exit per line, indented by the recursion level. |
function entry or exit per line, indented by the recursion level. |
1516 |
|
|
1517 |
The default value is @code{nil}. |
The default value is @code{nil}. |
1518 |
|
|
1519 |
Also see @code{edebug-tracing}, in @ref{Trace Buffer}. |
Also see @code{edebug-tracing}, in @ref{Trace Buffer}. |
1520 |
@end defopt |
@end defopt |
1521 |
|
|
1522 |
@defopt edebug-test-coverage |
@defopt edebug-test-coverage |
1523 |
If non-@code{nil}, Edebug tests coverage of all expressions debugged. |
If non-@code{nil}, Edebug tests coverage of all expressions debugged. |
1524 |
@xref{Coverage Testing}. |
@xref{Coverage Testing}. |
1525 |
@end defopt |
@end defopt |
1526 |
|
|
1527 |
@defopt edebug-continue-kbd-macro |
@defopt edebug-continue-kbd-macro |
1528 |
If non-@code{nil}, continue defining or executing any keyboard macro |
If non-@code{nil}, continue defining or executing any keyboard macro |
1529 |
that is executing outside of Edebug. Use this with caution since it is not |
that is executing outside of Edebug. Use this with caution since it is not |
1530 |
debugged. |
debugged. |