From: Alan Mackenzie <acm@muc.de>
To: Eli Zaretskii <eliz@gnu.org>
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:46:52 +0000 [thread overview]
Message-ID: <Y/+BfE6XzCgNzdlh@ACM> (raw)
In-Reply-To: <83edq8fokr.fsf@gnu.org>
Hello, Eli.
On Wed, Mar 01, 2023 at 18:01:24 +0200, Eli Zaretskii wrote:
> > Date: Wed, 1 Mar 2023 15:22:29 +0000
> > Cc: monnier@iro.umontreal.ca, 61847@debbugs.gnu.org
> > From: Alan Mackenzie <acm@muc.de>
> > > And what use is the meaningless stream of raw bytes that prin1
> > > produces?
> > If that were indeed what was produced, none at all. Because
> > debug-early-backtrace binds print-escape-control-characters to t, what
> > actually gets produced is a mixture of ascii characters and octal
> > escaped representations, just like you see when an .elc file is visited
> > in Emacs.
> Escaping raw bytes doesn't make them more comprehensible.
It does, if they contain control characters which would otherwise corrupt
the screen.
> > > I think you should re-evaluate your preferences, and base them on real
> > > advantages and disadvantages, not on imaginary ones.
> > What makes you think I'm not doing this already? I wrote debug-early
> > last year because I _needed_ it. I've a lot of experience using it, and
> > the way it prints (or rather used to print) a compiled function is/was
> > useful.
> For you, maybe. Not for me. For me it's a nuisance. A useless waste
> of screen estate.
Yes, for me, and lots of other people too. Byte code is very compact,
and we're talking about a very few lines of screen "wasted".
> > You can see how many arguments it takes.
> That information exists elsewhere.
You're misunderstanding the situation. You see a lambda form represented
in a backtrace, you don't know which lambda form it is. There are over
8,000 of them in Emacs. Knowing the number of arguments helps identify
_which_ lambda form it is.
> > You can see the byte code string, hence enabling you to compare it
> > visually with the contents of a .elc file, should such already
> > exist.
> Let's be serious, okay?
I'm being perfectly serious. I've done this. It enabled me to be sure
that I'd identified the lambda form in question, removing the doubt.
> > > If we want our backtraces to be more informative, not less, we
> > > should move farther away of "dumb" output functions that just spill
> > > the guts and towards more humanly-readable formatted description of
> > > the called functions.
> > A wholesome long term goal I fully agree with. For the here and now,
> > outputting "#f(compiled-function () <random hex address>" and nothing
> > else is not a step in that direction.
> But using cl-prin1 _is_ a step in the right direction, because it
> allows us to extend the feature.
Well then, let's get cl-prin1 up to the state where it is better than
bare prin1. As I keep saying cl-prin1 is useless for printing compiled
lambda forms at the moment.
> And that is why I said that if loading Lisp breaks something in
> debug-early, we should solve this _now_, not fall back on prin1, which
> by its very nature cannot be extended so easily.
That it cannot be extended easily is not a disadvantage. It means there
is always a dependable debug-early-backtrace. The attempt to load
cl-prin1 into debug-early is precisely what caused this bug.
> > Besides, the idea of debug-early is to generate a backtrace before all
> > the fancy Lisp facilities are available.
> Some fancy Lisp facilities are already available anyway. And I see no
> reason for this requirement in this case.
In a situation where Emacs does not bootstrap, instead crashing during
the loading or compiling of the Lisp files, we need a debugging tool
which isn't dependent upon those Lisp files. That is what debug-early.el
is intended to be.
--
Alan Mackenzie (Nuremberg, Germany).
next prev parent reply other threads:[~2023-03-01 16:46 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 [this message]
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
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/+BfE6XzCgNzdlh@ACM \
--to=acm@muc.de \
--cc=61847@debbugs.gnu.org \
--cc=eliz@gnu.org \
--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.