[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#15101: 24.3.50; debugger-eval-expression broken
From: |
Helmut Eller |
Subject: |
bug#15101: 24.3.50; debugger-eval-expression broken |
Date: |
Fri, 16 Aug 2013 07:27:23 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) |
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
bug#15101: 24.3.50; debugger-eval-expression broken, Stefan Monnier, 2013/08/15