aboutsummaryrefslogtreecommitdiffstats
path: root/lispref/edebug.texi
diff options
context:
space:
mode:
authorKaroly Lorentey2005-06-15 12:57:51 +0000
committerKaroly Lorentey2005-06-15 12:57:51 +0000
commitef85512e51f043d73788f00a2aed13cccde0682c (patch)
treefc1fa1378533250f260ef8eaa9a84ae882d9df84 /lispref/edebug.texi
parent8736257554f49445f7b4402ac7a9436b38ce6452 (diff)
parentef88a9999004e6c26148c8d280d6a41f623d7249 (diff)
downloademacs-ef85512e51f043d73788f00a2aed13cccde0682c.tar.gz
emacs-ef85512e51f043d73788f00a2aed13cccde0682c.zip
Merged from miles@gnu.org--gnu-2005 (patch 80-82, 350-422)
Patches applied: * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-350 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-351 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-352 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-353 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-354 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-355 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-356 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-357 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-358 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-359 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-360 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-361 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-362 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-363 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-364 Remove "-face" suffix from widget faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365 Remove "-face" suffix from custom faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-366 Remove "-face" suffix from change-log faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-367 Remove "-face" suffix from compilation faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-368 Remove "-face" suffix from diff-mode faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-369 lisp/longlines.el (longlines-visible-face): Face removed * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-370 Remove "-face" suffix from woman faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-371 Remove "-face" suffix from whitespace-highlight face * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-372 Remove "-face" suffix from ruler-mode faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-373 Remove "-face" suffix from show-paren faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-374 Remove "-face" suffix from log-view faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-375 Remove "-face" suffix from smerge faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-376 Remove "-face" suffix from show-tabs faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-377 Remove "-face" suffix from highlight-changes faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-378 Remove "-face" suffix from and downcase info faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-379 Remove "-face" suffix from pcvs faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-380 Update uses of renamed pcvs faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-381 Tweak ChangeLog * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-382 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-383 Remove "-face" suffix from strokes-char face * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-384 Remove "-face" suffix from compare-windows face * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-385 Remove "-face" suffix from calendar faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-386 Remove "-face" suffix from diary-button face * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-387 Remove "-face" suffix from testcover faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-388 Remove "-face" suffix from viper faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-389 Remove "-face" suffix from org faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-390 Remove "-face" suffix from sgml-namespace face * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-391 Remove "-face" suffix from table-cell face * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-392 Remove "-face" suffix from tex-mode faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-393 Remove "-face" suffix from texinfo-heading face * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-394 Remove "-face" suffix from flyspell faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-395 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-396 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-397 Remove "-face" suffix from gomoku faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-398 Remove "-face" suffix from mpuz faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-399 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-400 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-401 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-402 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-403 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-404 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-405 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-406 Merge from gnus--rel--5.10 * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-407 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-408 Remove "-face" suffix from Buffer-menu-buffer face * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-409 Remove "-face" suffix from antlr-mode faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-410 Remove "-face" suffix from ebrowse faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-411 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-412 Remove "-face" suffix from flymake faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-413 Remove "-face" suffix from idlwave faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-414 Remove "-face" suffix from sh-script faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-415 Remove "-face" suffix from vhdl-mode faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-416 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-417 Remove "-face" suffix from which-func face * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-418 Remove "-face" suffix from cperl-mode faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-419 Remove "-face" suffix from ld-script faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-420 Fix cperl-mode font-lock problem * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-421 Tweak which-func face * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-422 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-80 Merge from emacs--cvs-trunk--0 * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-81 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-82 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-350
Diffstat (limited to 'lispref/edebug.texi')
-rw-r--r--lispref/edebug.texi99
1 files changed, 61 insertions, 38 deletions
diff --git a/lispref/edebug.texi b/lispref/edebug.texi
index cc42926ecf7..981afbb894c 100644
--- a/lispref/edebug.texi
+++ b/lispref/edebug.texi
@@ -65,7 +65,7 @@ enable you to use it.
65* Modes: Edebug Execution Modes. Execution modes, stopping more or less often. 65* Modes: Edebug Execution Modes. Execution modes, stopping more or less often.
66* Jumping:: Commands to jump to a specified place. 66* Jumping:: Commands to jump to a specified place.
67* Misc: Edebug Misc. Miscellaneous commands. 67* Misc: Edebug Misc. Miscellaneous commands.
68* Breakpoints:: Setting breakpoints to make the program stop. 68* Breaks:: Setting breakpoints to make the program stop.
69* Trapping Errors:: Trapping errors with Edebug. 69* Trapping Errors:: Trapping errors with Edebug.
70* Views: Edebug Views. Views inside and outside of Edebug. 70* Views: Edebug Views. Views inside and outside of Edebug.
71* Eval: Edebug Eval. Evaluating expressions within Edebug. 71* Eval: Edebug Eval. Evaluating expressions within Edebug.
@@ -75,7 +75,7 @@ enable you to use it.
75* Trace Buffer:: How to produce trace output in a buffer. 75* Trace Buffer:: How to produce trace output in a buffer.
76* Coverage Testing:: How to test evaluation coverage. 76* Coverage Testing:: How to test evaluation coverage.
77* The Outside Context:: Data that Edebug saves and restores. 77* The Outside Context:: Data that Edebug saves and restores.
78* Instrumenting Macro Calls:: Specifying how to handle macro calls. 78* Edebug and Macros:: Specifying how to handle macro calls.
79* Options: Edebug Options. Option variables for customizing Edebug. 79* Options: Edebug Options. Option variables for customizing Edebug.
80@end menu 80@end menu
81 81
@@ -203,13 +203,13 @@ function.
203@code{interactive} forms with an expression argument, anonymous lambda 203@code{interactive} forms with an expression argument, anonymous lambda
204expressions, and other defining forms. However, Edebug cannot determine 204expressions, and other defining forms. However, Edebug cannot determine
205on its own what a user-defined macro will do with the arguments of a 205on its own what a user-defined macro will do with the arguments of a
206macro call, so you must provide that information; see @ref{Instrumenting 206macro call, so you must provide that information; see @ref{Edebug and
207Macro Calls}, for details. 207Macros}, for details.
208 208
209 When Edebug is about to instrument code for the first time in a 209 When Edebug is about to instrument code for the first time in a
210session, it runs the hook @code{edebug-setup-hook}, then sets it to 210session, it runs the hook @code{edebug-setup-hook}, then sets it to
211@code{nil}. You can use this to load Edebug specifications 211@code{nil}. You can use this to load Edebug specifications
212(@pxref{Instrumenting Macro Calls}) associated with a package you are 212(@pxref{Edebug and Macros}) associated with a package you are
213using, but only when you use Edebug. 213using, but only when you use Edebug.
214 214
215@findex eval-expression @r{(Edebug)} 215@findex eval-expression @r{(Edebug)}
@@ -253,7 +253,7 @@ Step: stop at the next stop point encountered (@code{edebug-step-mode}).
253@item n 253@item n
254Next: stop at the next stop point encountered after an expression 254Next: stop at the next stop point encountered after an expression
255(@code{edebug-next-mode}). Also see @code{edebug-forward-sexp} in 255(@code{edebug-next-mode}). Also see @code{edebug-forward-sexp} in
256@ref{Edebug Misc}. 256@ref{Jumping}.
257 257
258@item t 258@item t
259Trace: pause (normally one second) at each Edebug stop point 259Trace: pause (normally one second) at each Edebug stop point
@@ -341,9 +341,8 @@ Run the program until the end of the containing sexp.
341Step into the function or macro called by the form after point. 341Step into the function or macro called by the form after point.
342@end table 342@end table
343 343
344The @kbd{h} command proceeds to the stop point near the current location 344The @kbd{h} command proceeds to the stop point at or after the current
345of point, using a temporary breakpoint. See @ref{Breakpoints}, for more 345location of point, using a temporary breakpoint.
346information about breakpoints.
347 346
348The @kbd{f} command runs the program forward over one expression. More 347The @kbd{f} command runs the program forward over one expression. More
349precisely, it sets a temporary breakpoint at the position that 348precisely, it sets a temporary breakpoint at the position that
@@ -427,14 +426,23 @@ recursively. Whenever Edebug is active, you can quit to the top level
427with @kbd{q} or abort one recursive edit level with @kbd{C-]}. You can 426with @kbd{q} or abort one recursive edit level with @kbd{C-]}. You can
428display a backtrace of all the pending evaluations with @kbd{d}. 427display a backtrace of all the pending evaluations with @kbd{d}.
429 428
430@node Breakpoints 429@node Breaks
431@subsection Breakpoints 430@subsection Breaks
432 431
433@cindex breakpoints
434Edebug's step mode stops execution when the next stop point is reached. 432Edebug's step mode stops execution when the next stop point is reached.
435There are three other ways to stop Edebug execution once it has started: 433There are three other ways to stop Edebug execution once it has started:
436breakpoints, the global break condition, and source breakpoints. 434breakpoints, the global break condition, and source breakpoints.
437 435
436@menu
437* Breakpoints:: Breakpoints at stop points.
438* Global Break Condition:: Breaking on an event.
439* Source Breakpoints:: Embedding breakpoints in source code.
440@end menu
441
442@node Breakpoints
443@subsubsection Breakpoints
444
445@cindex breakpoints
438While using Edebug, you can specify @dfn{breakpoints} in the program you 446While using Edebug, you can specify @dfn{breakpoints} in the program you
439are testing: these are places where execution should stop. You can set a 447are testing: these are places where execution should stop. You can set a
440breakpoint at any stop point, as defined in @ref{Using Edebug}. For 448breakpoint at any stop point, as defined in @ref{Using Edebug}. For
@@ -494,12 +502,6 @@ function, or to the first breakpoint if there are no following
494breakpoints. This command does not continue execution---it just moves 502breakpoints. This command does not continue execution---it just moves
495point in the buffer. 503point in the buffer.
496 504
497@menu
498* Global Break Condition:: Breaking on an event.
499* Source Breakpoints:: Embedding breakpoints in source code.
500@end menu
501
502
503@node Global Break Condition 505@node Global Break Condition
504@subsubsection Global Break Condition 506@subsubsection Global Break Condition
505 507
@@ -515,7 +517,9 @@ evaluating the condition gets an error, execution does not stop.
515@findex edebug-set-global-break-condition 517@findex edebug-set-global-break-condition
516 The condition expression is stored in 518 The condition expression is stored in
517@code{edebug-global-break-condition}. You can specify a new expression 519@code{edebug-global-break-condition}. You can specify a new expression
518using the @kbd{X} command (@code{edebug-set-global-break-condition}). 520using the @kbd{X} command from the source code buffer while Edebug is
521active, or using @kbd{C-x X X} from any buffer at any time, as long as
522Edebug is loaded (@code{edebug-set-global-break-condition}).
519 523
520 The global break condition is the simplest way to find where in your 524 The global break condition is the simplest way to find where in your
521code some event occurs, but it makes code run much more slowly. So you 525code some event occurs, but it makes code run much more slowly. So you
@@ -582,13 +586,14 @@ effect outside of Edebug.
582 586
583@table @kbd 587@table @kbd
584@item v 588@item v
585Temporarily view the outside window configuration 589View the outside window configuration (@code{edebug-view-outside}).
586(@code{edebug-view-outside}). 590Type @kbd{C-x X w} to return to Edebug.
587 591
588@item p 592@item p
589Temporarily display the outside current buffer with point at its outside 593Temporarily display the outside current buffer with point at its
590position (@code{edebug-bounce-point}). With a prefix argument @var{n}, 594outside position (@code{edebug-bounce-point}), pausing for one second
591pause for @var{n} seconds instead. 595before returning to Edebug. With a prefix argument @var{n}, pause for
596@var{n} seconds instead.
592 597
593@item w 598@item w
594Move point back to the current stop point in the source code buffer 599Move point back to the current stop point in the source code buffer
@@ -610,8 +615,12 @@ source code buffer, you must use @kbd{C-x X W} from the global keymap.
610 615
611 You can view the outside window configuration with @kbd{v} or just 616 You can view the outside window configuration with @kbd{v} or just
612bounce to the point in the current buffer with @kbd{p}, even if 617bounce to the point in the current buffer with @kbd{p}, even if
613it is not normally displayed. After moving point, you may wish to jump 618it is not normally displayed.
614back to the stop point with @kbd{w} from a source code buffer. 619
620 After moving point, you may wish to jump back to the stop point.
621You can do that with @kbd{w} from a source code buffer. You can jump
622back to the stop point in the source code buffer from any buffer using
623@kbd{C-x X w}.
615 624
616 Each time you use @kbd{W} to turn saving @emph{off}, Edebug forgets the 625 Each time you use @kbd{W} to turn saving @emph{off}, Edebug forgets the
617saved outside window configuration---so that even if you turn saving 626saved outside window configuration---so that even if you turn saving
@@ -838,8 +847,9 @@ redefining the functions @code{edebug-print-trace-before} and
838@defmac edebug-tracing string body@dots{} 847@defmac edebug-tracing string body@dots{}
839This macro requests additional trace information around the execution 848This macro requests additional trace information around the execution
840of the @var{body} forms. The argument @var{string} specifies text 849of the @var{body} forms. The argument @var{string} specifies text
841to put in the trace buffer. All the arguments are evaluated, and 850to put in the trace buffer, after the @samp{@{} or @samp{@}}. All
842@code{edebug-tracing} returns the value of the last form in @var{body}. 851the arguments are evaluated, and @code{edebug-tracing} returns the
852value of the last form in @var{body}.
843@end defmac 853@end defmac
844 854
845@defun edebug-trace format-string &rest format-args 855@defun edebug-trace format-string &rest format-args
@@ -990,7 +1000,7 @@ current buffer, are saved and restored.
990@item 1000@item
991@cindex window configuration (Edebug) 1001@cindex window configuration (Edebug)
992The outside window configuration is saved and restored if 1002The outside window configuration is saved and restored if
993@code{edebug-save-windows} is non-@code{nil} (@pxref{Edebug Display Update}). 1003@code{edebug-save-windows} is non-@code{nil} (@pxref{Edebug Options}).
994 1004
995The window configuration is not restored on error or quit, but the 1005The window configuration is not restored on error or quit, but the
996outside selected window @emph{is} reselected even on error or quit in 1006outside selected window @emph{is} reselected even on error or quit in
@@ -1061,8 +1071,21 @@ Edebug is active, @code{defining-kbd-macro} is bound to
1061@code{edebug-continue-kbd-macro}. 1071@code{edebug-continue-kbd-macro}.
1062@end itemize 1072@end itemize
1063 1073
1074@node Edebug and Macros
1075@subsection Edebug and Macros
1076
1077To make Edebug properly instrument expressions that call macros, some
1078extra care is needed. This subsection explains the details.
1079
1080@menu
1081* Instrumenting Macro Calls:: The basic problem.
1082* Specification List:: How to specify complex patterns of evaluation.
1083* Backtracking:: What Edebug does when matching fails.
1084* Specification Examples:: To help understand specifications.
1085@end menu
1086
1064@node Instrumenting Macro Calls 1087@node Instrumenting Macro Calls
1065@subsection Instrumenting Macro Calls 1088@subsubsection Instrumenting Macro Calls
1066 1089
1067 When Edebug instruments an expression that calls a Lisp macro, it needs 1090 When Edebug instruments an expression that calls a Lisp macro, it needs
1068additional information about the macro to do the job properly. This is 1091additional information about the macro to do the job properly. This is
@@ -1101,7 +1124,7 @@ define Edebug specifications for special forms implemented in C.
1101@deffn Macro def-edebug-spec macro specification 1124@deffn Macro def-edebug-spec macro specification
1102Specify which expressions of a call to macro @var{macro} are forms to be 1125Specify which expressions of a call to macro @var{macro} are forms to be
1103evaluated. @var{specification} should be the edebug specification. 1126evaluated. @var{specification} should be the edebug specification.
1104It is not evaluated. 1127Neither argument is evaluated.
1105 1128
1106The @var{macro} argument can actually be any symbol, not just a macro 1129The @var{macro} argument can actually be any symbol, not just a macro
1107name. 1130name.
@@ -1128,12 +1151,12 @@ calling form. The possible elements of a specification list are
1128described in the following sections. 1151described in the following sections.
1129@end table 1152@end table
1130 1153
1131@menu 1154@vindex edebug-eval-macro-args
1132* Specification List:: How to specify complex patterns of evaluation. 1155If a macro has no Edebug specification, neither through a @code{debug}
1133* Backtracking:: What Edebug does when matching fails. 1156declaration nor through a @code{def-edebug-spec} call, the variable
1134* Specification Examples:: To help understand specifications. 1157@code{edebug-eval-macro-args} comes into play. If it is @code{nil},
1135@end menu 1158the default, none of the arguments is instrumented for evaluation.
1136 1159If it is non-@code{nil}, all arguments are instrumented.
1137 1160
1138@node Specification List 1161@node Specification List
1139@subsubsection Specification List 1162@subsubsection Specification List
@@ -1406,7 +1429,7 @@ inside of the sublist to prevent backtracking once a sublist is found.
1406Edebug uses the following specifications for @code{defun} and 1429Edebug uses the following specifications for @code{defun} and
1407@code{defmacro} and the associated argument list and @code{interactive} 1430@code{defmacro} and the associated argument list and @code{interactive}
1408specifications. It is necessary to handle interactive forms specially 1431specifications. It is necessary to handle interactive forms specially
1409since an expression argument it is actually evaluated outside of the 1432since an expression argument is actually evaluated outside of the
1410function body. 1433function body.
1411 1434
1412@smallexample 1435@smallexample