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

From: Gemini Lasswell <[email-masked]>
Date: Wed, 26 Apr 2017 14:39:56 -0700

Dmitry Gutov <[email-masked]> writes:

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

I'm not totally clear on what that example is doing either. I just
grabbed it from cl-generic-tests.el because it was short and reproduced
the bug. But I think the idea is to let you define a method so that
(setf (foo x) y) does something analogous to (setf (cdr x) y).

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

Your scenario is another way to reproduce the bug. When Edebug
instruments something it attaches a cache of markers to the symbol. So
when two methods with the same name are instrumented, the cache of
markers pointing into the first method's source is replaced with a cache
of markers for the second method. And then if you debug into the first
method Edebug sees markers pointing at the wrong method and gets
confused. My patch works by making Edebug generate new symbols for each
method.