From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.bugs Subject: bug#61847: debug-early-backtrace only works some of the time. Date: Wed, 1 Mar 2023 16:05:58 +0000 Message-ID: References: <83lekgfvgs.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12629"; mail-complaints-to="usenet@ciao.gmane.io" Cc: monnier@iro.umontreal.ca, 61847@debbugs.gnu.org To: Eli Zaretskii , g@acm.muc.de Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Mar 01 17:07:49 2023 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 1pXOzd-00032j-I4 for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 01 Mar 2023 17:07:49 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pXOyw-0008Oe-EK; Wed, 01 Mar 2023 11:07:06 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pXOys-0008MR-0s for bug-gnu-emacs@gnu.org; Wed, 01 Mar 2023 11:07:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pXOyr-0003fl-NO for bug-gnu-emacs@gnu.org; Wed, 01 Mar 2023 11:07:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pXOyr-0000rb-Iy for bug-gnu-emacs@gnu.org; Wed, 01 Mar 2023 11:07:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 01 Mar 2023 16:07:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61847 X-GNU-PR-Package: emacs Original-Received: via spool by 61847-submit@debbugs.gnu.org id=B61847.16776867663256 (code B ref 61847); Wed, 01 Mar 2023 16:07:01 +0000 Original-Received: (at 61847) by debbugs.gnu.org; 1 Mar 2023 16:06:06 +0000 Original-Received: from localhost ([127.0.0.1]:54728 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pXOxy-0000qS-3X for submit@debbugs.gnu.org; Wed, 01 Mar 2023 11:06:06 -0500 Original-Received: from mx3.muc.de ([193.149.48.5]:12532) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pXOxw-0000pv-Jx for 61847@debbugs.gnu.org; Wed, 01 Mar 2023 11:06:05 -0500 Original-Received: (qmail 21460 invoked by uid 3782); 1 Mar 2023 17:05:58 +0100 Original-Received: from acm.muc.de (pd953ac29.dip0.t-ipconnect.de [217.83.172.41]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Wed, 01 Mar 2023 17:05:58 +0100 Original-Received: (qmail 25626 invoked by uid 1000); 1 Mar 2023 16:05:58 -0000 Content-Disposition: inline In-Reply-To: <83lekgfvgs.fsf@gnu.org> X-Submission-Agent: TMDA/1.3.x (Ph3nix) X-Primary-Address: acm@muc.de 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:257076 Archived-At: Hello, Eli. On Wed, Mar 01, 2023 at 15:32:35 +0200, Eli Zaretskii wrote: > > Cc: 61847@debbugs.gnu.org > > Date: Tue, 28 Feb 2023 19:52:33 +0000 > > From: Alan Mackenzie > > The purpose of a backtrace is not to enter a beauty contest. Rather > > it's to provide the programmer with as much information as > > reasonably possible to solve a bug. > Information that is humanly-readable and understandable, yes. Not > just any information. Showing raw bytes of the bytecode is not very > useful information, IMNSHO. In my experience, it is useful. cl-prin1 outputs essentially no information at all about compiled functions. That is not useful. > Or at least we could make it much more useful, if we really want that > part to be presented to the programmer. Debugging used to be done with core dumps. debug-early-backtrace's output using prin1 is more useful than that. And yes, we do want to present it to the programmer. > > prin1 by contrast prints the actual contents of the function - its byte > > code string and its constant vector, among other things. It may not be > > as "readable", but it is infinitely more useful to the person trying to > > debug a bug. > 1 is "infinitely more" than zero, but it is still just 1. Not 1`00 > and not 1000. debug-early, using prin1, generates useful output for debugging problems in early bootstrap. Using cl-prin1, the output is less useful. > IOW, just because relatively you get an "infinite" improvement, the > net improvement is still very small, and there's no reason to stop > there. The improvement is significant. For what it's worth, I think debugging in Emacs, at whatever level, is currently too hard, too uncertain, and too laborious. I've been working to try and improve this for quite a long time. > So your argument against cl-prin1, if taken to its logical conclusion, > should be rephrased as "let's improve cl-prin1", not "let's go back to > the infinitely useless prin1". My main argument against cl-prin1 is that it's Lisp, and loading Lisp in early bootstrap is an uncertain, difficult process, as this bug shows. The guiding design principle in debug-early.el was to use _NO_ Lisp at all, other than debug-early.el itself. This was for the sake of the solidity which temacs has, in comparison with the unprocessed Lisp source files. prin1 is _far_ from "infinitely useless". I've used it to good effect. cl-prin1 is not useful for printing compiled functions. How about this suggestion: to fix the bug right now, we put prin1 back in, as it was in the original debug-early.el. When cl-prin1 has improved sufficiently, we then consider putting it back into debug-early.el? -- Alan Mackenzie (Nuremberg, Germany).