From: Alan Mackenzie <acm@muc.de>
To: "Mattias Engdegård" <mattias.engdegard@gmail.com>
Cc: emacs-devel@gnu.org
Subject: Re: The poor quality of Emacs's backtraces
Date: Fri, 14 Jul 2023 10:48:59 +0000 [thread overview]
Message-ID: <ZLEoG4zCmVk7qPEM@ACM> (raw)
In-Reply-To: <3D901B62-4826-4783-B684-968E6890E75A@gmail.com>
Hello, Mattias.
On Thu, Jul 13, 2023 at 16:57:52 +0200, Mattias Engdegård wrote:
> 13 juli 2023 kl. 15.35 skrev Alan Mackenzie <acm@muc.de>:
> > (wrong-type-argument listp
> > #[257 "\300\211\2!\262\1\207" [yes-or-no-p] 4
> > "\n\n(fn ARG124 &optional)" t])
> > So, this says that _something_ wasn't a list, without telling me what the
> > something was.
> Actually it does. It's the element after the type, in this case the
> byte-compiled function #[257 ...].
You haven't grasped my point. It doesn't tell me which variable had
or which evaluation resulted in that invalid value. It just prints out
the value, leaving me to guess what, exactly, had that value. Such
"guessing" can take hours or days.
> > It says "wrong-type-argument", but doesn't say why it's wrong. It
> > doesn't disclose which primitive detected the fault, though Emacs could
> > easily do this.
> Usually it's the topmost function in the traceback.
> If not, please report it as a bug. There's certainly work to be done.
I found the bug, eventually. I'd written (nth 5 byte-code) where what I
needed was (aref byte-code 5). If the message had included the
information "nth" in it, I would have found the bug quickly.
> > test suite truncating every line at ~70 characters. (Why is this done?)
> I agree, that's annoying. We have to truncate at some point or we'll
> be treated to dumps of impractical size before we know it, but 70
> chars is pretty useless.
> > (The symbols in braces are an enhancement I'm currently working on to give
> > more information for anonymous functions.)
> Keep us in touch, because it's very likely that some of us are working
> on the same code, with similar but different goals. Don't go it alone.
You're working on something similar, too?
My enhancement is to store the @dfn{defining symbol} of anonymous
functions inside the function, whether an interpreted function, or
either type of compiled function. This symbol is the defun/defmacro
etc. within which the lambda is defined.
It's approaching the point at which it would be sensible to create a new
branch for it and commit the changes to it.
> > It's worth pointing out that there doesn't seem to be a way to get Emacs
> > to disassemble a function, only a symbol with a function value.
> Actually there is. Just use the function `disassemble`:
> (disassemble #[257 "\300\211\2!\262\1\207" [yes-or-no-p] 4 "\n\n(fn ARG124 &optional)" t])
Ah! Thanks!
--
Alan Mackenzie (Nuremberg, Germany).
next prev parent reply other threads:[~2023-07-14 10:48 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-13 13:35 The poor quality of Emacs's backtraces Alan Mackenzie
2023-07-13 14:17 ` Christopher Dimech
2023-07-13 14:57 ` Mattias Engdegård
2023-07-14 8:00 ` Ihor Radchenko
2023-07-14 9:08 ` Mattias Engdegård
2023-07-14 9:18 ` Ihor Radchenko
2023-07-14 10:58 ` Alan Mackenzie
2023-07-14 10:56 ` Eli Zaretskii
2023-07-14 10:48 ` Alan Mackenzie [this message]
2023-07-14 12:35 ` Mattias Engdegård
2023-07-14 13:07 ` Alan Mackenzie
2023-07-14 18:06 ` Mattias Engdegård
2023-07-14 20:51 ` Alan Mackenzie
2023-07-17 15:52 ` Mattias Engdegård
2023-07-17 19:02 ` Alan Mackenzie
2023-07-17 19:50 ` Ihor Radchenko
2023-07-18 11:19 ` Alan Mackenzie
2023-07-18 11:54 ` Ihor Radchenko
2023-07-18 13:57 ` Alan Mackenzie
2023-07-19 8:05 ` Ihor Radchenko
2023-07-19 10:33 ` Mattias Engdegård
2023-07-19 15:45 ` Alan Mackenzie
2023-07-14 1:10 ` Michael Heerdegen
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZLEoG4zCmVk7qPEM@ACM \
--to=acm@muc.de \
--cc=emacs-devel@gnu.org \
--cc=mattias.engdegard@gmail.com \
/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 public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).