emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: debug-on-entry


From: Lute Kamstra
Subject: Re: debug-on-entry
Date: Mon, 13 Jun 2005 11:25:50 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

Lute Kamstra <address@hidden> writes:

>>> You can use debug-on-entry for primitive functions that are not
>>> specials forms.  You just can't step through them.  I'll fix the
>>> docs.
>>
>> Also they may be called without triggering the debugger, if they're called
>> directly from C rather than from elisp.  I.e. it's unreliable (but can
>> still be useful, I guess).
>
> I'll point that out.

What about the patch below?

Lute.


Index: lisp/emacs-lisp/debug.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/emacs-lisp/debug.el,v
retrieving revision 1.85
diff -c -r1.85 debug.el
*** lisp/emacs-lisp/debug.el    13 Jun 2005 08:13:16 -0000      1.85
--- lisp/emacs-lisp/debug.el    13 Jun 2005 09:23:19 -0000
***************
*** 656,665 ****
  ;;;###autoload
  (defun debug-on-entry (function)
    "Request FUNCTION to invoke debugger each time it is called.
  When called interactively, prompt for FUNCTION in the minibuffer.
! If you tell the debugger to continue, FUNCTION's execution proceeds.
! This works by modifying the definition of FUNCTION,
! which must be written in Lisp, not predefined.
  Use \\[cancel-debug-on-entry] to cancel the effect of this command.
  Redefining FUNCTION also cancels it."
    (interactive "aDebug on entry (to function): ")
--- 656,671 ----
  ;;;###autoload
  (defun debug-on-entry (function)
    "Request FUNCTION to invoke debugger each time it is called.
+ 
  When called interactively, prompt for FUNCTION in the minibuffer.
! 
! This works by modifying the definition of FUNCTION.  If you tell the
! debugger to continue, FUNCTION's execution proceeds.  If FUNCTION is a
! normal function or a macro written in Lisp, you can also step through
! its execution.  FUNCTION can also be a primitive that is not a special
! form, in which case stepping is not possible.  Break-on-entry for
! primitive functions only works when that function is called from Lisp.
! 
  Use \\[cancel-debug-on-entry] to cancel the effect of this command.
  Redefining FUNCTION also cancels it."
    (interactive "aDebug on entry (to function): ")
Index: lispref/debugging.texi
===================================================================
RCS file: /cvsroot/emacs/emacs/lispref/debugging.texi,v
retrieving revision 1.31
diff -c -r1.31 debugging.texi
*** lispref/debugging.texi      11 Jun 2005 23:42:13 -0000      1.31
--- lispref/debugging.texi      13 Jun 2005 09:23:20 -0000
***************
*** 210,224 ****
  function, and then step through its caller.
  
  @deffn Command debug-on-entry function-name
! This function requests @var{function-name} to invoke the debugger each time
! it is called.  It works by inserting the form @code{(debug 'debug)} into
! the function definition as the first form.
! 
! Any function defined as Lisp code may be set to break on entry,
! regardless of whether it is interpreted code or compiled code.  If the
! function is a command, it will enter the debugger when called from Lisp
! and when called interactively (after the reading of the arguments).  You
! can't debug primitive functions (i.e., those written in C) this way.
  
  When @code{debug-on-entry} is called interactively, it prompts for
  @var{function-name} in the minibuffer.  If the function is already set
--- 210,227 ----
  function, and then step through its caller.
  
  @deffn Command debug-on-entry function-name
! This function requests @var{function-name} to invoke the debugger each
! time it is called.  It works by inserting the form
! @code{(implement-debug-on-entry)} into the function definition as the
! first form.
! 
! Any function or macro defined as Lisp code may be set to break on
! entry, regardless of whether it is interpreted code or compiled code.
! If the function is a command, it will enter the debugger when called
! from Lisp and when called interactively (after the reading of the
! arguments).  You can also debug primitive functions (i.e., those
! written in C) that are not special forms this way, but the primitive
! will only break on entry when it is called from Lisp.
  
  When @code{debug-on-entry} is called interactively, it prompts for
  @var{function-name} in the minibuffer.  If the function is already set




reply via email to

[Prev in Thread] Current Thread [Next in Thread]