From mboxrd@z Thu Jan 1 00:00:00 1970
Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail
From: Philipp Stephani
Newsgroups: gmane.emacs.bugs
Subject: bug#42672: 28.0.50;
cl-defgeneric with :method generates incorrect Edebug symbols
Date: Sun, 2 Aug 2020 22:01:07 +0200
Message-ID:
References:
Mime-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214";
logging-data="3465"; mail-complaints-to="usenet@ciao.gmane.io"
To: 42672@debbugs.gnu.org
Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Aug 02 22:02:12 2020
Return-path:
Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org
Original-Received: from lists.gnu.org ([209.51.188.17])
by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
(Exim 4.92)
(envelope-from )
id 1k2KBP-0000lq-Jk
for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 02 Aug 2020 22:02:11 +0200
Original-Received: from localhost ([::1]:46354 helo=lists1p.gnu.org)
by lists.gnu.org with esmtp (Exim 4.90_1)
(envelope-from )
id 1k2KBN-0005fP-Vv
for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 02 Aug 2020 16:02:10 -0400
Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34506)
by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
(Exim 4.90_1) (envelope-from )
id 1k2KBH-0005fD-6h
for bug-gnu-emacs@gnu.org; Sun, 02 Aug 2020 16:02:03 -0400
Original-Received: from debbugs.gnu.org ([209.51.188.43]:60215)
by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
(Exim 4.90_1) (envelope-from )
id 1k2KBG-0005cE-Pj
for bug-gnu-emacs@gnu.org; Sun, 02 Aug 2020 16:02:02 -0400
Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2)
(envelope-from ) id 1k2KBG-0001vd-L5
for bug-gnu-emacs@gnu.org; Sun, 02 Aug 2020 16:02:02 -0400
X-Loop: help-debbugs@gnu.org
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
Original-Received: via spool by 42672-submit@debbugs.gnu.org id=B42672.15963984877371
(code B ref 42672); Sun, 02 Aug 2020 20:02:02 +0000
Original-Received: (at 42672) by debbugs.gnu.org; 2 Aug 2020 20:01:27 +0000
Original-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
Original-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
Original-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)
In-Reply-To:
X-BeenThere: debbugs-submit@debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
X-BeenThere: bug-gnu-emacs@gnu.org
List-Id: "Bug reports for GNU Emacs,
the Swiss army knife of text editors"
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org
Original-Sender: "bug-gnu-emacs"
Xref: news.gmane.io gmane.emacs.bugs:183884
Archived-At:
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.