Mercurial > emacs
comparison man/trouble.texi @ 35874:99572fa1c8c3
Remove the more arcane part of Emacs debug instructions. Replace
them with a reference to etc/DEBUG.
author | Eli Zaretskii <eliz@gnu.org> |
---|---|
date | Sun, 04 Feb 2001 07:29:18 +0000 |
parents | 6c05ec832ecc |
children | 252e21b04fb1 |
comparison
equal
deleted
inserted
replaced
35873:1cd4a45e9aae | 35874:99572fa1c8c3 |
---|---|
716 @code{Fsignal}. | 716 @code{Fsignal}. |
717 | 717 |
718 For a short listing of Lisp functions running, type the GDB | 718 For a short listing of Lisp functions running, type the GDB |
719 command @code{xbacktrace}. | 719 command @code{xbacktrace}. |
720 | 720 |
721 If you want to examine Lisp function arguments, move up the stack, and | |
722 each time you get to a frame for the function @code{Ffuncall}, type | |
723 these GDB commands: | |
724 | |
725 @example | |
726 p *args | |
727 pr | |
728 @end example | |
729 | |
730 @noindent | |
731 To print the first argument that the function received, use these | |
732 commands: | |
733 | |
734 @example | |
735 p args[1] | |
736 pr | |
737 @end example | |
738 | |
739 @noindent | |
740 You can print the other arguments likewise. The argument @code{nargs} | |
741 of @code{Ffuncall} says how many arguments @code{Ffuncall} received; | |
742 these include the Lisp function itself and the arguments for that | |
743 function. | |
744 | |
745 The file @file{.gdbinit} defines several other commands that are useful | 721 The file @file{.gdbinit} defines several other commands that are useful |
746 for examining the data types and contents of Lisp objects. Their names | 722 for examining the data types and contents of Lisp objects. Their names |
747 begin with @samp{x}. These commands work at a lower level than | 723 begin with @samp{x}. These commands work at a lower level than |
748 @code{pr}, and are less convenient, but they may work even when | 724 @code{pr}, and are less convenient, but they may work even when |
749 @code{pr} does not, such as when debugging a core dump or when Emacs has | 725 @code{pr} does not, such as when debugging a core dump or when Emacs has |
750 had a fatal signal. | 726 had a fatal signal. |
751 | 727 |
752 @item | 728 @cindex debugging Emacs, tricks and techniques |
753 If the symptom of the bug is that Emacs fails to respond, don't assume | 729 More detailed advice and other useful techniques for debugging Emacs |
754 Emacs is ``hung''---it may instead be in an infinite loop. To find out | 730 are available in the file @file{etc/DEBUG} in the Emacs distribution. |
755 which, make the problem happen under GDB and stop Emacs once it is not | 731 That file also includes instructions for investigating problems |
756 responding. (If Emacs is using X directly, you can stop Emacs by typing | 732 whereby Emacs stops responding (many people assume that Emacs is |
757 @kbd{C-z} at the GDB job.) Then try stepping with @samp{step}. If | 733 ``hung'', whereas in fact it might be in an infinite loop). |
758 Emacs is hung, the @samp{step} command won't return. If it is looping, | 734 |
759 @samp{step} will return. | 735 In an installed Emacs, the file @file{etc/DEBUG} is in the same |
760 | 736 directory where the Emacs on-line documentation file @file{DOC}, |
761 If this shows Emacs is hung in a system call, stop it again and examine | 737 typically in the @file{/usr/local/share/emacs/@var{version}/etc/} |
762 the arguments of the call. In your bug report, state exactly where in | 738 directory. The directory for your installation is stored in the |
763 the source the system call is, and what the arguments are. | 739 variable @code{data-directory}. |
764 | |
765 If Emacs is in an infinite loop, please determine where the loop starts | |
766 and ends. The easiest way to do this is to use the GDB command | |
767 @samp{finish}. Each time you use it, Emacs resumes execution until it | |
768 exits one stack frame. Keep typing @samp{finish} until it doesn't | |
769 return---that means the infinite loop is in the stack frame which you | |
770 just tried to finish. | |
771 | |
772 Stop Emacs again, and use @samp{finish} repeatedly again until you get | |
773 @emph{back to} that frame. Then use @samp{next} to step through that | |
774 frame. By stepping, you will see where the loop starts and ends. Also | |
775 please examine the data being used in the loop and try to determine why | |
776 the loop does not exit when it should. Include all of this information | |
777 in your bug report. | |
778 @end itemize | 740 @end itemize |
779 | 741 |
780 Here are some things that are not necessary in a bug report: | 742 Here are some things that are not necessary in a bug report: |
781 | 743 |
782 @itemize @bullet | 744 @itemize @bullet |