public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: Andrey Turkin via Gdb <gdb@sourceware.org>
Cc: Andrey Turkin <andrey.turkin+gdbml@gmail.com>
Subject: Re: "previous frame inner to this frame" error when unwinding fibers
Date: Sun, 10 Dec 2023 15:30:26 -0700	[thread overview]
Message-ID: <874jgp7ksd.fsf@tromey.com> (raw)
In-Reply-To: <CAA7-Zor4XNXq8c-BY0r89gMNrk4ys=-Ota2=-FKh-61pHQdeVw@mail.gmail.com> (Andrey Turkin via Gdb's message of "Fri, 8 Dec 2023 20:50:19 +0300")

>>>>> "Andrey" == Andrey Turkin via Gdb <gdb@sourceware.org> writes:

Andrey> I'm trying to write a custom unwinder in Python to unwind through
Andrey> boost coroutine (so, follow coroutine stack with its caller's stack).
Andrey> It generally works pretty well except for occasional errors about the
Andrey> inner frame. Obviously, coroutine switches stack so comparing frame
Andrey> pointers makes no sense; so, when caller stack happens to be allocated
Andrey> above coroutine's, the bogus error occurs.
Andrey> I can see in gdb sources that it knows about gcc's split-stacks and
Andrey> apparently arch-specific frames, however I found no way for the
Andrey> unwinder to do anything about it. Is there any way to fix this error
Andrey> with the current gdb, or do I need to patch the sources?

You'll need to patch gdb.  The current code for handling this sort of
thing is totally ad hoc and can't be tweaked by the user or from Python.

Letting Python unwinders affect this seems like a nice feature.  Like
maybe a method on gdb.UnwindInfo that sets a flag, then pipe this
through to the check in get_prev_frame_always_1.

Maybe some other way is better, I don't know.  I'm definitely open to
ideas and I think this is worth solving -- I feel it's been asked for
before.

Tom

  reply	other threads:[~2023-12-10 22:30 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-08 17:50 Andrey Turkin
2023-12-10 22:30 ` Tom Tromey [this message]
2023-12-11  7:44   ` Andrey Turkin
2023-12-11 17:46     ` Tom Tromey
2023-12-20 14:18       ` Andrey Turkin
2023-12-22  0:30         ` Tom Tromey
2023-12-22 19:19           ` Tom Tromey
2024-01-04 10:00             ` Andrey Turkin
2024-01-21 16:57               ` Tom Tromey

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=874jgp7ksd.fsf@tromey.com \
    --to=tom@tromey.com \
    --cc=andrey.turkin+gdbml@gmail.com \
    --cc=gdb@sourceware.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.
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).