emacs-devel
[Top][All Lists]
Advanced

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

Re: backtrace-mode


From: Helmut Eller
Subject: Re: backtrace-mode
Date: Wed, 20 Jun 2018 07:52:07 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

On Tue, Jun 19 2018, Gemini Lasswell wrote:

> - Now that xref-find-definitions works in backtrace buffers, I think
>   it would be better to stop making buttons for the functions in a
>   backtrace, and to document M-. as the best way to jump to function
>   definitions from backtraces.  What do you think of this change to
>   existing behavior, with or without a new customization variable to
>   preserve the old behavior?

Apparently M-. in this backtrace-mode uses the elisp backend.  While
that works, a backtrace-frame has potentially more context than just the
name of a global function.  E.g. I have a custom "view source" command
that looks at the next frame and tries to find the function called
inside the function source.  That works pretty well as long as there
aren't too many macros or lambdas involved.  Also the compiler could
potentially emit debug information to map the frame's PC to the source
position; which would be very useful for lambdas.  So I think there
should either be a proper "view source" command or xref backend for
backtraces.

Another issue: backtrace-get-frames seems to compute the entire
backtrace and all possibly relevant information in advance.  Maybe that
should be done a bit more lazily, e.g. compute the next N frames only if
somebody needs them.  For local variable also keep in mind that
backtrace--locals is implemented rather inefficiently.  That would also
be less problematic if locals are only fetched when needed.

Helmut




reply via email to

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