diff options
| author | Eli Zaretskii | 2013-02-22 11:22:21 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2013-02-22 11:22:21 +0200 |
| commit | 83c54ddf38dd70e2f8673b4928ee6c5f4030bdbf (patch) | |
| tree | d9ff655fa3daacba0751e40776aa0b7a9671cbad | |
| parent | 6800ff8d3a1da03281ad026729eadd036b49d2a9 (diff) | |
| download | emacs-83c54ddf38dd70e2f8673b4928ee6c5f4030bdbf.tar.gz emacs-83c54ddf38dd70e2f8673b4928ee6c5f4030bdbf.zip | |
Improve instructions in etc/DEBUG, per bug #13775.
| -rw-r--r-- | etc/DEBUG | 33 |
1 files changed, 22 insertions, 11 deletions
| @@ -8,17 +8,28 @@ See the end of the file for license conditions. | |||
| 8 | read the Windows-specific section near the end of this document.] | 8 | read the Windows-specific section near the end of this document.] |
| 9 | 9 | ||
| 10 | ** When you debug Emacs with GDB, you should start it in the directory | 10 | ** When you debug Emacs with GDB, you should start it in the directory |
| 11 | where the executable was made. That directory has a .gdbinit file | 11 | where the executable was made (the 'src' directory in the Emacs source |
| 12 | that defines various "user-defined" commands for debugging Emacs. | 12 | tree). That directory has a .gdbinit file that defines various |
| 13 | (These commands are described below under "Examining Lisp object | 13 | "user-defined" commands for debugging Emacs. (These commands are |
| 14 | values" and "Debugging Emacs Redisplay problems".) | 14 | described below under "Examining Lisp object values" and "Debugging |
| 15 | 15 | Emacs Redisplay problems".) | |
| 16 | ** When you are trying to analyze failed assertions, it will be | 16 | |
| 17 | essential to compile Emacs either completely without optimizations or | 17 | Some GDB versions by default do not automatically load .gdbinit files |
| 18 | at least (when using GCC) with the -fno-crossjumping option. Failure | 18 | in the directory where you invoke GDB. With those versions of GDB, |
| 19 | to do so may make the compiler recycle the same abort call for all | 19 | you will see a warning when GDB starts, like this: |
| 20 | assertions in a given function, rendering the stack backtrace useless | 20 | |
| 21 | for identifying the specific failed assertion. | 21 | warning: File ".../src/.gdbinit" auto-loading has been declined by your `auto-load safe-path' set to "$debugdir:$datadir/auto-load". |
| 22 | |||
| 23 | There are several ways to overcome that difficulty, they are all | ||
| 24 | described in the node "Auto-loading safe path" in the GDB user manual. | ||
| 25 | |||
| 26 | ** When you are trying to analyze failed assertions or backtraces, it | ||
| 27 | will be essential to compile Emacs either completely without | ||
| 28 | optimizations (set CFLAGS to "-O0 -g3") or at least (when using GCC) | ||
| 29 | with the -fno-crossjumping option in CFLAGS. Failure to do so may | ||
| 30 | make the compiler recycle the same abort call for all assertions in a | ||
| 31 | given function, rendering the stack backtrace useless for identifying | ||
| 32 | the specific failed assertion. | ||
| 22 | 33 | ||
| 23 | ** It is a good idea to run Emacs under GDB (or some other suitable | 34 | ** It is a good idea to run Emacs under GDB (or some other suitable |
| 24 | debugger) *all the time*. Then, when Emacs crashes, you will be able | 35 | debugger) *all the time*. Then, when Emacs crashes, you will be able |