Re: [lldb-dev] Issue: print std unique pointer

2018-03-02 Thread Alexandre Yukio Yamashita via lldb-dev
Implemented a fix in: https://reviews.llvm.org/D44015
Could you please review it?


Em 28/02/2018 16:07, Pavel Labath escreveu:
> I think this is the interesting part: std::__uniq_ptr_impl std::default_delete >
>
> There is no such type in the example I posted. It looks like the
> implementation of std::unique_ptr changed, and they added an extra
> member object. This tells me the fix should be in the data formatter
> for std::unique_ptr and not std::tuple (which makes sense, because
> your std::tuple tests are still passing (?)). We should detect the new
> layout and format based on that. It would also be good to know in
> which libstdc++ version this changed, so we can leave a note to future
> selves about when can this be cleaned up.
>
> On 28 February 2018 at 05:25, Alexandre Yukio Yamashita
>  wrote:
>> All the test cases in TestDataFormatterStdUniquePtr were failing.
>> My std::unique_ptr layout is:
>>
>>  (std::unique_ptr) iup = {
>>(std::__uniq_ptr_impl) _M_t = {
>>  (std::tuple >) _M_t = {
>>(std::_Tuple_impl<0, int *, std::default_delete >)
>> std::_Tuple_impl<0, int *, std::default_delete > = {
>>  (std::_Head_base<0, int *, false>) std::_Head_base<0, int *,
>> false> = {
>>(int *) _M_head_impl = 0x10041c20
>>  }
>>}
>>  }
>>}
>>  }
>>
>> It is showing "std::tuple >) _M_t"
>> instead of "std::_Tuple_impl<0, int *, std::default_delete >".
>>
>>
>> Em 27/02/2018 19:34, Greg Clayton escreveu:
>>
>> Then the question becomes how can we identify the STL that is being used
>> correctly so we can do the right thing. I worry that if std::unique_ptr
>> isn't working that many many other STL things won't work as well. We are
>> tuned for a specific STL
>>
>> On Feb 27, 2018, at 2:12 PM, Pavel Labath via lldb-dev
>>  wrote:
>>
>> This probably isn't arch-dependent. More likely you just have a
>> different version of libstdc++. Can you share how the std::unique_ptr
>> layout looks like for you. This is how my std::unique_ptr looks like
>> (from libstdc++.so.6.0.22):
>>
>> (lldb) fr var X -R -T
>> (std::unique_ptr) X = {
>>   (std::unique_ptr::__tuple_type) _M_t = {
>> (std::_Tuple_impl<0, int *, std::default_delete >)
>> std::_Tuple_impl<0, int *, std::default_delete > = {
>>   (std::_Head_base<0, int *, false>) std::_Head_base<0, int *, false> = {
>> (int *) _M_head_impl = 0x55768c20
>>   }
>> }
>>   }
>> }
>>
>> On 27 February 2018 at 12:26, Alexandre Yukio Yamashita via lldb-dev
>>  wrote:
>>
>> Hi,
>>
>> LLDB is printing a empty value for unique pointers in PowerPC.
>> And I am investigating a solution for this problem.
>>
>> The problem occurs because the ptr_obj variable has a empty value in
>> Plugins/Language/CPlusPlus/LibStdcppUniquePointer.cpp:73.
>>
>> I could solve it, changing this line
>> Plugins/Language/CPlusPlus/LibStdcppTuple.cpp:68
>> from:
>>  if (name_str.startswith("std::_Tuple_impl<")) {
>> to:
>>  if (name_str.startswith("std::_Tuple_impl<") ||
>> name_str.startswith("_M_t") ) {
>>
>> After this change, the test TestDataFormatterStdUniquePtr pass with success.
>> And the unique pointers are displayed correctly.
>>
>> Is there a better solution for that?
>>
>> Thanks.
>> Alexandre.
>>
>>
>> --
>> Alexandre Yukio Yamashita (DSB)
>> Instituto de Pesquisas Eldorado
>> www.eldorado.org.br
>> +55 19 3757 3201 / +55 19 9 8336 5553
>> ___
>> lldb-dev mailing list
>> lldb-dev@lists.llvm.org
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev
>>
>> ___
>> lldb-dev mailing list
>> lldb-dev@lists.llvm.org
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev
>>
>>
>> --
>> Alexandre Yukio Yamashita (DSB)
>> Instituto de Pesquisas Eldorado
>> www.eldorado.org.br
>> +55 19 3757 3201 / +55 19 9 8336 5553

-- 
Alexandre Yukio Yamashita (DSB)
Instituto de Pesquisas Eldorado
www.eldorado.org.br
+55 19 3757 3201 / +55 19 9 8336 5553
___
lldb-dev mailing list
lldb-dev@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev


Re: [lldb-dev] Issue: print std unique pointer

2018-02-28 Thread Pavel Labath via lldb-dev
I think this is the interesting part: std::__uniq_ptr_impl

There is no such type in the example I posted. It looks like the
implementation of std::unique_ptr changed, and they added an extra
member object. This tells me the fix should be in the data formatter
for std::unique_ptr and not std::tuple (which makes sense, because
your std::tuple tests are still passing (?)). We should detect the new
layout and format based on that. It would also be good to know in
which libstdc++ version this changed, so we can leave a note to future
selves about when can this be cleaned up.

On 28 February 2018 at 05:25, Alexandre Yukio Yamashita
 wrote:
> All the test cases in TestDataFormatterStdUniquePtr were failing.
> My std::unique_ptr layout is:
>
> (std::unique_ptr) iup = {
>   (std::__uniq_ptr_impl) _M_t = {
> (std::tuple >) _M_t = {
>   (std::_Tuple_impl<0, int *, std::default_delete >)
> std::_Tuple_impl<0, int *, std::default_delete > = {
> (std::_Head_base<0, int *, false>) std::_Head_base<0, int *,
> false> = {
>   (int *) _M_head_impl = 0x10041c20
> }
>   }
> }
>   }
> }
>
> It is showing "std::tuple >) _M_t"
> instead of "std::_Tuple_impl<0, int *, std::default_delete >".
>
>
> Em 27/02/2018 19:34, Greg Clayton escreveu:
>
> Then the question becomes how can we identify the STL that is being used
> correctly so we can do the right thing. I worry that if std::unique_ptr
> isn't working that many many other STL things won't work as well. We are
> tuned for a specific STL
>
> On Feb 27, 2018, at 2:12 PM, Pavel Labath via lldb-dev
>  wrote:
>
> This probably isn't arch-dependent. More likely you just have a
> different version of libstdc++. Can you share how the std::unique_ptr
> layout looks like for you. This is how my std::unique_ptr looks like
> (from libstdc++.so.6.0.22):
>
> (lldb) fr var X -R -T
> (std::unique_ptr) X = {
>  (std::unique_ptr::__tuple_type) _M_t = {
>(std::_Tuple_impl<0, int *, std::default_delete >)
> std::_Tuple_impl<0, int *, std::default_delete > = {
>  (std::_Head_base<0, int *, false>) std::_Head_base<0, int *, false> = {
>(int *) _M_head_impl = 0x55768c20
>  }
>}
>  }
> }
>
> On 27 February 2018 at 12:26, Alexandre Yukio Yamashita via lldb-dev
>  wrote:
>
> Hi,
>
> LLDB is printing a empty value for unique pointers in PowerPC.
> And I am investigating a solution for this problem.
>
> The problem occurs because the ptr_obj variable has a empty value in
> Plugins/Language/CPlusPlus/LibStdcppUniquePointer.cpp:73.
>
> I could solve it, changing this line
> Plugins/Language/CPlusPlus/LibStdcppTuple.cpp:68
> from:
> if (name_str.startswith("std::_Tuple_impl<")) {
> to:
> if (name_str.startswith("std::_Tuple_impl<") ||
> name_str.startswith("_M_t") ) {
>
> After this change, the test TestDataFormatterStdUniquePtr pass with success.
> And the unique pointers are displayed correctly.
>
> Is there a better solution for that?
>
> Thanks.
> Alexandre.
>
>
> --
> Alexandre Yukio Yamashita (DSB)
> Instituto de Pesquisas Eldorado
> www.eldorado.org.br
> +55 19 3757 3201 / +55 19 9 8336 5553
> ___
> lldb-dev mailing list
> lldb-dev@lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev
>
> ___
> lldb-dev mailing list
> lldb-dev@lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev
>
>
> --
> Alexandre Yukio Yamashita (DSB)
> Instituto de Pesquisas Eldorado
> www.eldorado.org.br
> +55 19 3757 3201 / +55 19 9 8336 5553
___
lldb-dev mailing list
lldb-dev@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev


Re: [lldb-dev] Issue: print std unique pointer

2018-02-28 Thread Alexandre Yukio Yamashita via lldb-dev
All the test cases in TestDataFormatterStdUniquePtr were failing.
My std::unique_ptr layout is:

(std::unique_ptr) iup = {
  (std::__uniq_ptr_impl) _M_t = {
(std::tuple >) _M_t = {
  (std::_Tuple_impl<0, int *, std::default_delete >) 
std::_Tuple_impl<0, int *, std::default_delete > = {
(std::_Head_base<0, int *, false>) std::_Head_base<0, int *, false> 
= {
  (int *) _M_head_impl = 0x10041c20
}
  }
}
  }
}

It is showing "std::tuple >) _M_t"
instead of "std::_Tuple_impl<0, int *, std::default_delete >".

Em 27/02/2018 19:34, Greg Clayton escreveu:

Then the question becomes how can we identify the STL that is being used 
correctly so we can do the right thing. I worry that if std::unique_ptr isn't 
working that many many other STL things won't work as well. We are tuned for a 
specific STL



On Feb 27, 2018, at 2:12 PM, Pavel Labath via lldb-dev 
 wrote:

This probably isn't arch-dependent. More likely you just have a
different version of libstdc++. Can you share how the std::unique_ptr
layout looks like for you. This is how my std::unique_ptr looks like
(from libstdc++.so.6.0.22):

(lldb) fr var X -R -T
(std::unique_ptr) X = {
 (std::unique_ptr::__tuple_type) _M_t = {
   (std::_Tuple_impl<0, int *, std::default_delete >)
std::_Tuple_impl<0, int *, std::default_delete > = {
 (std::_Head_base<0, int *, false>) std::_Head_base<0, int *, false> = {
   (int *) _M_head_impl = 0x55768c20
 }
   }
 }
}

On 27 February 2018 at 12:26, Alexandre Yukio Yamashita via lldb-dev
 wrote:


Hi,

LLDB is printing a empty value for unique pointers in PowerPC.
And I am investigating a solution for this problem.

The problem occurs because the ptr_obj variable has a empty value in
Plugins/Language/CPlusPlus/LibStdcppUniquePointer.cpp:73.

I could solve it, changing this line
Plugins/Language/CPlusPlus/LibStdcppTuple.cpp:68
from:
if (name_str.startswith("std::_Tuple_impl<")) {
to:
if (name_str.startswith("std::_Tuple_impl<") ||
name_str.startswith("_M_t") ) {

After this change, the test TestDataFormatterStdUniquePtr pass with success.
And the unique pointers are displayed correctly.

Is there a better solution for that?

Thanks.
Alexandre.


--
Alexandre Yukio Yamashita (DSB)
Instituto de Pesquisas Eldorado
www.eldorado.org.br
+55 19 3757 3201 / +55 19 9 8336 5553
___
lldb-dev mailing list
lldb-dev@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev


___
lldb-dev mailing list
lldb-dev@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev





--
Alexandre Yukio Yamashita (DSB)
Instituto de Pesquisas Eldorado
www.eldorado.org.br
+55 19 3757 3201 / +55 19 9 8336 5553
___
lldb-dev mailing list
lldb-dev@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev


Re: [lldb-dev] Issue: print std unique pointer

2018-02-27 Thread Greg Clayton via lldb-dev
Then the question becomes how can we identify the STL that is being used 
correctly so we can do the right thing. I worry that if std::unique_ptr isn't 
working that many many other STL things won't work as well. We are tuned for a 
specific STL

> On Feb 27, 2018, at 2:12 PM, Pavel Labath via lldb-dev 
>  wrote:
> 
> This probably isn't arch-dependent. More likely you just have a
> different version of libstdc++. Can you share how the std::unique_ptr
> layout looks like for you. This is how my std::unique_ptr looks like
> (from libstdc++.so.6.0.22):
> 
> (lldb) fr var X -R -T
> (std::unique_ptr) X = {
>  (std::unique_ptr::__tuple_type) _M_t = {
>(std::_Tuple_impl<0, int *, std::default_delete >)
> std::_Tuple_impl<0, int *, std::default_delete > = {
>  (std::_Head_base<0, int *, false>) std::_Head_base<0, int *, false> = {
>(int *) _M_head_impl = 0x55768c20
>  }
>}
>  }
> }
> 
> On 27 February 2018 at 12:26, Alexandre Yukio Yamashita via lldb-dev
>  wrote:
>> Hi,
>> 
>> LLDB is printing a empty value for unique pointers in PowerPC.
>> And I am investigating a solution for this problem.
>> 
>> The problem occurs because the ptr_obj variable has a empty value in
>> Plugins/Language/CPlusPlus/LibStdcppUniquePointer.cpp:73.
>> 
>> I could solve it, changing this line
>> Plugins/Language/CPlusPlus/LibStdcppTuple.cpp:68
>> from:
>> if (name_str.startswith("std::_Tuple_impl<")) {
>> to:
>> if (name_str.startswith("std::_Tuple_impl<") ||
>> name_str.startswith("_M_t") ) {
>> 
>> After this change, the test TestDataFormatterStdUniquePtr pass with success.
>> And the unique pointers are displayed correctly.
>> 
>> Is there a better solution for that?
>> 
>> Thanks.
>> Alexandre.
>> 
>> 
>> --
>> Alexandre Yukio Yamashita (DSB)
>> Instituto de Pesquisas Eldorado
>> www.eldorado.org.br
>> +55 19 3757 3201 / +55 19 9 8336 5553
>> ___
>> lldb-dev mailing list
>> lldb-dev@lists.llvm.org
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev
> ___
> lldb-dev mailing list
> lldb-dev@lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev

___
lldb-dev mailing list
lldb-dev@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev


Re: [lldb-dev] Issue: print std unique pointer

2018-02-27 Thread Pavel Labath via lldb-dev
This probably isn't arch-dependent. More likely you just have a
different version of libstdc++. Can you share how the std::unique_ptr
layout looks like for you. This is how my std::unique_ptr looks like
(from libstdc++.so.6.0.22):

(lldb) fr var X -R -T
(std::unique_ptr) X = {
  (std::unique_ptr::__tuple_type) _M_t = {
(std::_Tuple_impl<0, int *, std::default_delete >)
std::_Tuple_impl<0, int *, std::default_delete > = {
  (std::_Head_base<0, int *, false>) std::_Head_base<0, int *, false> = {
(int *) _M_head_impl = 0x55768c20
  }
}
  }
}

On 27 February 2018 at 12:26, Alexandre Yukio Yamashita via lldb-dev
 wrote:
> Hi,
>
> LLDB is printing a empty value for unique pointers in PowerPC.
> And I am investigating a solution for this problem.
>
> The problem occurs because the ptr_obj variable has a empty value in
> Plugins/Language/CPlusPlus/LibStdcppUniquePointer.cpp:73.
>
> I could solve it, changing this line
> Plugins/Language/CPlusPlus/LibStdcppTuple.cpp:68
> from:
>  if (name_str.startswith("std::_Tuple_impl<")) {
> to:
>  if (name_str.startswith("std::_Tuple_impl<") ||
> name_str.startswith("_M_t") ) {
>
> After this change, the test TestDataFormatterStdUniquePtr pass with success.
> And the unique pointers are displayed correctly.
>
> Is there a better solution for that?
>
> Thanks.
> Alexandre.
>
>
> --
> Alexandre Yukio Yamashita (DSB)
> Instituto de Pesquisas Eldorado
> www.eldorado.org.br
> +55 19 3757 3201 / +55 19 9 8336 5553
> ___
> lldb-dev mailing list
> lldb-dev@lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev
___
lldb-dev mailing list
lldb-dev@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev


Re: [lldb-dev] Issue: print std unique pointer

2018-02-27 Thread Greg Clayton via lldb-dev
It depends on the version of the C++ standard library you are using. Is this 
the only thing that isn't working in the STL data formatters? I would expect 
the STL library to be the same on PowerPC as it is on other platforms so I 
wouldn't guess this would be an issue that is arch dependent.

Greg Clayton


> On Feb 27, 2018, at 12:26 PM, Alexandre Yukio Yamashita via lldb-dev 
>  wrote:
> 
> Hi,
> 
> LLDB is printing a empty value for unique pointers in PowerPC.
> And I am investigating a solution for this problem.
> 
> The problem occurs because the ptr_obj variable has a empty value in 
> Plugins/Language/CPlusPlus/LibStdcppUniquePointer.cpp:73.
> 
> I could solve it, changing this line 
> Plugins/Language/CPlusPlus/LibStdcppTuple.cpp:68
> from:
> if (name_str.startswith("std::_Tuple_impl<")) {
> to:
> if (name_str.startswith("std::_Tuple_impl<") || 
> name_str.startswith("_M_t") ) {
> 
> After this change, the test TestDataFormatterStdUniquePtr pass with success.
> And the unique pointers are displayed correctly.
> 
> Is there a better solution for that?
> 
> Thanks.
> Alexandre.
> 
> 
> -- 
> Alexandre Yukio Yamashita (DSB)
> Instituto de Pesquisas Eldorado
> www.eldorado.org.br
> +55 19 3757 3201 / +55 19 9 8336 5553
> ___
> lldb-dev mailing list
> lldb-dev@lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev

___
lldb-dev mailing list
lldb-dev@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev