all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Mattias Engdegård" <mattiase@acm.org>
To: Rocky Bernstein <rocky@gnu.org>
Cc: emacs-devel <emacs-devel@gnu.org>
Subject: Re: Does recent great work on separating the bytecode stack make it easier to show bytecode offsets in a traceback?
Date: Mon, 2 May 2022 11:10:14 +0200	[thread overview]
Message-ID: <9702547E-EEFE-45D9-B1A5-C434DD82678F@acm.org> (raw)
In-Reply-To: <CANCp2gb15cBQfSRx3eY_7Ba3vBT-hAijWAepgPZDg7z7dKgF+g@mail.gmail.com>

30 apr. 2022 kl. 18.25 skrev Rocky Bernstein <rocky@gnu.org>:

> I especially like and appreciate the comment in the C code in bytecode.c showing the Bytecode interpreter stack.

Many thanks for your kind words. Mustn't let an opportunity for making ASCII art go to waste!

> Now that we have a more normal bytecode stack, we have "saved_pc"  shouldn't it be possible to easily show the bytecode offset in lisp/emacs-lisp/backtrack.el ? 

That information is indeed accessible now, at least in principle; the stack format was designed with backtracing in mind. How to make effective use of it is another matter. A bytecode offset to source location mapping is perhaps more feasible now (with position-carrying symbols) but still a fair amount of work.

There are also questions about whether to carry around such a mapping all the time (memory cost etc). I like the idea of rematerialising it when needed but Elisp isn't easily conducive to that approach.

On the other hand, just exposing the bytecode offset in tracebacks could very well be useful on its own for users who can read disassembled bytecode.

Regarding the stack trace information, there is some redundancy that could be exploited: the backtrace recorded in the specpdl could probably be eliminated for calls into bytecode (and with some gymnastics, for other calls as well). Experiments have indicated that there are performance gains to be had here.

> Prior work on this can be found in https://lists.gnu.org/archive/html/emacs-devel/2020-07/msg00711.html

Thank you, this provides some interesting perspective. Some things have changed since but the big problems remain more or less the same.




      reply	other threads:[~2022-05-02  9:10 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-30 16:25 Does recent great work on separating the bytecode stack make it easier to show bytecode offsets in a traceback? Rocky Bernstein
2022-05-02  9:10 ` Mattias Engdegård [this message]

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=9702547E-EEFE-45D9-B1A5-C434DD82678F@acm.org \
    --to=mattiase@acm.org \
    --cc=emacs-devel@gnu.org \
    --cc=rocky@gnu.org \
    /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.