diff options
| author | Paul Eggert | 2016-04-04 09:36:30 -0700 |
|---|---|---|
| committer | Paul Eggert | 2016-04-04 09:44:19 -0700 |
| commit | 6bccb19c9bef1189c8e853ff7cc16b889a3a57e3 (patch) | |
| tree | 9555d6605362ec0c452b343d549d2af3c983415d /etc | |
| parent | a11756ad0e2ee719266c0081150c20996cce8e0d (diff) | |
| download | emacs-6bccb19c9bef1189c8e853ff7cc16b889a3a57e3.tar.gz emacs-6bccb19c9bef1189c8e853ff7cc16b889a3a57e3.zip | |
Port redirect-debugging-output to non-GNU/Linux
Problem reported by Kylie McClain for musl in:
http://lists.gnu.org/archive/html/emacs-devel/2016-03/msg01592.html
* etc/DEBUG, etc/NEWS: Mention this.
* src/callproc.c (child_setup) [!MSDOS]:
* src/dispnew.c (init_display):
* src/emacs.c (main, Fdaemon_initialized):
* src/minibuf.c (read_minibuf_noninteractive):
* src/regex.c (xmalloc, xrealloc):
Prefer symbolic names like STDERR_FILENO to magic numbers like 2,
to make file-descriptor manipulation easier to follow.
* src/emacs.c (relocate_fd) [!WINDOWSNT]: Remove; no longer needed
now that we make sure stdin, stdout and stderr are open. All uses
removed.
(main): Make sure standard FDs are OK. Prefer symbolic names like
EXIT_FAILURE to magic numbers like 1. Use bool for boolean.
* src/lisp.h (init_standard_fds): New decl.
* src/print.c (WITH_REDIRECT_DEBUGGING_OUTPUT) [GNU_LINUX]:
Remove; no longer needed.
(Fredirect_debugging_output): Define on all platforms, not just
GNU/Linux. Redirect file descriptor, not stream, so that the code
works even if stderr is not an lvalue. Report an error if the
file arg is neither a string nor nil.
(syms_of_print): Always define redirect-debugging-output.
* src/sysdep.c (force_open, init_standard_fds): New functions.
Diffstat (limited to 'etc')
| -rw-r--r-- | etc/DEBUG | 8 | ||||
| -rw-r--r-- | etc/NEWS | 3 |
2 files changed, 7 insertions, 4 deletions
| @@ -144,8 +144,8 @@ 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. That command | 146 | use the 'pp' command to display them in their Lisp form. That command |
| 147 | displays its output on the standard error stream (on GNU/Linux, you | 147 | displays its output on the standard error stream, which you |
| 148 | can redirect that to a file using "M-x redirect-debugging-output"). | 148 | can redirect to a file using "M-x redirect-debugging-output". |
| 149 | This means that if you attach GDB to a running Emacs that was invoked | 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, | 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 | 151 | or it will wind up in an obscure place (check the documentation of |
| @@ -250,8 +250,8 @@ To see the current value of a Lisp Variable, use 'pv variable'. | |||
| 250 | These commands send their output to stderr; if that is closed or | 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. | 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 | 252 | This is particularly so for Emacs invoked on MS-Windows from the |
| 253 | desktop shortcut. On GNU/Linux, you can use the command | 253 | desktop shortcut. You can use the command 'redirect-debugging-output' |
| 254 | 'redirect-debugging-output' to redirect stderr to a file. | 254 | to redirect stderr to a file. |
| 255 | 255 | ||
| 256 | 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 |
| 257 | 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 |
| @@ -208,6 +208,9 @@ permanent and documented, and may be used by Lisp programs. Its value | |||
| 208 | is a list of currently open parenthesis positions, starting with the | 208 | is a list of currently open parenthesis positions, starting with the |
| 209 | outermost parenthesis. | 209 | outermost parenthesis. |
| 210 | 210 | ||
| 211 | ** The function 'redirect-debugging-output' now works on platforms | ||
| 212 | other than GNU/Linux. | ||
| 213 | |||
| 211 | 214 | ||
| 212 | * Changes in Emacs 25.2 on Non-Free Operating Systems | 215 | * Changes in Emacs 25.2 on Non-Free Operating Systems |
| 213 | 216 | ||