From xemacs-m  Mon Feb  3 22:34:20 1997
Received: from crystal.WonderWorks.COM (crystal.WonderWorks.com [192.203.206.1])
	by xemacs.org (8.8.5/8.8.5) with ESMTP id WAA26727;
	Mon, 3 Feb 1997 22:34:18 -0600 (CST)
Received: by crystal.WonderWorks.COM 
	id QQcbju16702; Mon, 3 Feb 1997 23:34:18 -0500 (EST)
Date: Mon, 3 Feb 1997 23:34:18 -0500 (EST)
Message-Id: <QQcbju16702.199702040434@crystal.WonderWorks.COM>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
From: Kyle Jones <kyle_jones@wonderworks.com>
To: xemacs-beta-patches@xemacs.org
Cc: xemacs-beta@xemacs.org
Subject: [PATCH] 20.0: debugger continues too much

This has been a bug in XEmacs for as long as I can remember.
When you're using the Lisp debugger and hit `c' to execute a
frame to completion you could never get the debugger to step
through a function again.  Every `d' thereafter acted like `c'
until all the stack frames were popped off.  If you enetered the
debugger again `d' worked normally until you hit `c' then you
could forget about using `d' working properly.

Tonight I could stand it no logner.  So despite /brain being
nearly full I learned enough about the Lisp debugger to find and
fix this bug.

The fix comments out two lines in do_debug_on_exit in src/eval.c
that save and restore the value of debug-on-next-call.  What the
code is trying to do is wrong.  The debugger will set the value
of debug-on-next-call based on whether the user hits `d' or `c'.
Restoring the old value makes the system ignore what the user
told it to do.

*** 1.1 1997/02/04 04:09:56
--- src/eval.c  1997/02/04 04:11:07
***************
*** 403,411 ****
  do_debug_on_exit (Lisp_Object val)
  {
    /* This is falsified by call_debugger */
!   int old_debug_on_next_call = debug_on_next_call;
    Lisp_Object v = call_debugger (list2 (Qexit, val));
!   debug_on_next_call = old_debug_on_next_call;
    return ((!UNBOUNDP (v)) ? v : val);
  }
  
--- 403,411 ----
  do_debug_on_exit (Lisp_Object val)
  {
    /* This is falsified by call_debugger */
!     /*int old_debug_on_next_call = debug_on_next_call;*/
    Lisp_Object v = call_debugger (list2 (Qexit, val));
!   /*debug_on_next_call = old_debug_on_next_call;*/
    return ((!UNBOUNDP (v)) ? v : val);
  }
  

