diff options
| author | Eli Zaretskii | 2015-12-07 18:32:00 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2015-12-07 18:32:00 +0200 |
| commit | f366f23624d9c571a9203c23d73cd5a2b141483f (patch) | |
| tree | dad08e4fc8d215f37160427c305101a2a48e5632 | |
| parent | 86130adf1ef6ca8e8feabcc0fe966f84bf5d42dc (diff) | |
| download | emacs-f366f23624d9c571a9203c23d73cd5a2b141483f.tar.gz emacs-f366f23624d9c571a9203c23d73cd5a2b141483f.zip | |
; * etc/DEBUG: Improve newbie instructions. Fix a typo.
| -rw-r--r-- | etc/DEBUG | 21 |
1 files changed, 17 insertions, 4 deletions
| @@ -143,9 +143,16 @@ Many variables you will encounter while debugging are Lisp objects. | |||
| 143 | These are displayed as integer values (or structures, if you used the | 143 | These are displayed as integer values (or structures, if you used the |
| 144 | "--enable-check-lisp-object-type" option at configure time) that are | 144 | "--enable-check-lisp-object-type" option at configure time) that are |
| 145 | hard to interpret, especially if they represent long lists. You can | 145 | hard to interpret, especially if they represent long lists. You can |
| 146 | use the 'pp' command to display them in their Lisp form. Additional | 146 | use the 'pp' command to display them in their Lisp form. That command |
| 147 | information about displaying Lisp objects can be found under | 147 | displays its output on the standard error stream (on GNU/Linux, you |
| 148 | "Examining Lisp object values" below. | 148 | can redirect that to a file using "M-x redirect-debugging-output"). |
| 149 | This means that if you attach GDB to a running Emacs that was invoked | ||
| 150 | from a desktop icon, chances are you will not see the output at all, | ||
| 151 | or it will wind up in an obscure place (check the documentation of | ||
| 152 | your desktop environment). | ||
| 153 | |||
| 154 | Additional information about displaying Lisp objects can be found | ||
| 155 | under "Examining Lisp object values" below. | ||
| 149 | 156 | ||
| 150 | The rest of this document describes specific useful techniques for | 157 | The rest of this document describes specific useful techniques for |
| 151 | debugging Emacs; we suggest reading it in its entirety the first time | 158 | debugging Emacs; we suggest reading it in its entirety the first time |
| @@ -240,6 +247,12 @@ You can also use 'pp value' to print the emacs value directly. | |||
| 240 | 247 | ||
| 241 | To see the current value of a Lisp Variable, use 'pv variable'. | 248 | To see the current value of a Lisp Variable, use 'pv variable'. |
| 242 | 249 | ||
| 250 | These commands send their output to stderr; if that is closed or | ||
| 251 | redirected to some file you don't know, you won't see their output. | ||
| 252 | This is particularly so for Emacs invoked on MS-Windows from the | ||
| 253 | desktop shortcut. On GNU/Linux, you can use the command | ||
| 254 | 'redirect-debugging-output' to redirect stderr to a file. | ||
| 255 | |||
| 243 | Note: It is not a good idea to try 'pr', 'pp', or 'pv' if you know that Emacs | 256 | Note: It is not a good idea to try 'pr', 'pp', or 'pv' if you know that Emacs |
| 244 | is in deep trouble: its stack smashed (e.g., if it encountered SIGSEGV | 257 | is in deep trouble: its stack smashed (e.g., if it encountered SIGSEGV |
| 245 | due to stack overflow), or crucial data structures, such as 'obarray', | 258 | due to stack overflow), or crucial data structures, such as 'obarray', |
| @@ -310,7 +323,7 @@ Then Emacs hits the breakpoint: | |||
| 310 | [...] | 323 | [...] |
| 311 | } | 324 | } |
| 312 | 325 | ||
| 313 | Now we can use 'pr' to print the frame parameters: | 326 | Now we can use 'pp' to print the frame parameters: |
| 314 | 327 | ||
| 315 | (gdb) pp $->param_alist | 328 | (gdb) pp $->param_alist |
| 316 | ((background-mode . light) (display-type . color) [...]) | 329 | ((background-mode . light) (display-type . color) [...]) |