From: Alan Mackenzie <acm@muc.de>
To: Eli Zaretskii <eliz@gnu.org>, g@acm.muc.de
Cc: monnier@iro.umontreal.ca, 61847@debbugs.gnu.org
Subject: bug#61847: debug-early-backtrace only works some of the time.
Date: Wed, 1 Mar 2023 16:05:58 +0000 [thread overview]
Message-ID: <Y/935jL0P33MSy5+@ACM> (raw)
In-Reply-To: <83lekgfvgs.fsf@gnu.org>
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 <acm@muc.de>
> > 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).
next prev parent reply other threads:[~2023-03-01 16:05 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-27 17:11 bug#61847: debug-early-backtrace only works some of the time Alan Mackenzie
2023-02-27 19:15 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-02-28 9:12 ` Alan Mackenzie
2023-02-28 12:16 ` Eli Zaretskii
2023-02-28 13:16 ` Alan Mackenzie
2023-02-28 14:22 ` Eli Zaretskii
2023-02-28 14:45 ` Alan Mackenzie
2023-02-28 17:36 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-02-28 19:52 ` Alan Mackenzie
2023-02-28 19:58 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-03-01 12:16 ` Eli Zaretskii
2023-03-01 15:22 ` Alan Mackenzie
2023-03-01 16:01 ` Eli Zaretskii
2023-03-01 16:46 ` Alan Mackenzie
2023-03-01 17:04 ` Eli Zaretskii
2023-03-01 17:31 ` Alan Mackenzie
2023-03-01 18:22 ` Eli Zaretskii
2023-03-01 17:34 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-03-03 10:58 ` Alan Mackenzie
2023-03-01 13:32 ` Eli Zaretskii
2023-03-01 16:05 ` Alan Mackenzie [this message]
2023-03-01 16:53 ` Eli Zaretskii
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Y/935jL0P33MSy5+@ACM \
--to=acm@muc.de \
--cc=61847@debbugs.gnu.org \
--cc=eliz@gnu.org \
--cc=g@acm.muc.de \
--cc=monnier@iro.umontreal.ca \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.