comparison 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
comparison
equal deleted inserted replaced
1129:dcfac2888bf3 1130:ccd0667b4764
658 backtrace_259 (Lisp_Object stream) 658 backtrace_259 (Lisp_Object stream)
659 { 659 {
660 return Fbacktrace (stream, Qt); 660 return Fbacktrace (stream, Qt);
661 } 661 }
662 662
663 #ifdef DEBUG_XEMACS
664
665 static void
666 trace_out_and_die (Lisp_Object err)
667 {
668 Fdisplay_error (err, Qt);
669 backtrace_259 (Qnil);
670 stderr_out ("XEmacs exiting to debugger.\n");
671 Fforce_debugging_signal (Qt);
672 /* Unlikely to be reached */
673 }
674
675 #endif
676
663 /* An error was signaled. Maybe call the debugger, if the `debug-on-error' 677 /* An error was signaled. Maybe call the debugger, if the `debug-on-error'
664 etc. variables call for this. CONDITIONS is the list of conditions 678 etc. variables call for this. CONDITIONS is the list of conditions
665 associated with the error being signalled. SIG is the actual error 679 associated with the error being signalled. SIG is the actual error
666 being signalled, and DATA is the associated data (these are exactly 680 being signalled, and DATA is the associated data (these are exactly
667 the same as the arguments to `signal'). ACTIVE_HANDLERS is the 681 the same as the arguments to `signal'). ACTIVE_HANDLERS is the
746 : wants_debugger (Vdebug_on_error, conditions)) 760 : wants_debugger (Vdebug_on_error, conditions))
747 && !skip_debugger (conditions, temp_data)) 761 && !skip_debugger (conditions, temp_data))
748 { 762 {
749 debug_on_quit &= ~2; /* reset critical bit */ 763 debug_on_quit &= ~2; /* reset critical bit */
750 764
751 #ifdef DEBUG_XEMACS
752 if (noninteractive)
753 Fforce_debugging_signal (Qt);
754 #endif
755
756 specbind (Qdebug_on_error, Qnil); 765 specbind (Qdebug_on_error, Qnil);
757 specbind (Qstack_trace_on_error, Qnil); 766 specbind (Qstack_trace_on_error, Qnil);
758 specbind (Qdebug_on_signal, Qnil); 767 specbind (Qdebug_on_signal, Qnil);
759 specbind (Qstack_trace_on_signal, Qnil); 768 specbind (Qstack_trace_on_signal, Qnil);
769
770 #ifdef DEBUG_XEMACS
771 if (noninteractive)
772 trace_out_and_die (Fcons (sig, data));
773 #endif
760 774
761 val = call_debugger (list2 (Qerror, (Fcons (sig, data)))); 775 val = call_debugger (list2 (Qerror, (Fcons (sig, data))));
762 unbind_to (speccount); 776 unbind_to (speccount);
763 *debugger_entered = 1; 777 *debugger_entered = 1;
764 } 778 }
787 ? debug_on_quit 801 ? debug_on_quit
788 : wants_debugger (Vdebug_on_signal, conditions))) 802 : wants_debugger (Vdebug_on_signal, conditions)))
789 { 803 {
790 debug_on_quit &= ~2; /* reset critical bit */ 804 debug_on_quit &= ~2; /* reset critical bit */
791 805
792 #ifdef DEBUG_XEMACS
793 if (noninteractive)
794 Fforce_debugging_signal (Qt);
795 #endif
796
797 specbind (Qdebug_on_error, Qnil); 806 specbind (Qdebug_on_error, Qnil);
798 specbind (Qstack_trace_on_error, Qnil); 807 specbind (Qstack_trace_on_error, Qnil);
799 specbind (Qdebug_on_signal, Qnil); 808 specbind (Qdebug_on_signal, Qnil);
800 specbind (Qstack_trace_on_signal, Qnil); 809 specbind (Qstack_trace_on_signal, Qnil);
810
811 #ifdef DEBUG_XEMACS
812 if (noninteractive)
813 trace_out_and_die (Fcons (sig, data));
814 #endif
801 815
802 val = call_debugger (list2 (Qerror, (Fcons (sig, data)))); 816 val = call_debugger (list2 (Qerror, (Fcons (sig, data))));
803 *debugger_entered = 1; 817 *debugger_entered = 1;
804 } 818 }
805 819