[PATCH] D99179: [RFC] [Coroutines] Enable printing coroutine frame in debugger if program is compiled with -g

Chuanqi Xu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 7 22:50:31 PDT 2021


ChuanqiXu added a comment.

In D99179#2672930 <https://reviews.llvm.org/D99179#2672930>, @rjmccall wrote:

> Normally we don't want passes making educated guesses about things and codifying that into debug info, but in this specific instance i don't think it's unreasonable, since the debug frame is an artificial type.  Ideally you would find the debug info that's present and use that to describe the frame layout as much as possible.  The way frame layout works should allow that kind of reversal well enough.
>
> The biggest conceptual problem is that, for the fields that you can't find debug info for, you'll have to either come up with a C type from the LLVM type or leave them out the layout entirely.  The latter seems like it would make this much less useful, but the former is really problematic because the sizes of C's fundamental types are so unportable.

The strategy now when we can't find corresponding debug info is to handle struct and basic type separately. For example, if a struct type with name "%class.foo" in LLVM, this patch would try to name it with `class_foo`. If it is basic type like i32 or i64, this patch would call it `i32` or `i64` directly instead of trying to get the corresponding C type like `int` or `long` which is not approximate.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D99179/new/

https://reviews.llvm.org/D99179



More information about the llvm-commits mailing list