diff src/eval.c @ 1130:ccd0667b4764

[xemacs-hg @ 2002-11-30 08:10:24 by ben] To: xemacs-patches@xemacs.org eval.c: Fix up C debugger entrance -- first output the error message, then stack trace, then exiting message, then force debugger. frame-msw.c: Use EQ not EQUAL to avoid QUIT tripping. toolbar-msw.c: Indentation fixes.
author ben
date Sat, 30 Nov 2002 08:10:26 +0000
parents 37bdd24225ef
children e22b0213b713
line wrap: on
line diff
--- a/src/eval.c	Fri Nov 29 22:53:04 2002 +0000
+++ b/src/eval.c	Sat Nov 30 08:10:26 2002 +0000
@@ -660,6 +660,20 @@
   return Fbacktrace (stream, Qt);
 }
 
+#ifdef DEBUG_XEMACS
+
+static void
+trace_out_and_die (Lisp_Object err)
+{
+  Fdisplay_error (err, Qt);
+  backtrace_259 (Qnil);
+  stderr_out ("XEmacs exiting to debugger.\n");
+  Fforce_debugging_signal (Qt);
+  /* Unlikely to be reached */
+}
+
+#endif
+
 /* An error was signaled.  Maybe call the debugger, if the `debug-on-error'
    etc. variables call for this.  CONDITIONS is the list of conditions
    associated with the error being signalled.  SIG is the actual error
@@ -748,16 +762,16 @@
     {
       debug_on_quit &= ~2;	/* reset critical bit */
 
-#ifdef DEBUG_XEMACS
-      if (noninteractive)
-	Fforce_debugging_signal (Qt);
-#endif
-
       specbind (Qdebug_on_error,	Qnil);
       specbind (Qstack_trace_on_error,	Qnil);
       specbind (Qdebug_on_signal,	Qnil);
       specbind (Qstack_trace_on_signal, Qnil);
 
+#ifdef DEBUG_XEMACS
+      if (noninteractive)
+	trace_out_and_die (Fcons (sig, data));
+#endif
+
       val = call_debugger (list2 (Qerror, (Fcons (sig, data))));
       unbind_to (speccount);
       *debugger_entered = 1;
@@ -789,16 +803,16 @@
     {
       debug_on_quit &= ~2;	/* reset critical bit */
 
-#ifdef DEBUG_XEMACS
-      if (noninteractive)
-	Fforce_debugging_signal (Qt);
-#endif
-
       specbind (Qdebug_on_error,	Qnil);
       specbind (Qstack_trace_on_error,	Qnil);
       specbind (Qdebug_on_signal,	Qnil);
       specbind (Qstack_trace_on_signal, Qnil);
 
+#ifdef DEBUG_XEMACS
+      if (noninteractive)
+	trace_out_and_die (Fcons (sig, data));
+#endif
+
       val = call_debugger (list2 (Qerror, (Fcons (sig, data))));
       *debugger_entered = 1;
     }