aboutsummaryrefslogtreecommitdiffstats
path: root/etc/DEBUG
diff options
context:
space:
mode:
authorGlenn Morris2018-05-01 07:50:48 -0700
committerGlenn Morris2018-05-01 07:50:48 -0700
commit62032f699a4969ffacd9b8ea9dccd3ce6b10051f (patch)
tree357983c747ff7af985339027113adbc942f0edcd /etc/DEBUG
parentb3b4697ff8b9093cef2cc3842dab731f37c9e2e1 (diff)
parent71be806d01c4e135f067bc842a9d684e594b4f35 (diff)
downloademacs-62032f699a4969ffacd9b8ea9dccd3ce6b10051f.tar.gz
emacs-62032f699a4969ffacd9b8ea9dccd3ce6b10051f.zip
Merge from origin/emacs-26
71be806 ; * etc/DEBUG: Minor clarification. 4403f89 Update the Emacs FAQ 40b3317 * etc/DEBUG: Minor copyedits. 850ff18 Clarify wording of NS drag n drop documentation 343d70b1 Improve kill-related documentation (bug#31209) 0b43224 * lisp/simple.el (region-extract-function): Don't hide the 'n... d6e2c59 Fix pre- and post-command-hook errors in term.el 6cf83131e * doc/lispref/display.texi (Glyphless Chars): Fix grammar. 88d178c Fix macOS drag n drop event documentation
Diffstat (limited to 'etc/DEBUG')
-rw-r--r--etc/DEBUG23
1 files changed, 17 insertions, 6 deletions
diff --git a/etc/DEBUG b/etc/DEBUG
index 49764fc9137..aeb447bae33 100644
--- a/etc/DEBUG
+++ b/etc/DEBUG
@@ -43,6 +43,11 @@ created in the 'src' directory.
43 43
44*** Configuring GDB 44*** Configuring GDB
45 45
46To start GDB to debug Emacs, you can simply type "gdb ./emacs RET" at
47the shell prompt (assuming you do that from the directory of the Emacs
48executable, usually the 'src' sub-directory of the Emacs tree).
49However, we recommend starting GDB from Emacs, see below.
50
46When you debug Emacs with GDB, you should start GDB in the directory 51When you debug Emacs with GDB, you should start GDB in the directory
47where the Emacs executable was made (the 'src' directory in the Emacs 52where the Emacs executable was made (the 'src' directory in the Emacs
48source tree). That directory has a .gdbinit file that defines various 53source tree). That directory has a .gdbinit file that defines various
@@ -52,16 +57,19 @@ Emacs Redisplay problems".)
52 57
53Starting the debugger from Emacs, via the "M-x gdb" command (described 58Starting the debugger from Emacs, via the "M-x gdb" command (described
54below), when the current buffer visits one of the Emacs C source files 59below), when the current buffer visits one of the Emacs C source files
55will automatically start GDB in the 'src' directory. 60will automatically start GDB in the 'src' directory. If you invoke
61"M-x gdb" from a buffer whose default directory is different, such as
62from the "*scratch*" buffer, you can change the default directory with
63the "M-x cd" command before starting the debugger.
56 64
57Some GDB versions by default do not automatically load .gdbinit files 65Recent GDB versions by default do not automatically load .gdbinit
58in the directory where you invoke GDB. With those versions of GDB, 66files in the directory where you invoke GDB. With those versions of
59you will see a warning when GDB starts, like this: 67GDB, you will see a warning when GDB starts, like this:
60 68
61 warning: File ".../src/.gdbinit" auto-loading has been declined by your `auto-load safe-path' set to "$debugdir:$datadir/auto-load". 69 warning: File ".../src/.gdbinit" auto-loading has been declined by your `auto-load safe-path' set to "$debugdir:$datadir/auto-load".
62 70
63The simplest way to fix this is to add the following line to your 71The simplest way to fix this is to add the following line to your
64~/.gdbinit file: 72~/.gdbinit file (creating such a file if it doesn't already exist):
65 73
66 add-auto-load-safe-path /path/to/emacs/src/.gdbinit 74 add-auto-load-safe-path /path/to/emacs/src/.gdbinit
67 75
@@ -133,9 +141,12 @@ to the debugger".
133 141
134You are now ready to start your debugging session. 142You are now ready to start your debugging session.
135 143
144*** Running Emacs from GDB
145
136If you are starting a new Emacs session, type "run", followed by any 146If you are starting a new Emacs session, type "run", followed by any
137command-line arguments (e.g., "-Q") into the *gud-emacs* buffer and 147command-line arguments (e.g., "-Q") into the *gud-emacs* buffer and
138press RET. 148press RET. If you ran GDB outside of Emacs, type "run" followed by
149the command-line arguments at the GDB prompt instead.
139 150
140If you attached the debugger to a running Emacs, type "continue" into 151If you attached the debugger to a running Emacs, type "continue" into
141the *gud-emacs* buffer and press RET. 152the *gud-emacs* buffer and press RET.