From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Vasilij Schneidermann Newsgroups: gmane.emacs.bugs Subject: bug#24514: 24.5; [WIP][PATCH] Lispy backtraces Date: Fri, 23 Sep 2016 01:14:47 +0200 Message-ID: <20160922231447.GA3833@odonien.localdomain> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="opJtzjQTFsWo+cga" X-Trace: blaine.gmane.org 1474586253 2079 195.159.176.226 (22 Sep 2016 23:17:33 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 22 Sep 2016 23:17:33 +0000 (UTC) User-Agent: Mutt/1.7.0 (2016-08-17) To: 24514@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Sep 23 01:17:29 2016 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 1bnDEx-0006od-7F for geb-bug-gnu-emacs@m.gmane.org; Fri, 23 Sep 2016 01:17:15 +0200 Original-Received: from localhost ([::1]:35998 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bnDEv-0008Kl-IH for geb-bug-gnu-emacs@m.gmane.org; Thu, 22 Sep 2016 19:17:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51777) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bnDEo-0008K0-H3 for bug-gnu-emacs@gnu.org; Thu, 22 Sep 2016 19:17:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bnDEk-0000vQ-AL for bug-gnu-emacs@gnu.org; Thu, 22 Sep 2016 19:17:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:54851) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bnDEk-0000vL-6i for bug-gnu-emacs@gnu.org; Thu, 22 Sep 2016 19:17:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bnDEk-0001Ug-00 for bug-gnu-emacs@gnu.org; Thu, 22 Sep 2016 19:17:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Vasilij Schneidermann Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 22 Sep 2016 23:17:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 24514 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.14745861815679 (code B ref -1); Thu, 22 Sep 2016 23:17:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 22 Sep 2016 23:16:21 +0000 Original-Received: from localhost ([127.0.0.1]:32808 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bnDE5-0001TW-Jq for submit@debbugs.gnu.org; Thu, 22 Sep 2016 19:16:21 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:60420) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bnDE3-0001TI-RU for submit@debbugs.gnu.org; Thu, 22 Sep 2016 19:16:20 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bnDDx-0000Ya-FB for submit@debbugs.gnu.org; Thu, 22 Sep 2016 19:16:14 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:50402) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bnDDx-0000Y5-Bx for submit@debbugs.gnu.org; Thu, 22 Sep 2016 19:16:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51385) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bnDDv-00086E-1f for bug-gnu-emacs@gnu.org; Thu, 22 Sep 2016 19:16:12 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bnDDr-0000Vx-Gl for bug-gnu-emacs@gnu.org; Thu, 22 Sep 2016 19:16:10 -0400 Original-Received: from mail-wm0-f52.google.com ([74.125.82.52]:36055) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bnDDr-0000Ux-8Z for bug-gnu-emacs@gnu.org; Thu, 22 Sep 2016 19:16:07 -0400 Original-Received: by mail-wm0-f52.google.com with SMTP id w84so280605819wmg.1 for ; Thu, 22 Sep 2016 16:16:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:subject:message-id:mime-version:content-disposition :user-agent; bh=YRCZzD0kFwR7aJX1qaAmxB/1+6tJq/YoZGMHz+goUbI=; b=Q2dS8G0h/jHKZl6tMCv7qjLpLJoQk8i354jOyjHghIMvirND/C1lMLjI7TvAClXQX+ vVo++IAr1WIQuBoc9eQLBqhnY/pRXjjlQS5m23IQ044hqSQkyC+bKk0EmoBL0kYsZVQH lWQnt0YWW3zM8EUxeeBOHnWTexDqj1DkpGzDM2f7y8eRRMnfAtXt+0enJz2AR4isj0vg 9JN5l2Rk8TZ77RgDEyrUphT1xvZNV6u2TPGB+Hom/TEunjsysitaRb0K45MWl7CqtUjE SGSB54c785Yh4YM+r9pv7OEPpVxnAMFfv+AAV24TdHbbL7neXpcKDF1KlYci9etl+O12 Iuyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:subject:message-id:mime-version :content-disposition:user-agent; bh=YRCZzD0kFwR7aJX1qaAmxB/1+6tJq/YoZGMHz+goUbI=; b=OyW0rkZcOwDi5fdKh6VbyG5f5Tmyr/epIrRasGP7aaNUFkqzkJz5fcfDYqR3PW3oE/ lPKudJva9g6K9QyK68VwMMpD7jWLMV1x1ZJrdUL20qIpSwTKim09zcdUtEf47hFTFOnw c9TMkb+TVmWFR8AkriZihq6OjR3zK1n4n0yy3lB0dBAr5VIWNnbQR8+v/xvu5Vaa5W+j w3j3FERRvjLIR2Gfus7mM4v3G9b9Ls84wsZngtYP/cOssSSJ9Oy1hha1Kb0ElrENwwQf Dua97LOkww+dCT6sq8QTmO9ARXBZ1FBlmNyu0bhE7ApKT5WUlEWxUCwTUUGKHlaLTcjL 949w== X-Gm-Message-State: AE9vXwNAYLFdVjysItaTErKtYvZLCXK4c2x9SqhBMErFpcB2/2dtFwnl2UQLtFHlO8r31Q== X-Received: by 10.194.190.37 with SMTP id gn5mr4154629wjc.168.1474586105182; Thu, 22 Sep 2016 16:15:05 -0700 (PDT) Original-Received: from localhost (dslb-092-073-102-189.092.073.pools.vodafone-ip.de. [92.73.102.189]) by smtp.gmail.com with ESMTPSA id jn7sm4287961wjb.5.2016.09.22.16.15.04 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 22 Sep 2016 16:15:04 -0700 (PDT) Content-Disposition: inline X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x 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:123573 Archived-At: --opJtzjQTFsWo+cga Content-Type: text/plain; charset=utf-8 Content-Disposition: inline I wrote a minimal patch that increases the overall consistency in a backtrace buffer by printing the call stack frames as S-Expressions. Before: Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p t) +(1 t) eval((+ 1 t) nil) eval-expression((+ 1 t) nil) call-interactively(eval-expression nil nil) command-execute(eval-expression) After: Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p t) (debug error (wrong-type-argument number-or-marker-p t)) (+ 1 t) (eval (+ 1 t) nil) (eval-expression (+ 1 t) nil) (funcall-interactively eval-expression (+ 1 t) nil) (call-interactively eval-expression nil nil) (command-execute eval-expression) Now, this patch isn't perfect. For some reason there's an extra debug line in the second version, I've yet to investigate into the reason for this. The other problem is that while I can't imagine any reason to go back to the original view of the backtrace, I cannot rule out that this change might break other tools relying on it. I'd appreciate any feedback on this. --opJtzjQTFsWo+cga Content-Type: text/x-diff; charset=utf-8 Content-Disposition: attachment; filename="0001-Make-backtraces-great-again.patch" >From 232cb613a83f128d8ee90d7a52fcbde06fd29766 Mon Sep 17 00:00:00 2001 From: Vasilij Schneidermann Date: Thu, 22 Sep 2016 23:01:21 +0200 Subject: [PATCH] Make backtraces great again --- lisp/emacs-lisp/debug.el | 2 +- src/eval.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lisp/emacs-lisp/debug.el b/lisp/emacs-lisp/debug.el index 22a3f39..4020620 100644 --- a/lisp/emacs-lisp/debug.el +++ b/lisp/emacs-lisp/debug.el @@ -279,7 +279,7 @@ That buffer should be current already." (goto-char (point-min)) (delete-region (point) (progn - (search-forward "\n debug(") + (search-forward "\n (debug") (forward-line (if (eq (car args) 'debug) ;; Remove debug--implement-debug-on-entry ;; and the advice's `apply' frame. diff --git a/src/eval.c b/src/eval.c index 72facd5..e32e7a1 100644 --- a/src/eval.c +++ b/src/eval.c @@ -3409,8 +3409,9 @@ Output stream used is value of `standard-output'. */) else { tem = backtrace_function (pdl); - Fprin1 (tem, Qnil); /* This can QUIT. */ write_string ("("); + Fprin1 (tem, Qnil); /* This can QUIT. */ + write_string (" "); { ptrdiff_t i; for (i = 0; i < backtrace_nargs (pdl); i++) -- 2.9.3 --opJtzjQTFsWo+cga--