comparison man/lispref/debugging.texi @ 5791:9fae6227ede5

Silence texinfo 5.2 warnings, primarily by adding next, prev, and up pointers to all nodes. See xemacs-patches message with ID <5315f7bf.sHpFD7lXYR05GH6E%james@xemacs.org>.
author Jerry James <james@xemacs.org>
date Thu, 27 Mar 2014 08:59:03 -0600
parents 755ae5b97edb
children
comparison
equal deleted inserted replaced
5790:dcf9067f26bb 5791:9fae6227ede5
37 @xref{Terminal Input}. 37 @xref{Terminal Input}.
38 38
39 For debugging problems in terminal descriptions, the 39 For debugging problems in terminal descriptions, the
40 @code{open-termscript} function can be useful. @xref{Terminal Output}. 40 @code{open-termscript} function can be useful. @xref{Terminal Output}.
41 41
42 @node Debugger 42 @node Debugger, Syntax Errors, Debugging, Debugging
43 @section The Lisp Debugger 43 @section The Lisp Debugger
44 @cindex debugger 44 @cindex debugger
45 @cindex Lisp debugger 45 @cindex Lisp debugger
46 @cindex break 46 @cindex break
47 47
62 * Debugger Commands:: Commands used while in the debugger. 62 * Debugger Commands:: Commands used while in the debugger.
63 * Invoking the Debugger:: How to call the function @code{debug}. 63 * Invoking the Debugger:: How to call the function @code{debug}.
64 * Internals of Debugger:: Subroutines of the debugger, and global variables. 64 * Internals of Debugger:: Subroutines of the debugger, and global variables.
65 @end menu 65 @end menu
66 66
67 @node Error Debugging 67 @node Error Debugging, Infinite Loops, Debugger, Debugger
68 @subsection Entering the Debugger on an Error 68 @subsection Entering the Debugger on an Error
69 @cindex error debugging 69 @cindex error debugging
70 @cindex debugging errors 70 @cindex debugging errors
71 71
72 The most important time to enter the debugger is when a Lisp error 72 The most important time to enter the debugger is when a Lisp error
128 @example 128 @example
129 (add-hook 'after-init-hook 129 (add-hook 'after-init-hook
130 '(lambda () (setq debug-on-error t))) 130 '(lambda () (setq debug-on-error t)))
131 @end example 131 @end example
132 132
133 @node Infinite Loops 133 @node Infinite Loops, Function Debugging, Error Debugging, Debugger
134 @subsection Debugging Infinite Loops 134 @subsection Debugging Infinite Loops
135 @cindex infinite loops 135 @cindex infinite loops
136 @cindex loops, infinite 136 @cindex loops, infinite
137 @cindex quitting from infinite loop 137 @cindex quitting from infinite loop
138 @cindex stopping an infinite loop 138 @cindex stopping an infinite loop
159 then the debugger is called whenever you quit (that is, type @kbd{C-g}). 159 then the debugger is called whenever you quit (that is, type @kbd{C-g}).
160 If @code{debug-on-quit} is @code{nil}, then the debugger is not called 160 If @code{debug-on-quit} is @code{nil}, then the debugger is not called
161 when you quit. @xref{Quitting}. 161 when you quit. @xref{Quitting}.
162 @end defopt 162 @end defopt
163 163
164 @node Function Debugging 164 @node Function Debugging, Explicit Debug, Infinite Loops, Debugger
165 @subsection Entering the Debugger on a Function Call 165 @subsection Entering the Debugger on a Function Call
166 @cindex function call debugging 166 @cindex function call debugging
167 @cindex debugging specific functions 167 @cindex debugging specific functions
168 168
169 To investigate a problem that happens in the middle of a program, one 169 To investigate a problem that happens in the middle of a program, one
241 If @code{cancel-debug-on-entry} is called more than once on the same 241 If @code{cancel-debug-on-entry} is called more than once on the same
242 function, the second call does nothing. @code{cancel-debug-on-entry} 242 function, the second call does nothing. @code{cancel-debug-on-entry}
243 returns @var{function-name}. 243 returns @var{function-name}.
244 @end deffn 244 @end deffn
245 245
246 @node Explicit Debug 246 @node Explicit Debug, Using Debugger, Function Debugging, Debugger
247 @subsection Explicit Entry to the Debugger 247 @subsection Explicit Entry to the Debugger
248 248
249 You can cause the debugger to be called at a certain point in your 249 You can cause the debugger to be called at a certain point in your
250 program by writing the expression @code{(debug)} at that point. To do 250 program by writing the expression @code{(debug)} at that point. To do
251 this, visit the source file, insert the text @samp{(debug)} at the 251 this, visit the source file, insert the text @samp{(debug)} at the
256 additional form can be evaluated and its value ignored. (If the value 256 additional form can be evaluated and its value ignored. (If the value
257 of @code{(debug)} isn't ignored, it will alter the execution of the 257 of @code{(debug)} isn't ignored, it will alter the execution of the
258 program!) The most common suitable places are inside a @code{progn} or 258 program!) The most common suitable places are inside a @code{progn} or
259 an implicit @code{progn} (@pxref{Sequencing}). 259 an implicit @code{progn} (@pxref{Sequencing}).
260 260
261 @node Using Debugger 261 @node Using Debugger, Debugger Commands, Explicit Debug, Debugger
262 @subsection Using the Debugger 262 @subsection Using the Debugger
263 263
264 When the debugger is entered, it displays the previously selected 264 When the debugger is entered, it displays the previously selected
265 buffer in one window and a buffer named @samp{*Backtrace*} in another 265 buffer in one window and a buffer named @samp{*Backtrace*} in another
266 window. The backtrace buffer contains one line for each level of Lisp 266 window. The backtrace buffer contains one line for each level of Lisp
294 itself. These assumptions are false if the debugger is running 294 itself. These assumptions are false if the debugger is running
295 interpreted. 295 interpreted.
296 296
297 @need 3000 297 @need 3000
298 298
299 @node Debugger Commands 299 @node Debugger Commands, Invoking the Debugger, Using Debugger, Debugger
300 @subsection Debugger Commands 300 @subsection Debugger Commands
301 @cindex debugger command list 301 @cindex debugger command list
302 302
303 Inside the debugger (in Debugger mode), these special commands are 303 Inside the debugger (in Debugger mode), these special commands are
304 available in addition to the usual cursor motion commands. (Keep in 304 available in addition to the usual cursor motion commands. (Keep in
389 then the error will immediately be signalled again. Other errors 389 then the error will immediately be signalled again. Other errors
390 (e.g. wrong-type-argument errors) will be continually resignalled 390 (e.g. wrong-type-argument errors) will be continually resignalled
391 until the problem is corrected. 391 until the problem is corrected.
392 @end table 392 @end table
393 393
394 @node Invoking the Debugger 394 @node Invoking the Debugger, Internals of Debugger, Debugger Commands, Debugger
395 @subsection Invoking the Debugger 395 @subsection Invoking the Debugger
396 396
397 Here we describe fully the function used to invoke the debugger. 397 Here we describe fully the function used to invoke the debugger.
398 398
399 @defun debug &rest debugger-args 399 @defun debug &rest debugger-args
488 @end table 488 @end table
489 @end defun 489 @end defun
490 490
491 @need 5000 491 @need 5000
492 492
493 @node Internals of Debugger 493 @node Internals of Debugger, , Invoking the Debugger, Debugger
494 @subsection Internals of the Debugger 494 @subsection Internals of the Debugger
495 495
496 This section describes functions and variables used internally by the 496 This section describes functions and variables used internally by the
497 debugger. 497 debugger.
498 498
635 635
636 If @var{frame-number} is out of range, @code{backtrace-frame} returns 636 If @var{frame-number} is out of range, @code{backtrace-frame} returns
637 @code{nil}. 637 @code{nil}.
638 @end defun 638 @end defun
639 639
640 @node Syntax Errors 640 @node Syntax Errors, Compilation Errors, Debugger, Debugging
641 @section Debugging Invalid Lisp Syntax 641 @section Debugging Invalid Lisp Syntax
642 642
643 The Lisp reader reports invalid syntax, but cannot say where the real 643 The Lisp reader reports invalid syntax, but cannot say where the real
644 problem is. For example, the error ``End of file during parsing'' in 644 problem is. For example, the error ``End of file during parsing'' in
645 evaluating an expression indicates an excess of open parentheses (or 645 evaluating an expression indicates an excess of open parentheses (or
660 @menu 660 @menu
661 * Excess Open:: How to find a spurious open paren or missing close. 661 * Excess Open:: How to find a spurious open paren or missing close.
662 * Excess Close:: How to find a spurious close paren or missing open. 662 * Excess Close:: How to find a spurious close paren or missing open.
663 @end menu 663 @end menu
664 664
665 @node Excess Open 665 @node Excess Open, Excess Close, Syntax Errors, Syntax Errors
666 @subsection Excess Open Parentheses 666 @subsection Excess Open Parentheses
667 667
668 The first step is to find the defun that is unbalanced. If there is 668 The first step is to find the defun that is unbalanced. If there is
669 an excess open parenthesis, the way to do this is to insert a 669 an excess open parenthesis, the way to do this is to insert a
670 close parenthesis at the end of the file and type @kbd{C-M-b} 670 close parenthesis at the end of the file and type @kbd{C-M-b}
696 After you think you have fixed the problem, use @kbd{C-M-q} again. If 696 After you think you have fixed the problem, use @kbd{C-M-q} again. If
697 the old indentation actually fit the intended nesting of parentheses, 697 the old indentation actually fit the intended nesting of parentheses,
698 and you have put back those parentheses, @kbd{C-M-q} should not change 698 and you have put back those parentheses, @kbd{C-M-q} should not change
699 anything. 699 anything.
700 700
701 @node Excess Close 701 @node Excess Close, , Excess Open, Syntax Errors
702 @subsection Excess Close Parentheses 702 @subsection Excess Close Parentheses
703 703
704 To deal with an excess close parenthesis, first insert an open 704 To deal with an excess close parenthesis, first insert an open
705 parenthesis at the beginning of the file, back up over it, and type 705 parenthesis at the beginning of the file, back up over it, and type
706 @kbd{C-M-f} to find the end of the unbalanced defun. (Then type 706 @kbd{C-M-f} to find the end of the unbalanced defun. (Then type