aboutsummaryrefslogtreecommitdiffstats
path: root/etc/DEBUG
diff options
context:
space:
mode:
authorPaul Eggert2016-09-26 13:32:28 -0700
committerPaul Eggert2016-09-26 13:32:28 -0700
commitdcd90f60eb8952d119d97efcef9564ec96def054 (patch)
tree2d3a5bbac64d7fbd94f3af0774218911a522e61f /etc/DEBUG
parentc44ecb77ab33f0a0559c3e5da42fb486d6b014dd (diff)
parent0ffc9cef49b0fceb3c5e904837ea5675fe4306ac (diff)
downloademacs-dcd90f60eb8952d119d97efcef9564ec96def054.tar.gz
emacs-dcd90f60eb8952d119d97efcef9564ec96def054.zip
Merge from origin/emacs-25
0ffc9ce Update admin/authors.el 0ad7410 Update Antinews in ELisp manual ea0f750 Fix comments on window height macros 0bbdeed Fix 'url-http-create-request' when cookies are used 0045998 Fix cross reference in frames.texi 1392894 ; * etc/DEBUG: Minor copyedits. 304a5c8 ; * etc/DEBUG: Improve documentation of getting control to GDB. 56bf7d7 Fix regexp-opt documentation (bug #17862) 803ad6f ; Fix documentation of seq-subseq ed4530d * lisp/emacs-lisp/gv.el (gv-ref): Fix example of PLACE in doc... 88ea396 ; Spelling fixes 17197d0 Fix tags-query-replace docstring 80a7f8b Clarify documentation of precision in format specs 88a5052 Improve and clarify documentation of subprocesses 89eb09f * etc/PROBLEMS: Mention gnutls-cli 3.5.3 (Bug#24247). # Conflicts: # etc/PROBLEMS # src/process.c
Diffstat (limited to 'etc/DEBUG')
-rw-r--r--etc/DEBUG75
1 files changed, 53 insertions, 22 deletions
diff --git a/etc/DEBUG b/etc/DEBUG
index 656e29a8b74..03efa3b10dd 100644
--- a/etc/DEBUG
+++ b/etc/DEBUG
@@ -190,24 +190,44 @@ kick in, provided that you run under GDB.
190 190
191** Getting control to the debugger 191** Getting control to the debugger
192 192
193Setting a breakpoint in a strategic place, after loading Emacs into
194the debugger, but before running it, is the most efficient way of
195making sure control will be returned to the debugger when you need
196that.
197
193'Fsignal' is a very useful place to put a breakpoint in. All Lisp 198'Fsignal' is a very useful place to put a breakpoint in. All Lisp
194errors go through there. If you are only interested in errors that 199errors go through there. If you are only interested in errors that
195would fire the debugger, breaking at 'maybe_call_debugger' is useful. 200would fire the Lisp debugger, breaking at 'maybe_call_debugger' is
201useful.
202
203Another technique for get control to the debugger is to put a
204breakpoint in some rarely used function. One such convenient function
205is Fredraw_display, which you can invoke at will interactively with
206"M-x redraw-display RET".
196 207
197It is useful, when debugging, to have a guaranteed way to return to 208It is also useful to have a guaranteed way to return to the debugger
198the debugger at any time. When using X, this is easy: type C-z at the 209at any arbitrary time. When using X, this is easy: type C-z at the
199window where Emacs is running under GDB, and it will stop Emacs just 210window where you are interacting with GDB, and it will stop Emacs just
200as it would stop any ordinary program. When Emacs is running in a 211as it would stop any ordinary program. (This doesn't work if GDB was
201terminal, things are not so easy. 212attached to a running Emacs process; in that case, you will need to
213type C-z to the shell window from which Emacs was started, or use the
214"kill -TSTP" method described below.)
215
216When Emacs is displaying on a text terminal, things are not so easy,
217so we describe the various alternatives below (however, those of them
218that use signals only work on Posix systems).
202 219
203The src/.gdbinit file in the Emacs distribution arranges for SIGINT 220The src/.gdbinit file in the Emacs distribution arranges for SIGINT
204(C-g in Emacs) to be passed to Emacs and not give control back to GDB. 221(C-g in Emacs on a text-mode frame) to be passed to Emacs and not give
205On modern POSIX systems, you can override that with this command: 222control back to GDB. On modern systems, you can override that with
223this command:
206 224
207 handle SIGINT stop nopass 225 handle SIGINT stop nopass
208 226
209After this 'handle' command, SIGINT will return control to GDB. If 227After this 'handle' command, SIGINT will return control to GDB. If
210you want the C-g to cause a QUIT within Emacs as well, omit the 'nopass'. 228you want the C-g to cause a QUIT within Emacs as well, omit the 'nopass'.
229See the GDB manual for more details about signal handling and the
230'handle' command.
211 231
212A technique that can work when 'handle SIGINT' does not is to store 232A technique that can work when 'handle SIGINT' does not is to store
213the code for some character into the variable stop_character. Thus, 233the code for some character into the variable stop_character. Thus,
@@ -216,26 +236,37 @@ the code for some character into the variable stop_character. Thus,
216 236
217makes Control-] (decimal code 29) the stop character. 237makes Control-] (decimal code 29) the stop character.
218Typing Control-] will cause immediate stop. You cannot 238Typing Control-] will cause immediate stop. You cannot
219use the set command until the inferior process has been started. 239use the set command until the inferior process has been started, so
220Put a breakpoint early in 'main', or suspend the Emacs, 240start Emacs with the 'start' command, to get an opportunity to do the
221to get an opportunity to do the set command. 241above 'set' command.
222 242
223Another technique for get control to the debugger is to put a 243On a Posix host, you can also send a signal using the 'kill' command
224breakpoint in some rarely used function. One such convenient function 244from a shell prompt, like this:
225is Fredraw_display, which you can invoke at will interactively with
226"M-x redraw-display RET".
227 245
228When Emacs is running in a terminal, it is sometimes useful to use a separate 246 kill -TSTP Emacs-PID
229terminal for the debug session. This can be done by starting Emacs as usual,
230then attaching to it from gdb with the 'attach' command which is explained in
231the node "Attach" of the GDB manual.
232 247
233On MS-Windows, you can start Emacs in its own separate terminal by 248where Emacs-PID is the process ID of Emacs being debugged. Other
234setting the new-console option before running Emacs under GDB: 249useful signals to send are SIGUSR1 and SIGUSR2; see "Error Debugging"
250in the ELisp manual for how to use those.
251
252When Emacs is displaying on a text terminal, it is useful to have a
253separate terminal for the debug session. This can be done by starting
254Emacs as usual, then attaching to it from gdb with the 'attach'
255command which is explained in the node "Attach" of the GDB manual.
256
257On MS-Windows, you can alternatively start Emacs from its own separate
258console by setting the new-console option before running Emacs under
259GDB:
235 260
236 (gdb) set new-console 1 261 (gdb) set new-console 1
237 (gdb) run 262 (gdb) run
238 263
264If you do this, then typing C-c or C-BREAK into the console window
265through which you interact with GDB will stop Emacs and return control
266to the debugger, no matter if Emacs displays GUI or text-mode frames.
267This is the only reliable alternative on MS-Windows to get control to
268the debugger, besides setting breakpoints in advance.
269
239** Examining Lisp object values. 270** Examining Lisp object values.
240 271
241When you have a live process to debug, and it has not encountered a 272When you have a live process to debug, and it has not encountered a
@@ -848,7 +879,7 @@ directed to the xterm window you opened above.
848Similar arrangement is possible on a character terminal by using the 879Similar arrangement is possible on a character terminal by using the
849'screen' package. 880'screen' package.
850 881
851On MS-Windows, you can start Emacs in its own separate terminal by 882On MS-Windows, you can start Emacs in its own separate console by
852setting the new-console option before running Emacs under GDB: 883setting the new-console option before running Emacs under GDB:
853 884
854 (gdb) set new-console 1 885 (gdb) set new-console 1