[PATCH] D94388: [Coroutine][DebugInfo] Enhance the ability of coroutine to debug parameters under O2
JunMa via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Feb 23 21:07:52 PST 2021
junparser added a comment.
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