From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.bugs Subject: bug#59213: Emacs 29: Edebug fails to instrument a parameter whose name begins with _ Date: Mon, 14 Nov 2022 10:28:29 +0000 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21256"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 59213@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Nov 15 01:35:06 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oujus-0005N7-F0 for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 15 Nov 2022 01:35:06 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ouip0-0001H3-Hk; Mon, 14 Nov 2022 18:24:58 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ouig7-0006Ib-MZ for bug-gnu-emacs@gnu.org; Mon, 14 Nov 2022 18:15:49 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ouWi7-00023G-RN for bug-gnu-emacs@gnu.org; Mon, 14 Nov 2022 05:29:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ouWi6-0005VO-3l for bug-gnu-emacs@gnu.org; Mon, 14 Nov 2022 05:29:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 14 Nov 2022 10:29:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 59213 X-GNU-PR-Package: emacs Original-Received: via spool by 59213-submit@debbugs.gnu.org id=B59213.166842171921131 (code B ref 59213); Mon, 14 Nov 2022 10:29:02 +0000 Original-Received: (at 59213) by debbugs.gnu.org; 14 Nov 2022 10:28:39 +0000 Original-Received: from localhost ([127.0.0.1]:48963 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ouWhj-0005Uk-0E for submit@debbugs.gnu.org; Mon, 14 Nov 2022 05:28:39 -0500 Original-Received: from mx3.muc.de ([193.149.48.5]:60400) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ouWhg-0005UX-LZ for 59213@debbugs.gnu.org; Mon, 14 Nov 2022 05:28:37 -0500 Original-Received: (qmail 42307 invoked by uid 3782); 14 Nov 2022 11:28:30 +0100 Original-Received: from acm.muc.de (p4fe15810.dip0.t-ipconnect.de [79.225.88.16]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Mon, 14 Nov 2022 11:28:29 +0100 Original-Received: (qmail 4599 invoked by uid 1000); 14 Nov 2022 10:28:29 -0000 Content-Disposition: inline In-Reply-To: X-Submission-Agent: TMDA/1.3.x (Ph3nix) X-Primary-Address: acm@muc.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:247865 Archived-At: Hello, Stefan. On Sun, Nov 13, 2022 at 22:53:12 -0500, Stefan Monnier wrote: > > In Emacs 29 (not started with -Q, but...), > > I instrumented for edebug a function which looked like: > > (defun c-trim-found-types (beg end _old-len) ....) > > , the compilation being with lexical-binding: t. > > During the edebug session, I attempted > > e _old-len RET. > The behavior depends on where you are in the *Backtrace* buffer, because > each line in the backtrace can be in a different lexical scope. > So please clarify on which line you were when you did the above. I wasn't in the backtrace. I was stepping through the code in edebug. More precisely, with this defun: (defun add (a b _c) (+ a b)) , instrument it for edebug. Call M-: (add 1 2 6). The source code with active edebug now looks like: (defun add (a b _c) =>(+ a b)) .. e a now returns 1. e b returns 2. e _c gives the error message: Error: Symbol's value as variable is void: _c .. I repeat, this is a bug. It should have returned 6. > > Instead of giving me the value of _old-len (which was 3) it gave the > > error message > > Error: Symbol's value as variable is void: _old-len > > .. This is a bug. > Could be. Or could be that you were trying to use `_old-len` in > a lexical context where there is no such variable. _c is in the same lexical context as a and b, surely? > > Just because a function doesn't use a particular argument (here > I think the leading underscore is purely incidental and you'd get the > same behavior with `beg` and `end`. No, beg and end returned their values. I admit I'm speculating about the leading underscore, but I still say there's a bug, somewhere here. > Stefan -- Alan Mackenzie (Nuremberg, Germany).