<div dir="ltr">I think the problem is specific to references, at least that's the case I ran into in lldb-eval -- <a href="https://github.com/google/lldb-eval/blob/master/docs/lldb-bugs.md#dereferencing-a-value-canonizes-the-type">https://github.com/google/lldb-eval/blob/master/docs/lldb-bugs.md#dereferencing-a-value-canonizes-the-type</a></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, 2 Jun 2021 at 17:26, Raphael “Teemperor” Isemann <<a href="mailto:teemperor@gmail.com">teemperor@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">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:<br>
<br>
>>> lldb.frame.FindVariable("p_ref").GetType().GetName()<br>
'TPair &'<br>
>>> lldb.frame.FindVariable("p_ref").Dereference().GetType().GetName()<br>
'TTuple'<br>
<br>
(I made `p_ref` a local to avoid the expression evaluation machinery)<br>
<br>
Cheers,<br>
- Raphael<br>
<br>
> On 2 Jun 2021, at 15:27, Lasse Folger <<a href="mailto:lassefolger@google.com" target="_blank">lassefolger@google.com</a>> wrote:<br>
> <br>
> Hi Raphael,<br>
> <br>
> I have a very similar test for a tool that integrates with lldb which failed without the patch.<br>
> I thought the test in the patch would behave the same which is apparently not the case.<br>
> 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.<br>
> Sorry for the inconvenience.<br>
> <br>
> kind regards,<br>
> Lasse<br>
> <br>
> <br>
> On Wed, Jun 2, 2021 at 1:15 PM Raphael “Teemperor” Isemann <<a href="mailto:teemperor@gmail.com" target="_blank">teemperor@gmail.com</a>> wrote:<br>
> Hi Lasse,<br>
> <br>
> 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?<br>
> <br>
> 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.<br>
> <br>
> Cheers,<br>
> - Raphael<br>
> <br>
>> On 2 Jun 2021, at 11:39, Lasse Folger via lldb-commits <<a href="mailto:lldb-commits@lists.llvm.org" target="_blank">lldb-commits@lists.llvm.org</a>> wrote:<br>
>> <br>
>> <0001-lldb-prevent-canonization-of-type-when-dereferencing.patch><br>
> <br>
<br>
</blockquote></div>