[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
Thu Apr 8 20:46:25 PDT 2021


ChuanqiXu added inline comments.


================
Comment at: llvm/lib/Transforms/Coroutines/CoroFrame.cpp:1026
+    SubProgram->replaceOperandWith(
+        7, (MDTuple::get(F.getContext(), RetainedNodesVec)));
+  }
----------------
aprantl wrote:
> I think we might be able to get away without adding the new variables to RetainedNodes. IIRC, the RetainedNodes is there to guarantee that variables that are optimized out still make it into the debug info even if no dbg.value points to them. But for artificial variables like these, there is probably no point in preserving them because they are only interesting if they actually have a value.
If we don't add the new variables to RetianedNodes, when user try to pint the frame in the debugger, user may get `no symbol __coro_frame in context`. And now user may get `__coro_frame is optimized out`. I think the latter may be more friendly to users.


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

https://reviews.llvm.org/D99179



More information about the llvm-commits mailing list