[Lldb-commits] [lldb] [LLDB] Add AST node classes, functions, etc. for Data Inspection Lang… (PR #95738)

via lldb-commits lldb-commits at lists.llvm.org
Sun Jul 14 23:14:43 PDT 2024


cmtice wrote:

> On Jul 10, 2024, at 9:22 PM, cmtice ***@***.***> wrote: @cmtice commented on this pull request. In lldb/include/lldb/Core/DILAST.h <[#95738 (comment)](https://github.com/llvm/llvm-project/pull/95738#discussion_r1673380259)>: > +/// Checks to see if the CompilerType is a Smart Pointer (shared, unique, weak) +/// or not. Only applicable for C++, which is why this is here and not part of +/// the CompilerType class. When we go to dereference a pointer we need to know whether or not it's a smart pointer, because if it's a smart pointer we need to get at the pointer inside before we can dereference it. So we use IsSmartPtrType to determine whether or not to insert this layer of unwrapping (converting the smart ptr into a normal ptr).
> I'm not sure it's the job of the DIL to do this sort of unwrapping. Then it would have to support all the ways this might need to be done in every language we might end up supporting. This seems more a job for the data formatters provided by the various languages. That's why Pavel was asking about the special deference Synthetic Child Provider API, I think. That provides a way for various languages to encode this sort of behavior w/o it having to be know in advance by lldb. Jim
> […](#)
> — Reply to this email directly, view it on GitHub <[#95738 (comment)](https://github.com/llvm/llvm-project/pull/95738#discussion_r1673380259)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ADUPVW4J5FKAPSUTJYXSJODZLYB7TAVCNFSM6AAAAABJNJ3CAKVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDCNZQHA4DAOJYGE>. You are receiving this because you are on a team that was mentioned.

I can use the machinery that's already there in LLDB for dereferencig the smart pointers. But I can't treat smart pointers exactly the same as normal pointers -- among other things a ValueObject whose CompilerType is a smart pointer returns False for IsPointerType(), which causes errors in the code for handling normal pointers.  So as far as I can tell I still need my function (declared in DILAST.h) for telling me whether or not a type is a smart pointer type (which is what Pavel's original comment was about).

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


More information about the lldb-commits mailing list