GNU bug report logs - #26847
26.0.50; Using edebug-step-in on a macro switches to go-mode

Previous Next

Package: emacs;

Reported by: Gemini Lasswell <gazally <at> runbox.com>

Date: Mon, 8 May 2017 21:08:01 UTC

Severity: minor

Tags: confirmed

Found in version 26.0.50

To reply to this bug, email your comments to 26847 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#26847; Package emacs. (Mon, 08 May 2017 21:08:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Gemini Lasswell <gazally <at> runbox.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 08 May 2017 21:08:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Gemini Lasswell <gazally <at> runbox.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 26.0.50; Using edebug-step-in on a macro switches to go-mode
Date: Mon, 08 May 2017 14:06:21 -0700
edebug-step-in doesn't behave well when you try to use it on a
macro. For an example, enter the following code in *scratch*:
  
(setq my-things nil)
(defun my-try-thing (thing)
  (push thing my-things))

Then:

M-x eval-buffer RET
navigate to my-try-thing and C-u C-M-x
M-: (my-try-thing 'a) RET
i

Result: Edebug exits and code runs to completion, result printed in
minibuffer.

Then navigate to my-try-thing again and C-M-x

Result: Edebug activates with the debugger prompt in `push'.

Stepping into macros would have made sense before eager
macro-expansion, but now by the time Edebug instruments the code the
macro has already run. Probably the simplest thing to do here is to
have edebug-step-in signal an error if asked to step into a macro. The
documentation for edebug-step-in also should be updated to remove
mention of stepping into macros.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#26847; Package emacs. (Tue, 09 May 2017 22:24:01 GMT) Full text and rfc822 format available.

Message #8 received at 26847 <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Gemini Lasswell <gazally <at> runbox.com>, 26847 <at> debbugs.gnu.org
Subject: Re: bug#26847: 26.0.50; Using edebug-step-in on a macro switches to
 go-mode
Date: Wed, 10 May 2017 01:23:39 +0300
On 09.05.2017 0:06, Gemini Lasswell wrote:

> Stepping into macros would have made sense before eager
> macro-expansion, but now by the time Edebug instruments the code the
> macro has already run. Probably the simplest thing to do here is to
> have edebug-step-in signal an error if asked to step into a macro. The
> documentation for edebug-step-in also should be updated to remove
> mention of stepping into macros.

Since nobody has complained about this problem by now, it's probably the 
easiest solution indeed.

However, I wonder if we could inhibit eager macro-expansion when a 
function is being instrumented by edebug. Its definition is being 
re-evaluated at that time, right?

I don't know if we have a good way to do that, though. Or if adding one 
ends up being easy to maintain.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#26847; Package emacs. (Sun, 20 Oct 2019 21:42:01 GMT) Full text and rfc822 format available.

Message #11 received at 26847 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Gemini Lasswell <gazally <at> runbox.com>
Cc: 26847 <at> debbugs.gnu.org
Subject: Re: bug#26847: 26.0.50; Using edebug-step-in on a macro switches to
 go-mode
Date: Sun, 20 Oct 2019 23:41:03 +0200
Gemini Lasswell <gazally <at> runbox.com> writes:

> edebug-step-in doesn't behave well when you try to use it on a
> macro. For an example, enter the following code in *scratch*:
>
> (setq my-things nil)
> (defun my-try-thing (thing)
>   (push thing my-things))
>
> Then:
>
> M-x eval-buffer RET
> navigate to my-try-thing and C-u C-M-x
> M-: (my-try-thing 'a) RET
> i
>
> Result: Edebug exits and code runs to completion, result printed in
> minibuffer.

I'm unable to reproduce this in Emacs 27.  When I hit `i', I'm then
edebugging the `push' macro, and then I can step through it, and then
I'm back to stepping through my-try-thing.

Are you still seeing this bug in Emacs 27?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Added tag(s) moreinfo. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sun, 20 Oct 2019 21:42:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#26847; Package emacs. (Mon, 21 Oct 2019 05:20:02 GMT) Full text and rfc822 format available.

Message #16 received at 26847 <at> debbugs.gnu.org (full text, mbox):

From: Gemini Lasswell <gazally <at> runbox.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 26847 <at> debbugs.gnu.org
Subject: Re: bug#26847: 26.0.50;
 Using edebug-step-in on a macro switches to go-mode
Date: Sun, 20 Oct 2019 22:18:54 -0700
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> I'm unable to reproduce this in Emacs 27.  When I hit `i', I'm then
> edebugging the `push' macro, and then I can step through it, and then
> I'm back to stepping through my-try-thing.
>
> Are you still seeing this bug in Emacs 27?

In Emacs 26, eager macro expansion happened when instrumenting code for
Edebug using eval-defun.  In current master, it's not getting done.
Looking at (symbol-function 'my-try-thing) in both versions will show
you the difference.

The lack of macroexpansion doesn't only happen when instrumenting for
Edebug.  If you evaluate a function definition with eval-buffer or
eval-last-sexp then macroexpansion is done, but if you evaluate it with
eval-defun with or without the universal argument, then no
macroexpansion happens. This is a change from Emacs 26, and is masking
the original bug.

If you use these steps to reproduce, with the same sample code:

M-x edebug-all-defs RET
M-x eval-buffer RET
M-: (my-try-thing 'a) RET
i

then the original bug still occurs.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#26847; Package emacs. (Mon, 21 Oct 2019 19:36:02 GMT) Full text and rfc822 format available.

Message #19 received at 26847 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Gemini Lasswell <gazally <at> runbox.com>
Cc: 26847 <at> debbugs.gnu.org
Subject: Re: bug#26847: 26.0.50; Using edebug-step-in on a macro switches to
 go-mode
Date: Mon, 21 Oct 2019 21:35:20 +0200
Gemini Lasswell <gazally <at> runbox.com> writes:

> If you use these steps to reproduce, with the same sample code:
>
> M-x edebug-all-defs RET
> M-x eval-buffer RET
> M-: (my-try-thing 'a) RET
> i
>
> then the original bug still occurs.

Yup.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Added tag(s) confirmed. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Mon, 21 Oct 2019 19:36:03 GMT) Full text and rfc822 format available.

Removed tag(s) moreinfo. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Mon, 21 Oct 2019 19:36:03 GMT) Full text and rfc822 format available.

This bug report was last modified 5 years and 241 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.