[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
Tue Mar 23 20:24:40 PDT 2021


ChuanqiXu added a comment.

In D99179#2645763 <https://reviews.llvm.org/D99179#2645763>, @aprantl wrote:

> From a layering perspective, this is not something we would usually do. One immediate problem is that LLVM should be mostly language agnostic. For example the Swift compiler also uses to CoroSplit pass, and you wouldn't want to inject C++ type information into Swift functions. Maybe it would be cleaner for Clang to register an LLVM pass to run after CoroSplit that inserts the C++-specific debug info?

Sorry for I forgot the cases for swift and milr. Your suggestion makes sense. I put buildFrameDebugInfo in CoroFrame.cpp since the FrameDataInfo is maintained in this file only and this information would loss if buildCoroutineFrame ends. I think we need to do a big refactoring to extract the analysis part of the coroutine as an Analysis pass. This would be beneficial only for this patch. And a workaround maybe:

  - if (EnhanceDebugability)
  -    buildFrameDebugInfo(F, Shape, FrameData);
  + if (EnhanceDebugability && Shape.ABI == coro::ABI::Switch)
  +    buildFrameDebugInfo(F, Shape, FrameData);




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

https://reviews.llvm.org/D99179



More information about the llvm-commits mailing list