bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#24753: 26.0.50; Error using Edebug on code that uses cl-defmethod


From: Dmitry Gutov
Subject: bug#24753: 26.0.50; Error using Edebug on code that uses cl-defmethod
Date: Tue, 11 Apr 2017 15:16:47 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.0

On 21.10.2016 18:15, Gemini Lasswell wrote:
Edebug gets confused after instrumenting multiple methods with the same
name created by cl-defgeneric and cl-defmethod. To reproduce, save the
following bit of code (which is an excerpt from cl-generic-tests.el)
to bug.el:

(require 'cl-generic)

(fmakunbound 'foo)
(cl-defgeneric foo (x y))
(cl-defgeneric (setf foo) (v y z) "My generic doc.")
(cl-defmethod (setf foo) (v (y t) z) (list v y z))
(cl-defmethod (setf foo) (v (_y (eql 4)) z) (list v "four!" z))

(defun foo-bug ()
   (message "%s" (setf (foo 'a 'b) 'v)))

(foo-bug)

Steps to reproduce:
1. emacs -Q
2. C-x C-f bug.el RET
3. M-x edebug-all-defs RET
4. M-x eval-buffer RET
5. g

Result: edebug--display: Args out of range: [44 51 61 62], 4

I can reproduce this scenario, but I don't recall seeing this exact error in practice.

TBH, I'm not sure what (setf foo) does in the NAME slot.

A similar scenario with existing functions leads to a related problem:

1. Search for the definitions of semantic-symref-perform-search.

2. Instrument the one in semantic/symref/grep.el and some other one, like semantic/symref/cscope.el (the order is important).

3. Make sure there are no index files belonging to any tools in the Emacs root directory, so that the Grep tool will be used for search.

4. Type M-x xref-find-references, input something.

5. See edebug jump in the definition in cscope.el, even though the TOOL argument is ...-grep. As I step through it, it quickly gives up with "Source has changed".

Your patch seems to fix that as well. I hope someone else more familiar with edebug will take a look at it soon.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]