[Lldb-commits] Prevent type canonization when dereferencing

Lasse Folger via lldb-commits lldb-commits at lists.llvm.org
Wed Jun 2 02:39:01 PDT 2021


Hi lldb devs,

I prepared a small patch to improve the type consistency when dereferencing
values in lldb.

The problem I'm trying to solve is that the type of a value is canonized
(in clang) when the value is dereferenced.

Without the patch the test I added would return the type TTuple instead of
TPair.

There is one issue with the patch:
In theory the
*compiler_type.GetChildCompilerTypeAtIndex(*
call is not needed. Unfortunately, to get a name for the dereferenced
value, this call is needed since only the type system (at least clang)
knows a name.
The dereferenced value does not necessarily have a name. However, the clang
type system knows an alias (*name* if it is a reference or **name* if it is
a pointer).

I also tried to fix this issue in the type system directly
(lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp:6051).
However, changing that broke several tests.

Let me know what you think.

kind regards,
Lasse
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20210602/25d367c8/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-lldb-prevent-canonization-of-type-when-dereferencing.patch
Type: application/octet-stream
Size: 3867 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20210602/25d367c8/attachment.obj>


More information about the lldb-commits mailing list