GNU bug report logs -
#24753
26.0.50; Error using Edebug on code that uses cl-defmethod
Previous Next
Reported by: Gemini Lasswell <gazally <at> runbox.com>
Date: Fri, 21 Oct 2016 15:16:01 UTC
Severity: normal
Tags: confirmed, patch
Found in version 26.0.50
Fixed in version 26.1
Done: Dmitry Gutov <dgutov <at> yandex.ru>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
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.
This bug report was last modified 8 years and 74 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.