[Lldb-commits] Prevent type canonization when dereferencing

Raphael “Teemperor” Isemann via lldb-commits lldb-commits at lists.llvm.org
Wed Jun 2 08:26:11 PDT 2021


I assume your bug is for dereferencing references? In your test taking the ref variable and then dereferencing it via the SB API reproduces that I think you're running into:

>>> lldb.frame.FindVariable("p_ref").GetType().GetName()
'TPair &'
>>> lldb.frame.FindVariable("p_ref").Dereference().GetType().GetName()
'TTuple'

(I made `p_ref` a local to avoid the expression evaluation machinery)

Cheers,
- Raphael

> On 2 Jun 2021, at 15:27, Lasse Folger <lassefolger at google.com> wrote:
> 
> Hi Raphael,
> 
> I have a very similar test for a tool that integrates with lldb which failed without the patch.
> I thought the test in the patch would behave the same which is apparently not the case.
> Thanks for pointing that out. I will need to take another look and will get back to you once I figure out what's wrong.
> Sorry for the inconvenience.
> 
> kind regards,
> Lasse
> 
> 
> On Wed, Jun 2, 2021 at 1:15 PM Raphael “Teemperor” Isemann <teemperor at gmail.com> wrote:
> Hi Lasse,
> 
> the test from the patch passes for me even without your non-test changes. Not sure if you attached the wrong diff or it needs to be applied on a specific commit that is not ToT? Can you maybe try pushing your code to some git repo?
> 
> Your change to TypeSystemClang (which I assume removes the canonicalization of parent_qual_type) is from what I can see not actually changing the result value of `GetChildCompilerTypeAtIndex`. It looks like the return value for pointer types is computed independently from `parent_qual_type` without any canonicalization.
> 
> Cheers,
> - Raphael
> 
>> On 2 Jun 2021, at 11:39, Lasse Folger via lldb-commits <lldb-commits at lists.llvm.org> wrote:
>> 
>> <0001-lldb-prevent-canonization-of-type-when-dereferencing.patch>
> 



More information about the lldb-commits mailing list