For the “which runtime is used in this program” question, I wonder whether embedded could expose a debugger-visible runtime identity symbol next to
_swift_concurrency_debug_internal_layout_version.
I think this is the crucial piece. More importantly, the "which runtime" is not exactly important, the crucial part is "how does this runtime -- whatever it may be -- stores its currently-executing-task-pointers?"
For that end, I prototyped another variable we expose in the Concurrency/Debug.h header capturing that very notion. Since this is a build-time configuration (for the target), LLDB can't really guess what happened there; a variable seems the only solution.
[Concurrency] Add _concurrency_current_task_storage_kind to Debug.h
[lldb] Detect how the swift runtime stores currently executing task
Possibly, but note that this is unfortunately quite tightly integrated into LLDB's abstractions (e.g. how it represents threads, etc). In the PR linked above, I tried to abstract away some of those details and expose the bare minimum required.
An important consideration: this mapping of Threads -> Task has to be fast. It happens on every single stop (there are usually many non-visible stops when a user is stepping over lines of code, and there are many non-visible stops during program startup). This is particularly important when communication between the debugger and the target is slower than local (e.g. over a wire, even a fast wire).