[PATCH] D94388: [Coroutine][DebugInfo] Enhance the ability of coroutine to debug parameters under O2

Yifeng Dong via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 23 21:17:25 PST 2021


dongAxis1944 added a comment.

hi @junparser & @aprantl

  As @junparser mentioned, there are some senses that both variables will be used. When it happens, gdb or lldb will fail to print some variables under o1 and above.
  For solving this problems, we would like to merge two variables into one.
  Do you have any suggestions?

Thanks in advance.

In D94388#2583862 <https://reviews.llvm.org/D94388#2583862>, @junparser wrote:

> In D94388#2583321 <https://reviews.llvm.org/D94388#2583321>, @aprantl wrote:
>
>> In D94388#2570198 <https://reviews.llvm.org/D94388#2570198>, @junparser wrote:
>>
>>> 
>>
>>
>>
>>>> If I understand correctly, what ends up as the "real" function parameters in DWARF are the function arguments passed into the coro entry point, and the artificial variables are what is stored in the CoroFrame, and those are the only ones visible in the .resume funclets. Is this correct? If yes, we probably do want both to be visible, because they end up in different funclets.
>>>
>>> With O1 <https://reviews.llvm.org/owners/package/1/> or above, yes, we can only see artificial variables in .resume function. IIUC, we want see "real" function parameters in ramp function and artificial variables in resume function and they do have different scope, then the debugger may print them correctly. am i right?
>>
>> I don't think that we want the variables in the resume functions to be artificial. As far as the end-user is concerned, these are the real variables, the fact that they they have been processed by the compiler in order to pass them to the resume function is an implementation detail that the end-user shouldn't need to know about. I think it would be best to change the Clang frontend to emit these variables not as artificial. They are currently being marked as artificial because they are derived from an implicit declaration. We could either change the AST to drop the implicit bit, or special-case them in CGDebugInfo.
>>
>> LLDB (and maybe other debuggers too) hide all artificial variables by default, so it would valuable to not mark them as artificial.
>
> @aprantl, In some cases, the ramp function may contains both of the variables, this may confuse the debuggers.




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

https://reviews.llvm.org/D94388



More information about the llvm-commits mailing list