GNU bug report logs -
#15101
24.3.50; debugger-eval-expression broken
Previous Next
Reported by: Helmut Eller <eller.helmut <at> gmail.com>
Date: Thu, 15 Aug 2013 11:41:02 UTC
Severity: normal
Found in version 24.3.50
Done: Stefan Monnier <monnier <at> iro.umontreal.ca>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
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
This bug report was last modified 11 years and 283 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.