Mercurial > emacs
comparison etc/DEBUG @ 32523:4881cd839f12
*** empty log message ***
author | Gerd Moellmann <gerd@gnu.org> |
---|---|
date | Mon, 16 Oct 2000 11:43:01 +0000 |
parents | e96ffe544684 |
children | 9b989029cccf |
comparison
equal
deleted
inserted
replaced
32522:fedf4de246a1 | 32523:4881cd839f12 |
---|---|
1 Debugging GNU Emacs | 1 Debugging GNU Emacs |
2 Copyright (c) 1985 Richard M. Stallman. | 2 Copyright (c) 1985, 2000 Free Software Foundation, Inc. |
3 | 3 |
4 Permission is granted to anyone to make or distribute verbatim copies | 4 Permission is granted to anyone to make or distribute verbatim copies |
5 of this document as received, in any medium, provided that the | 5 of this document as received, in any medium, provided that the |
6 copyright notice and permission notice are preserved, | 6 copyright notice and permission notice are preserved, |
7 and that the distributor grants the recipient permission | 7 and that the distributor grants the recipient permission |
9 | 9 |
10 Permission is granted to distribute modified versions | 10 Permission is granted to distribute modified versions |
11 of this document, or of portions of it, | 11 of this document, or of portions of it, |
12 under the above conditions, provided also that they | 12 under the above conditions, provided also that they |
13 carry prominent notices stating who last changed them. | 13 carry prominent notices stating who last changed them. |
14 | |
15 On 4.2 you will probably find that dbx does not work for | |
16 debugging GNU Emacs. For one thing, dbx does not keep the | |
17 inferior process's terminal modes separate from its own. | |
18 For another, dbx does not put the inferior in a separate | |
19 process group, which makes trouble when an inferior uses | |
20 interrupt input, which GNU Emacs must do on 4.2. | |
21 | |
22 dbx has also been observed to have other problems, | |
23 such as getting incorrect values for register variables | |
24 in stack frames other than the innermost one. | |
25 | |
26 The Emacs distribution now contains GDB, the new source-level | |
27 debugger for the GNU system. GDB works for debugging Emacs. | |
28 GDB currently runs on vaxes under 4.2 and on Sun 2 and Sun 3 | |
29 systems. | |
30 | |
31 | 14 |
32 ** Some useful techniques | 15 ** Some useful techniques |
33 | 16 |
34 `Fsignal' is a very useful place to stop in. | 17 `Fsignal' is a very useful place to stop in. |
35 All Lisp errors go through there. | 18 All Lisp errors go through there. |
48 Put a breakpoint early in `main', or suspend the Emacs, | 31 Put a breakpoint early in `main', or suspend the Emacs, |
49 to get an opportunity to do the set command. | 32 to get an opportunity to do the set command. |
50 | 33 |
51 If you are using cbreak input (see the Lisp function set-input-mode), | 34 If you are using cbreak input (see the Lisp function set-input-mode), |
52 then typing Control-g will cause a SIGINT, which will return control | 35 then typing Control-g will cause a SIGINT, which will return control |
53 to the debugger immediately unless you have done | 36 to GDB immediately if you type this command first: |
54 | 37 |
55 ignore 3 (in dbx) | 38 handle 2 stop |
56 or handle 3 nostop noprint (in gdb) | |
57 | |
58 You will note that most of GNU Emacs is written to avoid | |
59 declaring a local variable in an inner block, even in | |
60 cases where using one would be the cleanest thing to do. | |
61 This is because dbx cannot access any of the variables | |
62 in a function which has even one variable defined in an | |
63 inner block. A few functions in GNU Emacs do have variables | |
64 in inner blocks, only because I wrote them before realizing | |
65 that dbx had this problem and never rewrote them to avoid it. | |
66 | |
67 I believe that GDB does not have such a problem. | |
68 | 39 |
69 | 40 |
70 ** Examining Lisp object values. | 41 ** Examining Lisp object values. |
71 | 42 |
72 When you have a live process to debug, and it has not encountered a | 43 When you have a live process to debug, and it has not encountered a |