[Dwarf-discuss] Coroutines

Kyle Huey khuey@pernos.co
Tue Feb 27 18:32:06 GMT 2024

On Wed, Feb 21, 2024 at 9:12 AM Adrian Prantl <aprantl@apple.com> wrote:

> Can you clarify what kind of information you are interested in? Are you
> talking about representing variables inside of coroutines, function
> pointers to coroutines, linetables for coroutines, ...?
> LLDB's Swift plugin for example supports Swift async functions (which are
> effectively coroutines) but does so without adding any new extensions to
> DWARF. Here's a recent talk from last year's LLVM dev meeting on that
> topic: https://www.youtube.om/watch?v=g4fei6Vl7o8
> <https://www.youtube.com/watch?v=g4fei6Vl7o8>

The async control flow parts of this (backtraces and stepping) are what I
am particularly interested in. Variables seem straightforward since DWARF
location expressions are already generic enough to let you point to heap
allocated storage for variables that survive across yield points. Your talk
is a good demo of the behavior I'd like to achieve (for Rust specifically).
A few technical questions:

How do you "identify" a particular chain of funclet invocations that go
together? I assume this is done based on the pointer identity of the

And the logic to understand what the async_context is and where it's found
at function entry points is hardcoded into the Swift plugin?

How do you handle pointer reuse on async_contexts?

- Kyle

> -- adrian
> > On Feb 20, 2024, at 11:47 AM, Kyle Huey via Dwarf-discuss <
> dwarf-discuss@lists.dwarfstd.org> wrote:
> >
> > Has anyone proposed or discussed DWARF structures to represent
> coroutines or similar constructs? I skimmed the open issues list and didn't
> see anything relevant.
> >
> > - Kyle
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.dwarfstd.org/pipermail/dwarf-discuss/attachments/20240227/30693a76/attachment.htm>

More information about the Dwarf-discuss mailing list