aboutsummaryrefslogtreecommitdiffstats
path: root/src/eval.c
diff options
context:
space:
mode:
authorNoam Postavsky2019-04-08 17:57:22 -0400
committerNoam Postavsky2019-04-14 22:43:38 -0400
commit9800df69cb7003bda1f2b98d6f11e89ba95afb9b (patch)
tree8de5b8b10e6a0743b7f227bef6bf87ffdb98ed4a /src/eval.c
parentfc0f469fb5b5eb28ca4d9948190be6cb1bd8156e (diff)
downloademacs-9800df69cb7003bda1f2b98d6f11e89ba95afb9b.tar.gz
emacs-9800df69cb7003bda1f2b98d6f11e89ba95afb9b.zip
Let debugger handle process spawn errors on w32 (Bug#33016)
Since child_setup() is called between block_input()...unblock_input(), when an error is signaled the Lisp debugger is prevented from starting. Therefore, let the callers signal the error instead (which they already do for non-w32 platforms, just the error message needs an update). * src/callproc.c (child_setup) [WINDOWSNT]: Don't call report_file_error here. (call_process) [WINDOWNT]: * src/process.c (create_process) [WINDOWSNT]: Call report_file_errno here instead, after the unblock_input() call, same as for !WINDOWSNT. * src/lisp.h (CHILD_SETUP_ERROR_DESC): New preprocessor define. Flip the containing ifndef DOS_NT branches so that it's ifdef DOS_NT. * src/eval.c (when_entered_debugger): Remove. (syms_of_eval) <internal-when-entered-debugger>: Define it as a Lisp integer variable instead. (maybe_call_debugger): Update comment. * test/src/process-tests.el (make-process-w32-debug-spawn-error): * test/src/callproc-tests.el (call-process-w32-debug-spawn-error): New tests.
Diffstat (limited to 'src/eval.c')
-rw-r--r--src/eval.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/src/eval.c b/src/eval.c
index e9f118c5cb9..fa7b2d06031 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -52,15 +52,6 @@ Lisp_Object Vautoload_queue;
52 is shutting down. */ 52 is shutting down. */
53Lisp_Object Vrun_hooks; 53Lisp_Object Vrun_hooks;
54 54
55/* The value of num_nonmacro_input_events as of the last time we
56 started to enter the debugger. If we decide to enter the debugger
57 again when this is still equal to num_nonmacro_input_events, then we
58 know that the debugger itself has an error, and we should just
59 signal the error instead of entering an infinite loop of debugger
60 invocations. */
61
62static intmax_t when_entered_debugger;
63
64/* The function from which the last `signal' was called. Set in 55/* The function from which the last `signal' was called. Set in
65 Fsignal. */ 56 Fsignal. */
66/* FIXME: We should probably get rid of this! */ 57/* FIXME: We should probably get rid of this! */
@@ -1835,7 +1826,8 @@ maybe_call_debugger (Lisp_Object conditions, Lisp_Object sig, Lisp_Object data)
1835 ? debug_on_quit 1826 ? debug_on_quit
1836 : wants_debugger (Vdebug_on_error, conditions)) 1827 : wants_debugger (Vdebug_on_error, conditions))
1837 && ! skip_debugger (conditions, combined_data) 1828 && ! skip_debugger (conditions, combined_data)
1838 /* RMS: What's this for? */ 1829 /* See commentary on definition of
1830 `internal-when-entered-debugger'. */
1839 && when_entered_debugger < num_nonmacro_input_events) 1831 && when_entered_debugger < num_nonmacro_input_events)
1840 { 1832 {
1841 call_debugger (list2 (Qerror, combined_data)); 1833 call_debugger (list2 (Qerror, combined_data));
@@ -4170,6 +4162,18 @@ Note that `debug-on-error', `debug-on-quit' and friends
4170still determine whether to handle the particular condition. */); 4162still determine whether to handle the particular condition. */);
4171 Vdebug_on_signal = Qnil; 4163 Vdebug_on_signal = Qnil;
4172 4164
4165 /* The value of num_nonmacro_input_events as of the last time we
4166 started to enter the debugger. If we decide to enter the debugger
4167 again when this is still equal to num_nonmacro_input_events, then we
4168 know that the debugger itself has an error, and we should just
4169 signal the error instead of entering an infinite loop of debugger
4170 invocations. */
4171 DEFSYM (Qinternal_when_entered_debugger, "internal-when-entered-debugger");
4172 DEFVAR_INT ("internal-when-entered-debugger", when_entered_debugger,
4173 doc: /* The number of keyboard events as of last time `debugger' was called.
4174Used to avoid infinite loops if the debugger itself has an error.
4175Don't set this unless you're sure that can't happen. */);
4176
4173 /* When lexical binding is being used, 4177 /* When lexical binding is being used,
4174 Vinternal_interpreter_environment is non-nil, and contains an alist 4178 Vinternal_interpreter_environment is non-nil, and contains an alist
4175 of lexically-bound variable, or (t), indicating an empty 4179 of lexically-bound variable, or (t), indicating an empty