From unknown Sun Jun 15 01:09:46 2025
X-Loop: help-debbugs@gnu.org
Subject: bug#42672: 28.0.50; cl-defgeneric with :method generates incorrect Edebug symbols
Resent-From: Philipp Stephani
Original-Sender: "Debbugs-submit"
Resent-CC: bug-gnu-emacs@gnu.org
Resent-Date: Sun, 02 Aug 2020 11:15:01 +0000
Resent-Message-ID:
Resent-Sender: help-debbugs@gnu.org
X-GNU-PR-Message: report 42672
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords:
To: 42672@debbugs.gnu.org
X-Debbugs-Original-To: bug-gnu-emacs@gnu.org
Received: via spool by submit@debbugs.gnu.org id=B.159636686325758
(code B ref -1); Sun, 02 Aug 2020 11:15:01 +0000
Received: (at submit) by debbugs.gnu.org; 2 Aug 2020 11:14:23 +0000
Received: from localhost ([127.0.0.1]:41831 helo=debbugs.gnu.org)
by debbugs.gnu.org with esmtp (Exim 4.84_2)
(envelope-from )
id 1k2Bwc-0006hO-Pw
for submit@debbugs.gnu.org; Sun, 02 Aug 2020 07:14:23 -0400
Received: from lists.gnu.org ([209.51.188.17]:42402)
by debbugs.gnu.org with esmtp (Exim 4.84_2)
(envelope-from ) id 1k2Bwa-0006hG-Ej
for submit@debbugs.gnu.org; Sun, 02 Aug 2020 07:14:21 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:53856)
by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
(Exim 4.90_1) (envelope-from )
id 1k2Bwa-0007Ma-82
for bug-gnu-emacs@gnu.org; Sun, 02 Aug 2020 07:14:20 -0400
Received: from mail-ej1-x62c.google.com ([2a00:1450:4864:20::62c]:43839)
by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
(Exim 4.90_1) (envelope-from )
id 1k2BwY-000114-9u
for bug-gnu-emacs@gnu.org; Sun, 02 Aug 2020 07:14:19 -0400
Received: by mail-ej1-x62c.google.com with SMTP id a21so35731793ejj.10
for ; Sun, 02 Aug 2020 04:14:17 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
h=from:to:subject:date:message-id:mime-version
:content-transfer-encoding;
bh=srdP690UI3EacwvF+tX75CRg6laMED/S4lIgCqslA2I=;
b=kZr1smKoW4Ta45Yoeid+KnQ7nKN1BjNGNnFMjV9xXRIYB0VqG6o7ZriOwDo6WBtz0S
OnCnIEmqYHjot0JDdUlb7zTLqYGX0c4pyLpSwIR2XkdMmPq3CSKyLdNpLpMv0kl5Mqcn
Widu+kh3l6l9Roe38wHUw/BpISNJyt/116GBAGP6iVwNDheRu0IxiiI44hn6nm3ijpOV
ep43xse/7cdWoBWjIKifkNQiapRkVyapnb0OmzlH5iu0+qqkPq+if316jYm496o3h7D4
QbRDKTgGQSJM98KCqVJDboIDfb9GeBNFlHwg6ZVBLv8l53tv/Af+mKuxUHdpNOPCg5X/
BalA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20161025;
h=x-gm-message-state:from:to:subject:date:message-id:mime-version
:content-transfer-encoding;
bh=srdP690UI3EacwvF+tX75CRg6laMED/S4lIgCqslA2I=;
b=sBet7gUJ6m9PKznvVUe2DYw7dphkiYtia834xkctBhHDW4K8H8XGnWwnvY0HwBNV1p
Krmgkd+p7t94QLBtCkUHMKdnJA097UI5ayJ0nwpkhbWrWXkZITzC93zA9hy6G1u9V/Qk
jV3HhoRySWbMr4vFGBauNrzz78AnYanrt9LIsaT3atQ3aB8S7zZoNPBZwBQtGrIFx/a2
wdtqaOTeHRT/2v9s+40J11OlCZsVlzBknDGFQYSI1yrNVDdo+8xSdhpcB0gazafOCXY4
8eBfTFzo3sqFXgu/Zhy1sjyq9/o2opOixZsX9G0cm3hHhFkKwRRxSMPsCucaaEEYD6Bw
3yHA==
X-Gm-Message-State: AOAM530Y9z4L5Ua7IQ7BNaO4Yb3EEPhoUNIF8kXJzZrqdtjrgKtwgYJO
bB4H5CojltxvirdyjIESEJwI8RjJ
X-Google-Smtp-Source: ABdhPJzP64xo3dzqp8NpWswVJEQuA8NZN2CavszqTWbm82np9YdSsg0EHwwsaqLT652gJq3dDzQjvA==
X-Received: by 2002:a17:906:a182:: with SMTP id
s2mr5683492ejy.526.1596366855915;
Sun, 02 Aug 2020 04:14:15 -0700 (PDT)
Received: from phst1 (p57997836.dip0.t-ipconnect.de. [87.153.120.54])
by smtp.gmail.com with ESMTPSA id q21sm13052984ejr.75.2020.08.02.04.14.14
for
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
Sun, 02 Aug 2020 04:14:15 -0700 (PDT)
From: Philipp Stephani
Date: Sun, 02 Aug 2020 13:14:13 +0200
Message-ID:
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
Received-SPF: pass client-ip=2a00:1450:4864:20::62c;
envelope-from=p.stephani2@gmail.com; helo=mail-ej1-x62c.google.com
X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache.
That's all we know.
X-Spam_score_int: -17
X-Spam_score: -1.8
X-Spam_bar: -
X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001,
RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001,
URIBL_BLOCKED=0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -0.1 (/)
X-BeenThere: debbugs-submit@debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id:
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
Errors-To: debbugs-submit-bounces@debbugs.gnu.org
Sender: "Debbugs-submit"
X-Spam-Score: -2.1 (--)
Create a file /tmp/defmethod.el:
$ cat /tmp/defmethod.el=20
(cl-defgeneric foo (_)
(:method ((_ number)) 1))
Visit the file in Emacs:
$ emacs -Q /tmp/defmethod.el
Instrument the `cl-defgeneric' form using C-u C-M-x. The *Messages*
buffer now contains
Edebug: nil ((_ number))
Edebug: foo
The second line is for the generic function itself. The first line,
however, is for the method defined by the `:method' form. But its name
should be `foo ((_ number))', not `nil ((_ number))'. This becomes a
problem if there are multiple such generic functions with different
names but identical signatures, because Edebug will then generate
duplicate symbols. This breaks e.g. coverage instrumentation because
the instrumented frequencies will be attached to the wrong symbol.
Implementation-wise, I guess this is a problem with
`edebug-match-cl-generic-method-args'. That function contains the
snippet
;; Append the arguments to edebug-def-name.
(setq edebug-def-name
(intern (format "%s %s" edebug-def-name args)))
However, `edebug-def-name' is only non-nil when using `cl-defmethod',
not when using `cl-defgeneric' with `:method'.
In GNU Emacs 28.0.50 (build 60, x86_64-pc-linux-gnu, GTK+ Version 3.24.18, =
cairo version 1.16.0)
of 2020-08-02
Repository revision: 929e7e141c5780e51173fda7d7fc5b73411e4465
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12008000
System Description: Debian GNU/Linux rodete
Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.
Configured using:
'configure --enable-gcc-warnings=3Dwarn-only
--enable-gtk-deprecation-warnings --without-pop --with-mailutils
--enable-checking=3Dall --enable-check-lisp-object-type --with-modules
'CFLAGS=3D-O1 -ggdb3 -fno-omit-frame-pointer -fsanitize=3Daddress
-fsanitize=3Dundefined -fsanitize=3Dpointer-compare
-fsanitize=3Dpointer-subtract''
Configured features:
XPM JPEG TIFF GIF PNG CAIRO SOUND DBUS GSETTINGS GLIB NOTIFY INOTIFY
LIBSELINUX GNUTLS FREETYPE HARFBUZZ ZLIB TOOLKIT_SCROLL_BARS GTK3 X11
XDBE XIM MODULES THREADS LIBSYSTEMD JSON PDUMPER
Important settings:
value of $LANG: en_US.utf8
value of $XMODIFIERS: @im=3Dibus
locale-coding-system: utf-8-unix
Major mode: Lisp Interaction
Minor modes in effect:
tooltip-mode: t
global-eldoc-mode: t
eldoc-mode: t
electric-indent-mode: t
mouse-wheel-mode: t
tool-bar-mode: t
menu-bar-mode: t
file-name-shadow-mode: t
global-font-lock-mode: t
font-lock-mode: t
blink-cursor-mode: t
auto-composition-mode: t
auto-encryption-mode: t
auto-compression-mode: t
line-number-mode: t
transient-mark-mode: t
Load-path shadows:
None found.
Features:
(shadow sort mail-extr emacsbug message rmc dired dired-loaddefs rfc822
mml easymenu mml-sec epa epg epg-config gnus-util rmail rmail-loaddefs
text-property-search time-date mm-decode mm-bodies mm-encode mail-parse
rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045
ietf-drums mm-util mail-prsvr mail-utils phst skeleton derived edmacro
kmacro pcase ffap thingatpt url url-proxy url-privacy url-expand
url-methods url-history url-cookie url-domsuf url-util url-parse
auth-source cl-seq eieio eieio-core cl-macs eieio-loaddefs
password-cache json map url-vars mailcap subr-x rx gnutls puny seq
byte-opt gv bytecomp byte-compile cconv dbus xml compile comint
ansi-color ring cl-loaddefs cl-lib tooltip eldoc electric uniquify
ediff-hook vc-hooks lisp-float-type mwheel term/x-win x-win
term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe
tabulated-list replace newcomment text-mode elisp-mode lisp-mode
prog-mode register page tab-bar menu-bar rfn-eshadow isearch timer
select scroll-bar mouse jit-lock font-lock syntax facemenu font-core
term/tty-colors frame minibuffer cl-generic cham georgian utf-8-lang
misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms
cp51932 hebrew greek romanian slovak czech european ethiopic indian
cyrillic chinese composite charscript charprop case-table epa-hook
jka-cmpr-hook help simple abbrev obarray cl-preloaded nadvice loaddefs
button faces cus-face macroexp files text-properties overlay sha1 md5
base64 format env code-pages mule custom widget hashtable-print-readable
backquote threads dbusbind inotify dynamic-setting system-font-setting
font-render-setting cairo move-toolbar gtk x-toolkit x multi-tty
make-network-process emacs)
Memory information:
((conses 16 68799 8226)
(symbols 48 8629 1)
(strings 32 23745 2016)
(string-bytes 1 764226)
(vectors 16 13112)
(vector-slots 8 166374 4864)
(floats 8 25 30)
(intervals 56 221 0)
(buffers 992 11))
--=20
Google Germany GmbH
Erika-Mann-Stra=C3=9Fe 33
80636 M=C3=BCnchen
Gesch=C3=A4ftsf=C3=BChrer: Paul Manicle, Halimah DeLaine Prado
Registergericht und -nummer: Hamburg, HRB 86891
Sitz der Gesellschaft: Hamburg
Diese E-Mail ist vertraulich. Falls Sie diese f=C3=A4lschlicherweise erhal=
ten haben
sollten, leiten Sie diese bitte nicht an jemand anderes weiter, l=C3=B6sche=
n Sie
alle Kopien und Anh=C3=A4nge davon und lassen Sie mich bitte wissen, dass d=
ie E-Mail
an die falsche Person gesendet wurde.
This e-mail is confidential. If you received this communication by mistake,
please don=E2=80=99t forward it to anyone else, please erase all copies and
attachments, and please let me know that it has gone to the wrong person.
From unknown Sun Jun 15 01:09:46 2025
X-Loop: help-debbugs@gnu.org
Subject: bug#42672: 28.0.50; cl-defgeneric with :method generates incorrect Edebug symbols
Resent-From: Philipp Stephani
Original-Sender: "Debbugs-submit"
Resent-CC: bug-gnu-emacs@gnu.org
Resent-Date: Sun, 02 Aug 2020 11:42:01 +0000
Resent-Message-ID:
Resent-Sender: help-debbugs@gnu.org
X-GNU-PR-Message: followup 42672
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords:
To: 42672@debbugs.gnu.org
Received: via spool by 42672-submit@debbugs.gnu.org id=B42672.15963684714210
(code B ref 42672); Sun, 02 Aug 2020 11:42:01 +0000
Received: (at 42672) by debbugs.gnu.org; 2 Aug 2020 11:41:11 +0000
Received: from localhost ([127.0.0.1]:41859 helo=debbugs.gnu.org)
by debbugs.gnu.org with esmtp (Exim 4.84_2)
(envelope-from )
id 1k2CMZ-00015p-5Z
for submit@debbugs.gnu.org; Sun, 02 Aug 2020 07:41:11 -0400
Received: from mail-oo1-f52.google.com ([209.85.161.52]:39054)
by debbugs.gnu.org with esmtp (Exim 4.84_2)
(envelope-from ) id 1k2CMV-00015X-Nw
for 42672@debbugs.gnu.org; Sun, 02 Aug 2020 07:41:10 -0400
Received: by mail-oo1-f52.google.com with SMTP id x1so4575021oox.6
for <42672@debbugs.gnu.org>; Sun, 02 Aug 2020 04:41:07 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
h=mime-version:references:in-reply-to:from:date:message-id:subject:to;
bh=2CqYxnRgmV9OQOUR5KWZ3Biah34NNJi0yx36DdFm2oo=;
b=qBovcoRZxCbhK3ip3DJ2Tqxan7j6ojgw4gRuSCb8fEWdwPjUb6IIXOEA+KHuD0qPgV
X4X4OajUzpLcPIIwGS01XyI8bqY2FxR7fiqgdEdi0q3ZLt+VWCXZKpMACVTeWzksuxTm
T8J+i/19k0XER0ywaS/mqB6ZFLQRigXdNIm8wzqsQNOjfesEPdmlbJbRNtYAzwd5AV5k
fhlIqsUspETWQj/oauceADG9+D81DwhT5tpbugkoT8cJEXzwYwFzMjNB42ynrCtnY/R/
0deXy4n1Ge0HltFjk34SvsDuDlwdxAdY53HGSeCBMwNfEehntAPgskA/UFdB//LjAZaN
iNDQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20161025;
h=x-gm-message-state:mime-version:references:in-reply-to:from:date
:message-id:subject:to;
bh=2CqYxnRgmV9OQOUR5KWZ3Biah34NNJi0yx36DdFm2oo=;
b=P+wzUULNDeF2Hdx2MZqUAN7uKmlTk5JmkW1eVIpS4ZDZ9Xg6yo6I6QazurfDIg6jY/
CKFGM9X8wN/RK8XWynaM68O6VBSSVMulQfFRwRr1UA5e1/FSIaWRUD0zSV+MraENKhvM
Mq8djgzbpQasaib32oS/SCDGcqJfNVtpjPGt+Q8btIuI2u/DTN2u6MFVc/hwcAe175Z7
CrigCDiqvpl6HLm3cUuQk+L4CzI11jW9hJavLNeZx7Ggj1VW0cxy3Ti5jIs/BRrOZCmw
xRRSAk5ZT9NoRlNavH4uPif4xtfXHoX739e4uPeH7OmqthjfvMHtLe14b/AYYiQ+woqD
MdnA==
X-Gm-Message-State: AOAM531Ng0e6K/WONXA9Qls+aWn8T24Tf7nZc5HeN/4O1ovFd/w0JPhc
M8rMd3J0wQpIiXcyVIsn2RIcMklZkn3I8/V3D7OOulGv
X-Google-Smtp-Source: ABdhPJxVSBLifTEqiVsBqgjZsM08jHu3/tUMVsMHnN41YvdPU13y/sRM5HwCt8g4cdgTyxDBnlXF4dfILE72EaiGgvQ=
X-Received: by 2002:a4a:8257:: with SMTP id t23mr10315833oog.60.1596368461540;
Sun, 02 Aug 2020 04:41:01 -0700 (PDT)
MIME-Version: 1.0
References:
In-Reply-To:
From: Philipp Stephani
Date: Sun, 2 Aug 2020 13:40:50 +0200
Message-ID:
Content-Type: text/plain; charset="UTF-8"
X-Spam-Score: 0.2 (/)
X-BeenThere: debbugs-submit@debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id:
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
Errors-To: debbugs-submit-bounces@debbugs.gnu.org
Sender: "Debbugs-submit"
X-Spam-Score: -0.8 (/)
Am So., 2. Aug. 2020 um 13:15 Uhr schrieb Philipp Stephani
:
>
>
> Create a file /tmp/defmethod.el:
>
> $ cat /tmp/defmethod.el
> (cl-defgeneric foo (_)
> (:method ((_ number)) 1))
>
> Visit the file in Emacs:
>
> $ emacs -Q /tmp/defmethod.el
>
> Instrument the `cl-defgeneric' form using C-u C-M-x. The *Messages*
> buffer now contains
>
> Edebug: nil ((_ number))
> Edebug: foo
>
> The second line is for the generic function itself. The first line,
> however, is for the method defined by the `:method' form. But its name
> should be `foo ((_ number))', not `nil ((_ number))'. This becomes a
> problem if there are multiple such generic functions with different
> names but identical signatures, because Edebug will then generate
> duplicate symbols. This breaks e.g. coverage instrumentation because
> the instrumented frequencies will be attached to the wrong symbol.
>
> Implementation-wise, I guess this is a problem with
> `edebug-match-cl-generic-method-args'. That function contains the
> snippet
>
> ;; Append the arguments to edebug-def-name.
> (setq edebug-def-name
> (intern (format "%s %s" edebug-def-name args)))
>
> However, `edebug-def-name' is only non-nil when using `cl-defmethod',
> not when using `cl-defgeneric' with `:method'.
>
The code in edebug.el is somewhat obscure, but I think one piece of
the problem is that `edebug-make-form-wrapper' unconditionally binds
`edebug-def-name' to nil, so such Edebug specifications don't really
work the way they are intended to work. There's some commented-out
binding of `edebug-containing-def-name' in that function, indicating
that the function is incomplete/buggy, and the corrected
implementation was intended to cover this case (and similar cases with
nested definitions such as `cl-flet').
From unknown Sun Jun 15 01:09:46 2025
X-Loop: help-debbugs@gnu.org
Subject: bug#42672: 28.0.50; cl-defgeneric with :method generates incorrect Edebug symbols
Resent-From: Philipp Stephani
Original-Sender: "Debbugs-submit"
Resent-CC: bug-gnu-emacs@gnu.org
Resent-Date: Sun, 02 Aug 2020 20:02:02 +0000
Resent-Message-ID:
Resent-Sender: help-debbugs@gnu.org
X-GNU-PR-Message: followup 42672
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords:
To: 42672@debbugs.gnu.org
Received: via spool by 42672-submit@debbugs.gnu.org id=B42672.15963984877371
(code B ref 42672); Sun, 02 Aug 2020 20:02:02 +0000
Received: (at 42672) by debbugs.gnu.org; 2 Aug 2020 20:01:27 +0000
Received: from localhost ([127.0.0.1]:43528 helo=debbugs.gnu.org)
by debbugs.gnu.org with esmtp (Exim 4.84_2)
(envelope-from )
id 1k2KAh-0001up-3M
for submit@debbugs.gnu.org; Sun, 02 Aug 2020 16:01:27 -0400
Received: from mail-oi1-f172.google.com ([209.85.167.172]:37384)
by debbugs.gnu.org with esmtp (Exim 4.84_2)
(envelope-from ) id 1k2KAe-0001uc-Ma
for 42672@debbugs.gnu.org; Sun, 02 Aug 2020 16:01:25 -0400
Received: by mail-oi1-f172.google.com with SMTP id e6so11354362oii.4
for <42672@debbugs.gnu.org>; Sun, 02 Aug 2020 13:01:24 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
h=mime-version:references:in-reply-to:from:date:message-id:subject:to;
bh=72eehxz/EmF0iXyfqS/IU3oq6PROke905AdVSC6yobM=;
b=O5NX5rRQNyFZHdMqcPOXx3ZkSF50PgYQ2GWvqsX52NVsjZFi7eW63QourYL9OAj1c2
Lf07YmI2RoCUual+D2xpRqXPG0N+8eIBEnhA0BxRGB+Drrzu7mv7vnLE148Iw593Cqjk
Y2hDmScB6eWxbxL0VUTPTptfpQgf4C6NefRM+QumvVRXgOflRpEw8DMnsa9aR6g1PYkl
yH8H+EgvPT8t7S92osDQrMeQYlLcdO6kGC3giHQ00Zu61rJyNCkaqbM2ByglbWC5+3gd
Tyz0G5uBQbJMqw5DF9mhFzmyx+JMHH4BIcKVI5ZikoP+VrKvVvrAjNwwUFy8vu5zDzeE
8FJA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20161025;
h=x-gm-message-state:mime-version:references:in-reply-to:from:date
:message-id:subject:to;
bh=72eehxz/EmF0iXyfqS/IU3oq6PROke905AdVSC6yobM=;
b=M6GIhDzgtRc39aTG4A6csdQf3af8uRf9WQBiA5t4vJVAgSvnyT5aAl9yAk8TYzbCMX
VttSCyIV4SEnnNjbr2uPjKJbrwHvLXhEygwfwCBakV8PJnS1dn+wdSUWFXby+qEWNLaM
zQ+UItuOtC8ZJOu5yFvl25mVP3PE/fGYreylsNtAUjhOmnEYucyhCEuwpa7mOUt+i3F/
wB0VE8B3rJXeSYSrIhuoMvZF4XzdukJbxxPL/AlsWWuvWfI1IkmT3+2XITx97wNOtIQG
t3aijuXZc0c/+MnP/ELkD004mYbgaqEHjN/Q8hwyNiAtSwkb2rjPPsPQqY7BC36TPspI
Gdlg==
X-Gm-Message-State: AOAM533UFuLriSajCQ+5xmHXIYGCk0LF8ffg7x1MpesbIqNg2JMIxlRI
QztmuRI79mP8Pcba0RBdanU3nbxzaSeqStRr9h/XjI5f
X-Google-Smtp-Source: ABdhPJwiOyPQT4cKjha1P6g5Q+6wYFJANLoVvy1bztKp88nMRb9B3HtCXERw8JrCpZtnWYhxo69G9QY6x4ZXpOaoG8I=
X-Received: by 2002:a05:6808:9bb:: with SMTP id
e27mr3961524oig.9.1596398478517;
Sun, 02 Aug 2020 13:01:18 -0700 (PDT)
MIME-Version: 1.0
References:
In-Reply-To:
From: Philipp Stephani
Date: Sun, 2 Aug 2020 22:01:07 +0200
Message-ID:
Content-Type: text/plain; charset="UTF-8"
X-Spam-Score: 0.2 (/)
X-BeenThere: debbugs-submit@debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id:
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
Errors-To: debbugs-submit-bounces@debbugs.gnu.org
Sender: "Debbugs-submit"
X-Spam-Score: -0.8 (/)
Am So., 2. Aug. 2020 um 13:15 Uhr schrieb Philipp Stephani
:
>
>
> Create a file /tmp/defmethod.el:
>
> $ cat /tmp/defmethod.el
> (cl-defgeneric foo (_)
> (:method ((_ number)) 1))
>
> Visit the file in Emacs:
>
> $ emacs -Q /tmp/defmethod.el
>
> Instrument the `cl-defgeneric' form using C-u C-M-x. The *Messages*
> buffer now contains
>
> Edebug: nil ((_ number))
> Edebug: foo
>
> The second line is for the generic function itself. The first line,
> however, is for the method defined by the `:method' form. But its name
> should be `foo ((_ number))', not `nil ((_ number))'. This becomes a
> problem if there are multiple such generic functions with different
> names but identical signatures, because Edebug will then generate
> duplicate symbols. This breaks e.g. coverage instrumentation because
> the instrumented frequencies will be attached to the wrong symbol.
>
> Implementation-wise, I guess this is a problem with
> `edebug-match-cl-generic-method-args'. That function contains the
> snippet
>
> ;; Append the arguments to edebug-def-name.
> (setq edebug-def-name
> (intern (format "%s %s" edebug-def-name args)))
>
> However, `edebug-def-name' is only non-nil when using `cl-defmethod',
> not when using `cl-defgeneric' with `:method'.
I've added a workaround (commit 3e0c3479b2). A more long-term solution
should ensure that the name of the `cl-defgeneric' function is part of
the method defined in this way.