From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Toby Cubitt Newsgroups: gmane.emacs.bugs Subject: bug#12685: 24.2; lexical binding breaks edebug conditional breakpoints Date: Fri, 19 Oct 2012 21:18:06 +0200 Message-ID: <20121019191806.GA23820@c3po> Reply-To: Toby Cubitt NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1350674325 24041 80.91.229.3 (19 Oct 2012 19:18:45 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 19 Oct 2012 19:18:45 +0000 (UTC) To: 12685@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Oct 19 21:18:53 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TPI5k-0002js-Hj for geb-bug-gnu-emacs@m.gmane.org; Fri, 19 Oct 2012 21:18:44 +0200 Original-Received: from localhost ([::1]:51847 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TPI5d-0004oe-8n for geb-bug-gnu-emacs@m.gmane.org; Fri, 19 Oct 2012 15:18:37 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:36685) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TPI5Z-0004oN-7r for bug-gnu-emacs@gnu.org; Fri, 19 Oct 2012 15:18:34 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TPI5X-00050G-P6 for bug-gnu-emacs@gnu.org; Fri, 19 Oct 2012 15:18:33 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:41849) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TPI5X-000503-Lr for bug-gnu-emacs@gnu.org; Fri, 19 Oct 2012 15:18:31 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1TPI70-0005gq-6N for bug-gnu-emacs@gnu.org; Fri, 19 Oct 2012 15:20:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Toby Cubitt Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 19 Oct 2012 19:20:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 12685 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.135067438621845 (code B ref -1); Fri, 19 Oct 2012 19:20:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 19 Oct 2012 19:19:46 +0000 Original-Received: from localhost ([127.0.0.1]:52100 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TPI6k-0005gH-1C for submit@debbugs.gnu.org; Fri, 19 Oct 2012 15:19:46 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:45632) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TPI6g-0005g3-NG for submit@debbugs.gnu.org; Fri, 19 Oct 2012 15:19:44 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TPI56-0004rL-1b for submit@debbugs.gnu.org; Fri, 19 Oct 2012 15:18:06 -0400 Original-Received: from lists.gnu.org ([208.118.235.17]:33017) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TPI55-0004rH-Uc for submit@debbugs.gnu.org; Fri, 19 Oct 2012 15:18:03 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:36399) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TPI54-0004gz-F2 for bug-gnu-emacs@gnu.org; Fri, 19 Oct 2012 15:18:03 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TPI52-0004oY-LK for bug-gnu-emacs@gnu.org; Fri, 19 Oct 2012 15:18:02 -0400 Original-Received: from sanddollar.geekisp.com ([216.168.135.167]:16408) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1TPI52-0004n4-Fo for bug-gnu-emacs@gnu.org; Fri, 19 Oct 2012 15:18:00 -0400 Original-Received: (qmail 30104 invoked by uid 1003); 19 Oct 2012 19:17:56 -0000 Original-Received: from localhost (localhost.geekisp.com [127.0.0.1]) by localhost.geekisp.com (tmda-ofmipd) with ESMTP; Fri, 19 Oct 2012 15:17:54 -0400 Content-Disposition: inline X-PGP-Key: http://www.dr-qubit.org/gpg-toby.asc User-Agent: Mutt/1.5.21 (2010-09-15) X-Delivery-Agent: TMDA/1.1.11 (Ladyburn) X-Primary-Address: toby@dr-qubit.org X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 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.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:65756 Archived-At: Conditional breakpoints whose condition refers to a lexically-scoped variable fail with a "Symbol's value as variable is void" error. This is almost certainly caused by the same issue as http://thread.gmane.org/gmane.emacs.devel/150556 That report mentioned that inspecting lexical variables during an edebug session using M-: doesn't work. It seems worth pointing out that this issue also makes conditional breakpoints almost useless. (The break condition will depend on local variables 9 times out of 10.) I searched and couldn't find an existing bug for this, so I'm creating one to track the issue. It seems to me that both these breakages are bugs, not just missing features. The Edebug/Evaluation section of the Elisp manual contains: `M-: EXP ' Evaluate expression EXP in the context of Edebug itself (`eval-expression'). I'm not clear on precisely what "in the context of Edebug itself" implies, but it seems to me to strongly suggest that M-: should let you inspect the values of local variables. The Edebug/Breaks/Breakpoints section states: A "conditional breakpoint" tests a condition each time the program gets there. Any errors that occur as a result of evaluating the condition are ignored, as if the result were `nil'. The current behaviour definitely contradicts this. Not only does the breakpoint not work, the error is not "ignored and treated as if the result were nil", but instead aborts execution. If this can't be fixed before the next release, at the very least the Edebug section of the manual should be fixed to document that these features currently don't work in lexically-scoped code. I'd advocate fixing both bugs before the next release, even in feature-freeze, since edebug is currently crippled in lexically-scoped code. But it seems clear that this need C level changes, and I'm not expert enough to produce a patch. (Pedantic) steps to reproduce: 1. Create a file with the following contents: ================================================== (defun test () (let ((x 0)) (while (< x 10) (setq x (1+ x0))))) ================================================== 2. Open the file in a buffer, and do: "M-: (setq lexical-binding t)" 3. Instrument the function for edebug (C-u C-M-x) 4. Create a conditional breakpoint (C-x X x) anywhere inside the loop 5. Set the breakpoint condition: "(= x 5)" 6. M-: (test) Emacs aborts executing the function with: Symbol's value as variable is void: x The expected result is obviously for the function to run until x is equal to 5. Cheers, Toby In GNU Emacs 24.2.1 (i686-pc-linux-gnu, GTK+ Version 2.24.10) of 2012-09-03 on c3po Windowing system distributor `The X.Org Foundation', version 11.0.11202000 Configured using: `configure '--prefix=/usr' '--host=i686-pc-linux-gnu' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--datadir=/usr/share' '--sysconfdir=/etc' '--localstatedir=/var/lib' '--disable-dependency-tracking' '--program-suffix=-emacs-24' '--infodir=/usr/share/info/emacs-24' '--enable-locallisppath=/etc/emacs:/usr/share/emacs/site-lisp' '--with-crt-dir=/usr/lib/gcc/i686-pc-linux-gnu/4.5.3/../../../../lib' '--with-gameuser=games' '--without-compress-info' '--disable-maintainer-mode' '--without-hesiod' '--without-kerberos' '--without-kerberos5' '--with-gpm' '--with-dbus' '--without-gnutls' '--without-xml2' '--without-selinux' '--without-wide-int' '--without-sound' '--with-x' '--without-ns' '--without-gconf' '--without-gsettings' '--with-toolkit-scroll-bars' '--without-gif' '--without-jpeg' '--without-png' '--without-rsvg' '--without-tiff' '--with-xpm' '--without-imagemagick' '--with-xft' '--without-libotf' '--without-m17n-flt' '--with-x-toolkit=gtk' 'GENTOO_PACKAGE=app-editors/emacs-24.2' '--build=i686-pc-linux-gnu' 'build_alias=i686-pc-linux-gnu' 'host_alias=i686-pc-linux-gnu' 'CFLAGS=-march=prescott -O2 -pipe -O2' 'LDFLAGS=-Wl,-O1 -Wl,--as-needed' 'CPPFLAGS='' Important settings: value of $LC_ALL: nil value of $LC_COLLATE: nil value of $LC_CTYPE: nil value of $LC_MESSAGES: nil value of $LC_MONETARY: nil value of $LC_NUMERIC: nil value of $LC_TIME: nil value of $LANG: en_GB.utf-8 value of $XMODIFIERS: nil locale-coding-system: utf-8-unix default enable-multibyte-characters: t -- Dr T. S. Cubitt Mathematics and Quantum Information group Department of Mathematics Complutense University Madrid, Spain email: tsc25@cantab.net web: www.dr-qubit.org