unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Re: [Emacs-commit] emacs/lisp/emacs-lisp debug.el
       [not found] <E1D5ly3-0002NX-00@savannah>
@ 2005-02-28 18:42 ` Lute Kamstra
  2005-03-01 12:16   ` Lute Kamstra
  0 siblings, 1 reply; 3+ messages in thread
From: Lute Kamstra @ 2005-02-28 18:42 UTC (permalink / raw)
  Cc: emacs-devel

Hello Stefan,

> CVSROOT:	/cvsroot/emacs
> Module name:	emacs
> Branch: 	
> Changes by:	Stefan Monnier <monnier@savannah.gnu.org>	05/02/28 14:33:50
>
> Modified files:
> 	lisp/emacs-lisp: debug.el 
>
> Log message:
> 	(inhibit-debug-on-entry): New var.
> 	(debug): Use it.  Move the inhibit-trace earlier.
> 	(debug-entry-code): New const.
> 	(debug-on-entry-1): Use it.
>
> CVSWeb URLs:
> http://savannah.gnu.org/cgi-bin/viewcvs/emacs/emacs/lisp/emacs-lisp/debug.el.diff?tr1=1.67&tr2=1.68&r1=text&r2=text

What about this patch to complete your change?  Could you also commit
a ChangeLog entry?

Regards,

  Lute.


*** lisp/emacs-lisp/debug.el    28 Feb 2005 14:33:50 -0000      1.68
--- lisp/emacs-lisp/debug.el    28 Feb 2005 18:32:00 -0000
***************
*** 189,196 ****
                  (message "%s" (buffer-string))
                  (kill-emacs))
                (if (eq (car debugger-args) 'debug)
!                   ;; Skip the frames for backtrace-debug, byte-code, and debug.
!                   (backtrace-debug 3 t))
                (debugger-reenable)
                (message "")
                (let ((standard-output nil)
--- 189,197 ----
                  (message "%s" (buffer-string))
                  (kill-emacs))
                (if (eq (car debugger-args) 'debug)
!                   ;; Skip the frames for backtrace-debug, byte-code,
!                   ;; and debug-entry-code.
!                   (backtrace-debug 4 t))
                (debugger-reenable)
                (message "")
                (let ((standard-output nil)
***************
*** 253,259 ****
    (delete-region (point)
                 (progn
                   (search-forward "\n  debug(")
!                  (forward-line 1)
                   (point)))
    (insert "Debugger entered")
    ;; lambda is for debug-on-call when a function call is next.
--- 254,262 ----
    (delete-region (point)
                 (progn
                   (search-forward "\n  debug(")
!                  (forward-line (if (eq (car debugger-args) 'debug)
!                                    2
!                                  1))
                   (point)))
    (insert "Debugger entered")
    ;; lambda is for debug-on-call when a function call is next.
***************
*** 694,700 ****
              (setq body (cons (documentation function) body)))
          (fset function (cons 'lambda (cons (car contents) body)))))))
  
! 
  (defconst debug-entry-code '(if inhibit-debug-on-entry nil (debug 'debug))
    "Code added to a function to cause it to call the debugger upon entry.")
  
--- 697,704 ----
              (setq body (cons (documentation function) body)))
          (fset function (cons 'lambda (cons (car contents) body)))))))
  
! ;; When you change this, you may also need to change the number of
! ;; frames that the debugger skips.
  (defconst debug-entry-code '(if inhibit-debug-on-entry nil (debug 'debug))
    "Code added to a function to cause it to call the debugger upon entry.")

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Emacs-commit] emacs/lisp/emacs-lisp debug.el
  2005-02-28 18:42 ` [Emacs-commit] emacs/lisp/emacs-lisp debug.el Lute Kamstra
@ 2005-03-01 12:16   ` Lute Kamstra
  2005-03-01 12:49     ` Stefan Monnier
  0 siblings, 1 reply; 3+ messages in thread
From: Lute Kamstra @ 2005-03-01 12:16 UTC (permalink / raw)
  Cc: emacs-devel

Lute Kamstra <Lute.Kamstra.lists@xs4all.nl> writes:

>> CVSROOT:	/cvsroot/emacs
>> Module name:	emacs
>> Branch: 	
>> Changes by:	Stefan Monnier <monnier@savannah.gnu.org>	05/02/28 14:33:50
>>
>> Modified files:
>> 	lisp/emacs-lisp: debug.el 
>>
>> Log message:
>> 	(inhibit-debug-on-entry): New var.
>> 	(debug): Use it.  Move the inhibit-trace earlier.
>> 	(debug-entry-code): New const.
>> 	(debug-on-entry-1): Use it.
>>
>> CVSWeb URLs:
>> http://savannah.gnu.org/cgi-bin/viewcvs/emacs/emacs/lisp/emacs-lisp/debug.el.diff?tr1=1.67&tr2=1.68&r1=text&r2=text
>
> What about this patch to complete your change?

debugger-frame-number also needed to be changed to deal with the extra
frame introduced by debug-entry-code.  Shall I commit the patch below?

Lute.


Index: lisp/ChangeLog
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/ChangeLog,v
retrieving revision 1.7043
diff -c -r1.7043 ChangeLog
*** lisp/ChangeLog	1 Mar 2005 10:41:45 -0000	1.7043
--- lisp/ChangeLog	1 Mar 2005 12:06:46 -0000
***************
*** 1,3 ****
--- 1,13 ----
+ 2005-03-01  Lute Kamstra  <lute@gnu.org>
+ 
+ 	* emacs-lisp/debug.el (debug): Skip one more frame in case of
+ 	debug on entry.
+ 	(debugger-setup-buffer): Delete one more frame line in case of
+ 	debug on entry.
+ 	(debugger-frame-number): Update to use the new text introduced by
+ 	the 1999-11-03 change.  Skip one more frame in case of debug on
+ 	entry.
+ 
  2005-03-01  Nick Roberts  <nickrob@snap.net.nz>
  
  	* progmodes/gdb-ui.el (gdb-get-location): Use a warning instead
Index: lisp/emacs-lisp/debug.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/emacs-lisp/debug.el,v
retrieving revision 1.69
diff -c -r1.69 debug.el
*** lisp/emacs-lisp/debug.el	1 Mar 2005 09:08:47 -0000	1.69
--- lisp/emacs-lisp/debug.el	1 Mar 2005 12:06:46 -0000
***************
*** 95,100 ****
--- 95,105 ----
  
  (defvar inhibit-debug-on-entry nil)
  
+ ;; When you change this, you may also need to change the number of
+ ;; frames that the debugger skips.
+ (defconst debug-entry-code '(if inhibit-debug-on-entry nil (debug 'debug))
+   "Code added to a function to cause it to call the debugger upon entry.")
+ 
  ;;;###autoload
  (setq debugger 'debug)
  ;;;###autoload
***************
*** 189,196 ****
  		  (message "%s" (buffer-string))
  		  (kill-emacs))
  		(if (eq (car debugger-args) 'debug)
! 		    ;; Skip the frames for backtrace-debug, byte-code, and debug.
! 		    (backtrace-debug 3 t))
  		(debugger-reenable)
  		(message "")
  		(let ((standard-output nil)
--- 194,202 ----
  		  (message "%s" (buffer-string))
  		  (kill-emacs))
  		(if (eq (car debugger-args) 'debug)
! 		    ;; Skip the frames for backtrace-debug, byte-code,
! 		    ;; and debug-entry-code.
! 		    (backtrace-debug 4 t))
  		(debugger-reenable)
  		(message "")
  		(let ((standard-output nil)
***************
*** 253,259 ****
    (delete-region (point)
  		 (progn
  		   (search-forward "\n  debug(")
! 		   (forward-line 1)
  		   (point)))
    (insert "Debugger entered")
    ;; lambda is for debug-on-call when a function call is next.
--- 259,267 ----
    (delete-region (point)
  		 (progn
  		   (search-forward "\n  debug(")
! 		   (forward-line (if (eq (car debugger-args) 'debug)
! 				     2	; Remove debug-entry-code frame.
! 				   1))
  		   (point)))
    (insert "Debugger entered")
    ;; lambda is for debug-on-call when a function call is next.
***************
*** 426,439 ****
  	  (count 0))
        (while (not (eq (cadr (backtrace-frame count)) 'debug))
  	(setq count (1+ count)))
        (goto-char (point-min))
!       (if (or (equal (buffer-substring (point) (+ (point) 6))
! 		     "Signal")
! 	      (equal (buffer-substring (point) (+ (point) 6))
! 		     "Return"))
! 	  (progn
! 	    (search-forward ":")
! 	    (forward-sexp 1)))
        (forward-line 1)
        (while (progn
  	       (forward-char 2)
--- 434,446 ----
  	  (count 0))
        (while (not (eq (cadr (backtrace-frame count)) 'debug))
  	(setq count (1+ count)))
+       ;; Skip debug-entry-code frame.
+       (when (member '(debug (quote debug)) (cdr (backtrace-frame (1+ count))))
+ 	(setq count (1+ count)))
        (goto-char (point-min))
!       (when (looking-at "Debugger entered--\\(Lisp error\\|returning value\\):")
! 	(goto-char (match-end 0))
! 	(forward-sexp 1))
        (forward-line 1)
        (while (progn
  	       (forward-char 2)
***************
*** 692,700 ****
  	      (setq body (cons (documentation function) body)))
  	  (fset function (cons 'lambda (cons (car contents) body)))))))
  
- (defconst debug-entry-code '(if inhibit-debug-on-entry nil (debug 'debug))
-   "Code added to a function to cause it to call the debugger upon entry.")
- 
  (defun debug-on-entry-1 (function defn flag)
    (if (subrp defn)
        (error "%s is a built-in function" function)
--- 699,704 ----

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Emacs-commit] emacs/lisp/emacs-lisp debug.el
  2005-03-01 12:16   ` Lute Kamstra
@ 2005-03-01 12:49     ` Stefan Monnier
  0 siblings, 0 replies; 3+ messages in thread
From: Stefan Monnier @ 2005-03-01 12:49 UTC (permalink / raw)
  Cc: emacs-devel

> debugger-frame-number also needed to be changed to deal with the extra
> frame introduced by debug-entry-code.  Shall I commit the patch below?

Feel free,


        Stefan

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2005-03-01 12:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <E1D5ly3-0002NX-00@savannah>
2005-02-28 18:42 ` [Emacs-commit] emacs/lisp/emacs-lisp debug.el Lute Kamstra
2005-03-01 12:16   ` Lute Kamstra
2005-03-01 12:49     ` Stefan Monnier

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).