From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Problems with debug-on-entry in the Lisp debugger. Date: Tue, 08 Mar 2005 13:59:22 -0500 Message-ID: References: <87sm37n2bv.fsf@xs4all.nl> <87is42c8yp.fsf@xs4all.nl> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1110323059 11287 80.91.229.2 (8 Mar 2005 23:04:19 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 8 Mar 2005 23:04:19 +0000 (UTC) Cc: rms@gnu.org, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Mar 09 00:04:19 2005 Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1D8k6m-0004OB-Ti for ged-emacs-devel@m.gmane.org; Tue, 08 Mar 2005 20:11:09 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1D8kLI-00032H-Sn for ged-emacs-devel@m.gmane.org; Tue, 08 Mar 2005 14:26:08 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1D8kFq-0002NE-El for emacs-devel@gnu.org; Tue, 08 Mar 2005 14:20:30 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1D8kFf-0002Id-T8 for emacs-devel@gnu.org; Tue, 08 Mar 2005 14:20:20 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1D8kFc-0002GV-SX for emacs-devel@gnu.org; Tue, 08 Mar 2005 14:20:16 -0500 Original-Received: from [132.204.24.67] (helo=mercure.iro.umontreal.ca) by monty-python.gnu.org with esmtp (Exim 4.34) id 1D8jvb-0004ln-8t; Tue, 08 Mar 2005 13:59:35 -0500 Original-Received: from hidalgo.iro.umontreal.ca (hidalgo.iro.umontreal.ca [132.204.27.50]) by mercure.iro.umontreal.ca (Postfix) with ESMTP id 04B6434000C; Tue, 8 Mar 2005 13:59:35 -0500 (EST) Original-Received: from asado.iro.umontreal.ca (asado.iro.umontreal.ca [132.204.24.84]) by hidalgo.iro.umontreal.ca (Postfix) with ESMTP id 575494AC257; Tue, 8 Mar 2005 13:59:23 -0500 (EST) Original-Received: by asado.iro.umontreal.ca (Postfix, from userid 20848) id 322764BCF2; Tue, 8 Mar 2005 13:59:23 -0500 (EST) Original-To: Lute Kamstra In-Reply-To: <87is42c8yp.fsf@xs4all.nl> (Lute Kamstra's message of "Tue, 08 Mar 2005 19:02:06 +0100") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) X-DIRO-MailScanner-Information: Please contact the ISP for more information X-DIRO-MailScanner: Found to be clean X-DIRO-MailScanner-SpamCheck: n'est pas un polluriel, SpamAssassin (score=-4.816, requis 5, autolearn=not spam, AWL 0.08, BAYES_00 -4.90) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org X-MailScanner-To: ged-emacs-devel@m.gmane.org Xref: news.gmane.org gmane.emacs.devel:34347 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:34347 > This gives a backtrace like this: > ------ Buffer: *Backtrace* ------ > Debugger entered--entering a function: > * (lambda (var) (if (or inhibit-debug-on-entry debugger-jumping-flag) nil (debug ...)) (list (quote setq) var (list ... var)))(x) > (inc x) > (progn (setq x 0) (inc x)) > eval((progn (setq x 0) (inc x))) > eval-last-sexp-1(nil) > eval-last-sexp(nil) > call-interactively(eval-last-sexp) > ------ Buffer: *Backtrace* ------ > where you can see the debug-entry-code (if (or inhibit-debug-on-entry > debugger-jumping-flag) nil (debug ...)). I would prefer to hide the > internals of the debugger from its users. debug.el already hides its internals. See debugger-setup-buffer. It just has to be updated to hide this part of the internals. > You proposed to change defun, defsubst, defalias and defmacro to add > debug-entry-code when their argument was in debug-function-list. That > is a similarly big change. There's no need to do that. The hooks are already present for defadvice, so we should simply use them. Better yet, we should use defadvice directly: (defadvice (before debug-on-entry activate) (if inhibit-debug-on-entry nil (debug 'debug))) This will properly survive function redefinitions. Stefan