all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Gerd Möllmann" <gerd.moellmann@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: Alan Mackenzie <acm@muc.de>,  emacs-devel@gnu.org
Subject: Re: gdb doesn't print Lisp backtrace in some circumstances.
Date: Fri, 12 Apr 2024 16:48:24 +0200	[thread overview]
Message-ID: <m2zftyy6vb.fsf@Pro.fritz.box> (raw)
In-Reply-To: <86pluusunr.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 12 Apr 2024 14:11:04 +0300")

Eli Zaretskii <eliz@gnu.org> writes:

>> Date: Fri, 12 Apr 2024 10:31:53 +0000
>> From: Alan Mackenzie <acm@muc.de>
>> 
>> Yesterday I got a core dump from a segmentation fault in Emacs (my
>> development version, not master).  I loaded this into gdb inside Emacs
>> to have a look at it.
>> 
>> The backtrace command output the C data as it should, but on coming to
>> the Lisp backtrace gave an error message about there needing to be a
>> process running to "do this".  (I don't have the exact message any
>> more.)  It would seem these fancy Lisp facilities only work when the
>> process that produced them is still running.
>
> Yes, because they call functions inside Emacs to format Lisp objects.
>
>> All the information required to produce this Lisp backtrace is present
>> in the core dump.  Would it be possible, perhaps, to modify our .gdbinit
>> to use the running Emacs to process the core dump, or something like
>> that?
>
> I don't think so, no.  But you can reproduce the Lisp backtrace
> manually (albeit tediously, by going over all the calls to Ffuncall,
> eval_sub and suchlikes, and displaying their arg[0].  If it's a
> symbol, typing xsymbol should show you the Lisp function being called.
> If it is not a symbol, you could use xcar/xcdr etc., but that is much
> more tedious, and I usually give up on those frames in the stack.

I think it's easier to go through the specbinding stack
(current_thread->m_specdl). For LLDB, I did that in the xbacktrace
function in etc/emacs_lldb.py.



  parent reply	other threads:[~2024-04-12 14:48 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-12 10:31 gdb doesn't print Lisp backtrace in some circumstances Alan Mackenzie
2024-04-12 11:11 ` Eli Zaretskii
2024-04-12 11:29   ` Alan Mackenzie
2024-04-12 12:03     ` Eli Zaretskii
2024-04-12 13:18       ` Alan Mackenzie
2024-04-12 13:24         ` Eli Zaretskii
2024-04-13 10:07           ` Alan Mackenzie
2024-04-12 14:48   ` Gerd Möllmann [this message]
2024-04-12 14:56     ` Gerd Möllmann
2024-04-12 15:08       ` 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=m2zftyy6vb.fsf@Pro.fritz.box \
    --to=gerd.moellmann@gmail.com \
    --cc=acm@muc.de \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@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.