[Lldb-commits] [lldb] [LLDB] Don't ignore artificial variables and members for coroutines (PR #70779)

Haojian Wu via lldb-commits lldb-commits at lists.llvm.org
Fri Nov 3 04:09:19 PDT 2023


================
@@ -41,7 +41,10 @@ CPPLanguageRuntime::CPPLanguageRuntime(Process *process)
     : LanguageRuntime(process) {}
 
 bool CPPLanguageRuntime::IsAllowedRuntimeValue(ConstString name) {
-  return name == g_this;
+  // FIXME: use a list when the list grows more.
+  return name == g_this ||
+         name == ConstString("__promise") ||
+         name == ConstString("__coro_frame");
----------------
hokein wrote:

> I am not sure if I would expose the __coro_frame variable.
For completeness, I'm leaning towards exposing `__coro_frame` as well, even though it is not that useful.

> Any chance we can get the Type from the Variable in CommandObjectFrameVariable and can re-use the IsCoroutineFrameType check?

Yes, we can get the Type in `CommandObjectFrameVariable` by calling `valobj_sp->GetCompilerType();`. 
However it only works for the coroutine-frame variables,  other variables like `__promise` (whose type is a user-defined promise_type) are still not available. One idea is to make the `IsCoroutineFrameType` more generic to check coroutine-relevant types (promise_type, coroutine_frame_type).

https://github.com/llvm/llvm-project/pull/70779


More information about the lldb-commits mailing list