emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: The poor quality of Emacs's backtraces


From: Mattias Engdegård
Subject: Re: The poor quality of Emacs's backtraces
Date: Fri, 14 Jul 2023 14:35:32 +0200

14 juli 2023 kl. 12.48 skrev Alan Mackenzie <acm@muc.de>:

> It doesn't tell me which variable had
> or which evaluation resulted in that invalid value.

Here I was going to write a complaint about ERT and how it is to blame for all 
the world's ills, but for all its flaws it actually makes an effort to save the 
backtrace, using the debugger mechanism, before unwinding the stack.

(There is still plenty to fix in ERT. For example, it could use lexical 
closures to its advantage, and avoid these huge macro-expansions.)

The fault is perhaps closer to (my?) home: the bytecode interpreter doesn't add 
a stack frame for many built-in ops. For example, (cdr 3) will signal a 
`wrong-type-argument` error but `cdr` isn't in the backtrace.

That is something we could and should fix. At least for some ops it should be 
pretty easy, and even a partial remedy would be helpful. Alan, thank you for 
bringing this to my attention!

> 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.

Well, no, this isn't necessarily an improvement. If anything our function 
objects are too fat; making them more so isn't what we need.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]