From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Noam Postavsky Newsgroups: gmane.emacs.bugs Subject: bug#25316: Patch for bug#25316: 26.0.50; Bugs in testcover-reinstrument Date: Sat, 30 Sep 2017 10:40:09 -0400 Message-ID: <87lgkwdzcm.fsf@users.sourceforge.net> References: <87bmlybfjp.fsf@runbox.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1506782484 13524 195.159.176.226 (30 Sep 2017 14:41:24 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 30 Sep 2017 14:41:24 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.60 (gnu/linux) Cc: 25316@debbugs.gnu.org To: Gemini Lasswell Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Sep 30 16:41:17 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dyIx4-0002Fb-Ea for geb-bug-gnu-emacs@m.gmane.org; Sat, 30 Sep 2017 16:41:10 +0200 Original-Received: from localhost ([::1]:39508 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dyIxB-0003EG-KR for geb-bug-gnu-emacs@m.gmane.org; Sat, 30 Sep 2017 10:41:17 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49402) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dyIx0-0003EA-DG for bug-gnu-emacs@gnu.org; Sat, 30 Sep 2017 10:41:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dyIwx-0005Dk-17 for bug-gnu-emacs@gnu.org; Sat, 30 Sep 2017 10:41:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:60841) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dyIww-0005D9-UD for bug-gnu-emacs@gnu.org; Sat, 30 Sep 2017 10:41:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dyIww-0005KA-GE for bug-gnu-emacs@gnu.org; Sat, 30 Sep 2017 10:41:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Noam Postavsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 30 Sep 2017 14:41:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25316 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 25316-submit@debbugs.gnu.org id=B25316.150678242120413 (code B ref 25316); Sat, 30 Sep 2017 14:41:02 +0000 Original-Received: (at 25316) by debbugs.gnu.org; 30 Sep 2017 14:40:21 +0000 Original-Received: from localhost ([127.0.0.1]:41289 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dyIwH-0005JB-5O for submit@debbugs.gnu.org; Sat, 30 Sep 2017 10:40:21 -0400 Original-Received: from mail-it0-f43.google.com ([209.85.214.43]:55458) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dyIwE-0005Ix-K8 for 25316@debbugs.gnu.org; Sat, 30 Sep 2017 10:40:19 -0400 Original-Received: by mail-it0-f43.google.com with SMTP id 4so2794830itv.4 for <25316@debbugs.gnu.org>; Sat, 30 Sep 2017 07:40:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=SEhrOZbF+pP04NuNFYkMKICGfu8EB3pcaD7TMxkc8LY=; b=HsQK6Zpw8CEaTj9ecKNxjyre8OULbo8ZixuBNZiszKiD2D5jefbN0st//72zq6VJtH gE3ZishuplZSZoawLwfmRAmhNwBG/0yxn1E+UyjQaWSHDj8JcKd7nDPi2mDSPjFtJEFT /+Yg8HiMTHGj6yYnpDWtAVrQUBABYU2bjgDTE465uD57NGh5xeotF5Xq4QZ77hmoU7jn kTggj5B9XiP/TqoZ3lnKpWDK38f0oSKuzg7Fy7sV+f7qdaRzpdGrqMoa8eekGI8mCtb7 6mLu9/YSS7bUkqV/8IFoaKv3CGh+rww1A0G7hb7kGmE9PWqeXcmswizCwDlxck3N0V13 2GMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=SEhrOZbF+pP04NuNFYkMKICGfu8EB3pcaD7TMxkc8LY=; b=hZcX6cPG1dYNb5bg9IAITQKVDVGVG4H9heI8COFJT/haCZOAODFRheoguvLGi3hRkj uMFCU8zxuPnreU3nAuIY3KwFvs1fXitoFmN/gSNbJ/cPfDg8gKPKWjj596OZ9ZAJcH/3 jozXHdOfuaKt+iZSvPD1SV1veOjW9rfpnJvzr5MbjHmOnL5xUDEglz1if7UatFQj/xna cTXz4BSyRgAIoZHhHqmsFaGqv6uEv9I5jh9wqEMCAmS/GmVvonmyNzJKK2RcfvDj6nRx gi3gsgzse5zWiQpQI1p7cb7c2IjgLBazGrvaWHOxIvGubQA6lJDa3mbyFg8CK3CwySQu g+9w== X-Gm-Message-State: AMCzsaVSI+ZJiozYk0PaVh1mw3K3vek6205iHD9GUoyPrGepV9h40VLc n+vcfxI5BUVMOVKpVDefySV4uA== X-Google-Smtp-Source: AOwi7QCR4c7nBgYM0FDkP65BXa2Dr49c2T3+mwCuc+YZqi/4mgB5ohL03g2eQPfdCspfZ7dVV5YYfQ== X-Received: by 10.36.98.211 with SMTP id d202mr8455781itc.0.1506782412538; Sat, 30 Sep 2017 07:40:12 -0700 (PDT) Original-Received: from zebian ([45.2.119.34]) by smtp.googlemail.com with ESMTPSA id t15sm2851000iof.33.2017.09.30.07.40.10 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 30 Sep 2017 07:40:11 -0700 (PDT) In-Reply-To: <87bmlybfjp.fsf@runbox.com> (Gemini Lasswell's message of "Mon, 25 Sep 2017 15:04:58 -0700") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:137688 Archived-At: Gemini Lasswell writes: > (edebug-enter): New function which changes behavior of Edebug based > on symbol property 'edebug-behavior and edebug-behavior-alist. Those should be wrapped in quotes as in `edebug-behavior' and `edebug-behavior-alist'. > -(defun edebug-enter (function args body) > +(defun edebug-enter (func args body) > + "Enter Edebug for a function. > +FUNC should be the symbol with the Edebug information, ARGS is > +the list of arguments and BODY is the code. > + > +Look up the `edebug-behavior' for FUNC in `edebug-behavior-alist' > +and run its entry function, and set up `edebug-before' and > +`edebug-after'." > + (cl-letf* ((behavior (get func 'edebug-behavior)) > + (functions (cdr (assoc behavior edebug-behavior-alist))) > + ((symbol-function #'edebug-before) (nth 1 functions)) > + ((symbol-function #'edebug-after) (nth 2 functions))) > + (funcall (nth 0 functions) func args body))) Overriding the function-definition of edebug-before and edebug-after doesn't seem very clean. It would be better to have an edebug-before-function which is `funcall'ed I think (I know your patch didn't introduce this, it just makes it more obvious. Perhaps it could be addressed later). > (defun edebug-run-slow () > - (defalias 'edebug-before 'edebug-slow-before) > - (defalias 'edebug-after 'edebug-slow-after)) > + "Set up Edebug's normal behavior." > + (setf (cdr (assq 'edebug edebug-behavior-alist)) > + '(edebug-default-enter edebug-slow-before edebug-slow-after))) > +(defun testcover-analyze-coverage (form) > + (pcase form > + (`(quote . ,_) > + ;; A quoted form is 1value. Edebug could have instrumented > + ;; something inside the form if an Edebug spec contained a quote. > + ;; It's also possible that the quoted form is a circular object. > + ;; To avoid infinite recursion, don't examine quoted objects. > + ;; This will cause the coverage marks on an instrumented quoted > + ;; form to look odd. See bug#25316. > + '1value) Missed double spacing again. > + ((or `(\` ,bq-form) `(\` . ,bq-form)) Isn't only the first of these is needed? (read "`foo") ;=> (\` foo) > +(defun testcover-analyze-coverage-wrapped-form (form) > + (pcase form > + ((or `(\` ,bq-form) `(\` . ,bq-form)) As above.