changeset 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 dcfac2888bf3
children f3bd8ea66435
files src/ChangeLog src/eval.c src/frame-msw.c src/toolbar-msw.c
diffstat 4 files changed, 43 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Fri Nov 29 22:53:04 2002 +0000
+++ b/src/ChangeLog	Sat Nov 30 08:10:26 2002 +0000
@@ -1,3 +1,15 @@
+2002-11-30  Ben Wing  <ben@xemacs.org>
+
+	* eval.c:
+	* eval.c (signal_call_debugger):
+	Fix up C debugger entrance -- first output the error message, then
+	stack trace, then exiting message, then force debugger.
+	
+	* frame-msw.c (mswindows_init_frame_1): Use EQ not EQUAL to avoid
+	QUIT tripping.
+	
+	* toolbar-msw.c (mswindows_clear_toolbar): Indentation fixes.
+
 2002-11-27  Ben Wing  <ben@xemacs.org>
 
 	* alloc.c:
--- 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;
     }
--- a/src/frame-msw.c	Fri Nov 29 22:53:04 2002 +0000
+++ b/src/frame-msw.c	Sat Nov 30 08:10:26 2002 +0000
@@ -149,8 +149,9 @@
   /* Misc frame stuff */
   FRAME_MSWINDOWS_MENU_HASH_TABLE (f) = Qnil;
 #ifdef HAVE_TOOLBARS
+  /* EQ not EQUAL or we will get QUIT crashes, see below. */
   FRAME_MSWINDOWS_TOOLBAR_HASH_TABLE (f) = 
-    make_lisp_hash_table (50, HASH_TABLE_NON_WEAK, HASH_TABLE_EQUAL);
+    make_lisp_hash_table (50, HASH_TABLE_NON_WEAK, HASH_TABLE_EQ);
 #endif
   /* hashtable of instantiated glyphs on the frame.  Make them EQ because
      we only use ints as keys.  Otherwise we run into stickiness in
--- a/src/toolbar-msw.c	Fri Nov 29 22:53:04 2002 +0000
+++ b/src/toolbar-msw.c	Sat Nov 30 08:10:26 2002 +0000
@@ -111,11 +111,11 @@
       i = qxeSendMessage (toolbarwnd, TB_BUTTONCOUNT, 0, 0);
       for (i--; i >= 0; i--)
 	{
-	  qxeSendMessage (toolbarwnd, TB_GETBUTTON, (WPARAM)i, 
-		       (LPARAM)&info);
-	  Fremhash(make_int(info.idCommand), 
-		   FRAME_MSWINDOWS_TOOLBAR_HASH_TABLE(f));
-	  qxeSendMessage (toolbarwnd, TB_DELETEBUTTON, (WPARAM)i, 0);
+	  qxeSendMessage (toolbarwnd, TB_GETBUTTON, (WPARAM) i,
+		       (LPARAM) &info);
+	  Fremhash (make_int (info.idCommand), 
+		    FRAME_MSWINDOWS_TOOLBAR_HASH_TABLE (f));
+	  qxeSendMessage (toolbarwnd, TB_DELETEBUTTON, (WPARAM) i, 0);
 	}
 	  
       /* finally get rid of the image list assuming it clears up its