From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#59213: Emacs 29: Edebug fails to instrument a parameter whose name begins with _ Date: Mon, 20 Feb 2023 17:21:20 -0500 Message-ID: References: Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10315"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 59213@debbugs.gnu.org To: Alan Mackenzie Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Feb 20 23:22:23 2023 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 1pUEYB-0002RF-2N for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 20 Feb 2023 23:22:23 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pUEXv-0006t6-NY; Mon, 20 Feb 2023 17:22:07 -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 1pUEXr-0006rV-DI for bug-gnu-emacs@gnu.org; Mon, 20 Feb 2023 17:22:04 -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 1pUEXr-0005nb-0f for bug-gnu-emacs@gnu.org; Mon, 20 Feb 2023 17:22:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pUEXq-0007zU-HR for bug-gnu-emacs@gnu.org; Mon, 20 Feb 2023 17:22:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 20 Feb 2023 22:22: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.167693169430682 (code B ref 59213); Mon, 20 Feb 2023 22:22:02 +0000 Original-Received: (at 59213) by debbugs.gnu.org; 20 Feb 2023 22:21:34 +0000 Original-Received: from localhost ([127.0.0.1]:53872 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pUEXN-0007yn-Jo for submit@debbugs.gnu.org; Mon, 20 Feb 2023 17:21:33 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:40906) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pUEXJ-0007yY-PY for 59213@debbugs.gnu.org; Mon, 20 Feb 2023 17:21:31 -0500 Original-Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id D1B361000DC; Mon, 20 Feb 2023 17:21:23 -0500 (EST) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 1DD2A100098; Mon, 20 Feb 2023 17:21:22 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1676931682; bh=BloaaBM7zotFYsImpYU+jjdgDzq2RmrxM5tXhLzrA0k=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=U7z/sv0VcxS3Mi6AwFIPEDRcMRAMWeu+vwgGf/U+P+PW/UTJx3Nna3JBM9L72I31e 4QIOrCnuSMcw3rqsMnJKgKBUNAtWjDa8uBse/a6Ycdl0m2FwEG0tY/61M/zm5qcx1n HsyZ90r5QTeqFFDWxjfs1s1HE05lHa5ZRQWKV8TUipXbtZ5r1S7uPnIgISn0yloxl9 s6ZEhlYjmeVdMDI/jqsvuKbVwctTAvihh7Y6Yxk3HXmO4yU/Tzr2rw7vi5ecfl/IuL OSki0U0VA9V0DTT/B1M+QQggmwrtIxBPux4UnoxjfKkaK4fwkGMCMO7hmaLYuNTckR E4QdR5td/WNGA== Original-Received: from pastel (unknown [216.154.34.24]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id D6535123217; Mon, 20 Feb 2023 17:21:21 -0500 (EST) In-Reply-To: (Alan Mackenzie's message of "Sat, 18 Feb 2023 18:46:47 +0000") 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:256222 Archived-At: >> BTW, what did you mean by "This function is evaluated both at compile >> time and run time"? > > It was my state of gradually diminishing confusion (which started at a > high level) as I worked through the bug. It took me some while before it > occurred to me that the creation of closures was happening at run time, > not compile time. Of course, it's got to, because the lexical > environment only exists at run time. But I would have got through all > this faster if there had been a comment saying > cconv-make-interpreted-closure is called at run time. So I put such a > comment in for the next highly confused hacker. Thanks. I found that part more confusing, so I reworked it in a way that I hope doesn't make it too much worse. > As for the "at compile time", I saw this happening whilst I was running > things in gdb. I'm not actually sure about this anymore, since these > calls to c-m-i-closure might well have been run time for bits of the > compiler, not compile time. That'd be my guess, yes. Tho it can also be due to execution of (not yet byte-compiled) macros. > Thanks. I'm not sure what advantages this approach has, but it certainly > gets rid of the ugly cconv-dont-trim-unused-variables. Getting rid of the dynamically scoped `cconv-dont-trim-unused-variables` is the whole point. In theory it's also "more correct" since it marks the actual lambdas for which we care to preserve the full environment, regardless of *when* we'll manipulate it. E.g. if we ever get to byte-compile the Edebug-instrumented code, the compiler will get to see this marker so it can do the right thing, whereas it wouldn't see the `cconv-dont-trim-unused-variables` because that war was only active when the code was actually executed [ Of course, this is moot in practice since the byte-compiler currently doesn't know what to do with this marker. ] Stefan