From: Helmut Eller <eller.helmut@gmail.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: 15101@debbugs.gnu.org
Subject: bug#15101: 24.3.50; debugger-eval-expression broken
Date: Fri, 16 Aug 2013 07:27:23 +0200 [thread overview]
Message-ID: <m2vc36b3yc.fsf@gmail.com> (raw)
In-Reply-To: <jwveh9uaedl.fsf-monnier+emacs@gnu.org> (Stefan Monnier's message of "Thu, 15 Aug 2013 16:30:13 -0400")
On Thu, Aug 15 2013, Stefan Monnier wrote:
>> What does "context" mean?
>
> That which is *around*.
>
>> Intuitively I would say that in the second
>> line, ie. the one that looks like "(let ((foo 123)) (debug))", foo is
>> part of the context.
>
> The context in which (let ((foo 123)) (debug)) does not include (yet)
> "foo" (well, maybe it does, but that would be another "foo" than the
> one inside the let).
Consider this example:
(progn
(defun foo (n)
(cond ((= n 0) (debug))
(t (foo (1- n)))))
(byte-compile 'foo)
(foo 100))
If we go to the line "foo(10)" I would expect that n is 10. With your
definition n is 11. I would argue that your version is confusing.
>> It seems to me that a better fix would be to adjust linenumber->context
>> mapping by one.
>
> I don't think this can be done, because the semantics become very weird
> and unpredictable.
Can you give an example of what would be weird with this change:
=== modified file 'lisp/emacs-lisp/debug.el'
--- lisp/emacs-lisp/debug.el 2013-08-15 17:21:19 +0000
+++ lisp/emacs-lisp/debug.el 2013-08-16 05:22:02 +0000
@@ -547,7 +547,7 @@
(interactive
(list (read--expression "Eval in stack frame: ")))
(let ((nframe (or nframe
- (condition-case nil (1+ (debugger-frame-number 'skip-base))
+ (condition-case nil (debugger-frame-number 'skip-base)
(error 0)))) ;; If on first line.
(base (if (eq 'debug--implement-debug-on-entry
(cadr (backtrace-frame 1 'debug)))
Either way, it would be nice to document why the 1+ was there in the
first place, because it looks like a bug to me.
Helmut
next prev parent reply other threads:[~2013-08-16 5:27 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-15 11:39 bug#15101: 24.3.50; debugger-eval-expression broken Helmut Eller
2013-08-15 14:45 ` Stefan Monnier
2013-08-15 15:06 ` Drew Adams
2013-08-15 16:37 ` Stefan Monnier
2013-08-15 17:03 ` Drew Adams
2013-08-15 17:16 ` Helmut Eller
2013-08-15 20:30 ` Stefan Monnier
2013-08-16 5:27 ` Helmut Eller [this message]
2013-08-16 16:14 ` Stefan Monnier
2013-08-16 17:03 ` Helmut Eller
2013-08-15 17:21 ` Stefan Monnier
2013-08-15 17:47 ` Drew Adams
2013-08-15 20:27 ` Stefan Monnier
2013-08-15 21:12 ` Drew Adams
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m2vc36b3yc.fsf@gmail.com \
--to=eller.helmut@gmail.com \
--cc=15101@debbugs.gnu.org \
--cc=monnier@iro.umontreal.ca \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).