<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"><base href="x-msg://3875/"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">If you are using GetPointeeData() it is a known bug in LLDB, which was resolved in r 161384<div><br></div><div>If that does not fix the issue, please do let us know with a reproduction case :-)</div><div><br><div>
<span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="orphans: 2; text-align: -webkit-auto; text-indent: 0px; widows: 2; -webkit-text-decorations-in-effect: none; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div style="border-collapse: separate; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; color: rgb(0, 0, 0); "><i>Enrico Granata</i></div><div style="border-collapse: separate; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; ">✉ egranata@<font class="Apple-style-span" color="#ff230e"></font>.com</div><div>✆ (408) 972-7683</div></div></span></div></span></div></span></span>
</div>
<br><div><div>On Aug 8, 2012, at 2:27 PM, Alexander Angriawan <<a href="mailto:angriawan@hotmail.com">angriawan@hotmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div class="hmmessage" style="font-size: 12pt; font-family: Calibri; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div dir="ltr">Attached. <div><span style="font-size: 12pt; ">But this doesn't work with global variables and I haven't had chance to look at it.</span></div><div><br></div><div><div><br></div><div><div id="SkyDrivePlaceholder"></div><hr id="stopSpelling">Subject: Re: [lldb-dev] Formatter for std::shared_ptr<std::wstring><br>From:<span class="Apple-converted-space"> </span><a href="mailto:egranata@apple.com">egranata@apple.com</a><br>Date: Wed, 8 Aug 2012 09:48:34 -0700<br>CC:<span class="Apple-converted-space"> </span><a href="mailto:nino.kettlitz@googlemail.com">nino.kettlitz@googlemail.com</a>;<span class="Apple-converted-space"> </span><a href="mailto:lldb-dev@cs.uiuc.edu">lldb-dev@cs.uiuc.edu</a><br>To:<span class="Apple-converted-space"> </span><a href="mailto:angriawan@hotmail.com">angriawan@hotmail.com</a><br><br>Alexander,<div>feel free to share your script if you desire.</div><div>I can work on integrating it into mainline LLDB.</div><div><br></div><div>Thanks!</div><div><br><div><span class="ecxApple-style-span" style="border-collapse: separate; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; font-size: medium; "><div style="border-collapse: separate; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-transform: none; white-space: normal; word-spacing: 0px; font-size: medium; "><i>Enrico Granata</i></div><img src="https://gfx6.hotmail.com/mail/w5/m4/ltr/emoji/emoji_02709.png" class="Emoji$02709$1527 RenderedEmoji" title="Envelope" alt="Envelope"> egranata@<font class="ecxApple-style-span" color="#ff230e"></font>.com<div>✆ (408) 972-7683</div></span></div><br><div><div>On Aug 7, 2012, at 8:41 PM, Alexander Angriawan <<a href="mailto:angriawan@hotmail.com">angriawan@hotmail.com</a>> wrote:</div><br class="ecxApple-interchange-newline"><blockquote><div class="ecxhmmessage"><div dir="ltr"><div dir="ltr">Hi,<br> <br>I got it working. <span class="Apple-converted-space"> </span><br>I follow example from the following to navigate and Nino's script to read the char.<br><a href="http://llvm.org/svn/llvm-project/lldb/trunk/examples/synthetic/libcxx.py" target="_blank">http://llvm.org/svn/llvm-project/lldb/trunk/examples/synthetic/libcxx.py</a></div><div dir="ltr"><br></div><div dir="ltr">I can post the script if needed.</div><div dir="ltr"><br></div><div dir="ltr">thanks,</div><div dir="ltr">PA<br><br> <br><div><div id="ecxSkyDrivePlaceholder"></div><hr id="ecxstopSpelling">Subject: Re: [lldb-dev] Formatter for std::shared_ptr<std::wstring><br>From:<span class="Apple-converted-space"> </span><a href="mailto:egranata@apple.com">egranata@apple.com</a><br>Date: Mon, 6 Aug 2012 11:54:51 -0700<br>CC:<span class="Apple-converted-space"> </span><a href="mailto:angriawan@hotmail.com">angriawan@hotmail.com</a>;<span class="Apple-converted-space"> </span><a href="mailto:lldb-dev@cs.uiuc.edu">lldb-dev@cs.uiuc.edu</a><br>To:<span class="Apple-converted-space"> </span><a href="mailto:nino.kettlitz@googlemail.com">nino.kettlitz@googlemail.com</a><br><br>Alexander is using libcpp, part of the LLVM project, whereas you are using libstdcpp (a GNU project).<div>They both implement the C++ Standard Library but with different internals!</div><div>Luckily they are easy to differentiate because libcpp classes lived in a std::__1 namespace<br><div><br><div><span class="ecxApple-style-span" style="text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; border-collapse: separate; orphans: 2; widows: 2; "><div style="text-transform: none; letter-spacing: normal; word-spacing: 0px; white-space: normal; border-collapse: separate; "><i>Enrico Granata</i></div><img class="ecxEmoji$02709$1527 ecxRenderedEmoji" title="Envelope" alt="Envelope" src="https://gfx6.hotmail.com/mail/w5/m4/ltr/emoji/emoji_02709.png"> egranata@<font class="ecxApple-style-span" color="#ff230e"></font>.com✆ <span class="ecxbaec5a81-e4d6-4674-97f3-e9220f0136c1" style="white-space: nowrap; ">(408) 972-7683<a title="Call: (408) 972-7683" target="_blank" style="border: currentcolor; left: 0px; top: 0px; width: 16px; height: 16px; right: 0px; bottom: 0px; overflow: hidden; vertical-align: middle; float: none; display: inline; white-space: nowrap; "><img title="Call: (408) 972-7683" src="https://gfx6.hotmail.com/mail/w5/m4/ltr/i_safe.gif" style="border: currentcolor; left: 0px; top: 0px; width: 16px; height: 16px; right: 0px; bottom: 0px; overflow: hidden; vertical-align: middle; float: none; display: inline; white-space: nowrap; "></a></span></span></div><br><div><div>On Aug 6, 2012, at 11:52 AM, Nino Kettlitz <<a href="mailto:nino.kettlitz@googlemail.com">nino.kettlitz@googlemail.com</a>> wrote:</div><br class="ecxApple-interchange-newline"><blockquote><div><div class="ecxmoz-cite-prefix">Hi Alexander,<br><br>your string implementation looks very complicated.<br><br>Also the type of the string looks strange. I would expect that "std::wstring" is a typedef<br>for "std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t>"<br><br>You are using "std::__1::wstring" and the real type also contains this "__1" stuff<br>"std::__1::basic_string<wchar_t, std::__1::char_traits<wchar_t>, std::__1::allocator<wchar_t>>"<br>and it is additionally wrapped by a std::pair or sth similar.<span class="Apple-converted-space"> </span><br><br>I've never seen this before. Maybe somebody else in the mailing list did?!<br><br>So the wstring.py data formater works only for std::wstring with a "_M_dataplus" and a "_M_p" member<br><br>Cheers,<br>Nino<br><br><br><br><br>Am 06.08.2012 19:47, schrieb Alexander Angriawan:<br></div><blockquote cite="mid:BAY002-W149A8AC267B6A68FD2E500DA5CF0@phx.gbl"><div dir="ltr">I am using Mac OS X Version 10.7.4<div><span style="font-size: 12pt; ">The following is the lldb output:</span></div><div><div style="margin: 0px; padding: 0px; "><span class="ecxs1"><b>(lldb)<span class="Apple-converted-space"> </span></b></span><b>frame variable x</b></div><div style="margin: 0px; padding: 0px; ">(std::__1::wstring) x = {</div><div style="margin: 0px; padding: 0px; ">  __r_ = {</div><div style="margin: 0px; padding: 0px; ">    std::__1::__libcpp_compressed_pair_imp<std::__1::basic_string<wchar_t, std::__1::char_traits<wchar_t>, std::__1::allocator<wchar_t> >::__rep, std::__1::allocator<wchar_t> > = {</div><div style="margin: 0px; padding: 0px; ">      __first_ = {</div><div style="margin: 0px; padding: 0px; ">         = {</div><div style="margin: 0px; padding: 0px; ">          __l = {</div><div style="margin: 0px; padding: 0px; ">            __cap_ = 17</div><div style="margin: 0px; padding: 0px; ">            __size_ = 12</div><div style="margin: 0px; padding: 0px; ">            __data_ = 0x00000001001009c0</div><div style="margin: 0px; padding: 0px; ">          }</div><div style="margin: 0px; padding: 0px; ">          __s = {</div><div style="margin: 0px; padding: 0px; ">             = {</div><div style="margin: 0px; padding: 0px; ">              __size_ = '\x11'</div><div style="margin: 0px; padding: 0px; ">              _ = \x11\0\0\0</div><div style="margin: 0px; padding: 0px; ">            }</div><div style="margin: 0px; padding: 0px; ">            __data_ = {</div><div style="margin: 0px; padding: 0px; ">              [0] = \0\0\0\0</div><div style="margin: 0px; padding: 0px; ">              [1] = \f\0\0\0</div><div style="margin: 0px; padding: 0px; ">              [2] = \0\0\0\0</div><div style="margin: 0px; padding: 0px; ">              [3] = \xc0\t\x10\0</div><div style="margin: 0px; padding: 0px; ">              [4] = \x01\0\0\0</div><div style="margin: 0px; padding: 0px; ">            }</div><div style="margin: 0px; padding: 0px; ">          }</div><div style="margin: 0px; padding: 0px; ">          __r = {</div><div style="margin: 0px; padding: 0px; ">            __words = {</div><div style="margin: 0px; padding: 0px; ">              [0] = 17</div><div style="margin: 0px; padding: 0px; ">              [1] = 12</div><div style="margin: 0px; padding: 0px; ">              [2] = 4296018368</div><div style="margin: 0px; padding: 0px; ">            }</div><div style="margin: 0px; padding: 0px; ">          }</div><div style="margin: 0px; padding: 0px; ">        }</div><div style="margin: 0px; padding: 0px; ">      }</div><div style="margin: 0px; padding: 0px; ">    }</div><div style="margin: 0px; padding: 0px; ">  }</div><div style="margin: 0px; padding: 0px; ">}</div><div style="margin: 0px; padding: 0px; "><b>(lldb) </b></div></div><div><br></div><div>Thanks,</div><div>PA</div><div><br><div><hr id="ecxstopSpelling">Date: Mon, 6 Aug 2012 11:24:48 +0200<br>From:<span class="Apple-converted-space"> </span><a class="ecxmoz-txt-link-abbreviated" href="mailto:nino.kettlitz@googlemail.com">nino.kettlitz@googlemail.com</a><br>To:<span class="Apple-converted-space"> </span><a class="ecxmoz-txt-link-abbreviated" href="mailto:angriawan@hotmail.com">angriawan@hotmail.com</a><br>Subject: Re: [lldb-dev] Formatter for std::shared_ptr<std::wstring><br><br><div class="ecxmoz-cite-prefix">Hmm, thats strange.<br><br>I'm currently using not the latest lldb, so maybe something changed.<br><br>What platform are you developing on? The script is written for osx.<br><br>Maybe you can just send me the output of "frame variable x" without having the script installed. Maybe the structure of your strings differ.<br><br><br>N.<span class="Apple-converted-space"> </span><br><br>Am 06.08.12 10:54, schrieb Alexander Angriawan:<br></div><blockquote cite="mid:BAY002-W941E7A98D9C35E7266970BA5CF0@phx.gbl"><div dir="ltr"><font size="3" face="Calibri">Thank you Nino.</font><div><font face="Calibri"><br></font><div style="font-family: Calibri; font-size: 12pt; "><span style="font-size: 12pt; ">Unfortunately the script doesn't work in my environment.</span></div><div style="font-family: Calibri; font-size: 12pt; "><span style="font-size: 12pt; ">GetByteSize() always return 0 in my case.</span></div><div style="font-family: Calibri; font-size: 12pt; "><span style="font-size: 12pt; "><br></span></div><div style="font-family: Calibri; font-size: 12pt; "><span style="font-size: 12pt; ">....</span></div><div><div><font face="Calibri"> </font><span style="font-family: Calibri; ">           if _M_p_data.GetByteSize() == 1:</span></div><div><font face="Calibri">                _M_p_deref = _M_p_data.GetUnsignedInt8(e, 0)    # utf-8</font></div><div><font face="Calibri">            elif _M_p_data.GetByteSize() == 2:</font></div><div><font face="Calibri">                _M_p_deref = _M_p_data.GetUnsignedInt16(e, 0)   # utf-16</font></div><div><font face="Calibri">            elif _M_p_data.GetByteSize() == 4:</font></div><div><font face="Calibri">                _M_p_deref = _M_p_data.GetSignedInt32(e, 0)     # utf-32</font></div><div><font face="Calibri">            else:</font></div><div><font face="Calibri"> </font><span style="font-family: Calibri; ">               _M_p_deref = -1</span></div><div><font face="Calibri">            </font></div><div><font face="Calibri">            if _M_p_deref <= 0:</font></div><div><font face="Calibri">           <span class="Apple-converted-space"> </span><span class="ecxApple-tab-span" style="white-space: pre; "> </span>break</font></div></div><div style="font-family: Calibri; font-size: 12pt; ">----</div><div style="font-family: Calibri; font-size: 12pt; "><br></div><div style="font-family: Calibri; font-size: 12pt; ">My simple test code:</div><div style="font-family: Calibri; font-size: 12pt; "><br></div><div style="font-family: Calibri; font-size: 12pt; "><div style="margin: 0px; padding: 0px; "><span class="ecxs1">int</span><span class="Apple-converted-space"> </span>main(<span class="ecxs1">int</span><span class="Apple-converted-space"> </span>argc,<span class="Apple-converted-space"> </span><span class="ecxs1">const</span><span class="Apple-converted-space"> </span><span class="ecxs1">char</span><span class="Apple-converted-space"> </span>* argv[])</div><div style="margin: 0px; padding: 0px; ">{</div><div style="margin: 0px; padding: 0px; "><span class="ecxs2"> </span><span class="ecxs2" style="font-size: 12pt; ">   </span><span class="ecxs3" style="font-size: 12pt; ">std</span><span class="ecxs2" style="font-size: 12pt; ">::</span><span class="ecxs3" style="font-size: 12pt; ">wstring</span><span class="ecxs2" style="font-size: 12pt; "><span class="Apple-converted-space"> </span>x = L</span><span style="font-size: 12pt; ">"fooo"</span><span class="ecxs2" style="font-size: 12pt; ">;</span></div><div style="margin: 0px; padding: 0px; "><span class="ecxs2"></span>    return<span class="ecxs2"> </span><span class="ecxs4">0</span><span class="ecxs2">;</span></div><div style="margin: 0px; padding: 0px; ">}</div></div><div style="font-family: Calibri; font-size: 12pt; "><br></div><div style="font-family: Calibri; font-size: 12pt; ">---</div><div style="font-family: Calibri; font-size: 12pt; ">JA</div><div style="font-family: Calibri; font-size: 12pt; "><br></div><div style="font-family: Calibri; font-size: 12pt; "><br></div><div style="font-family: Calibri; font-size: 12pt; "><br></div><div style="font-family: Calibri; font-size: 12pt; "><br></div><div style="font-family: Calibri; font-size: 12pt; "><br><div><hr id="ecxstopSpelling">Date: Mon, 6 Aug 2012 09:54:09 +0200<br>From:<span class="Apple-converted-space"> </span><a class="ecxmoz-txt-link-abbreviated" href="mailto:nino.kettlitz@googlemail.com">nino.kettlitz@googlemail.com</a><br>To:<span class="Apple-converted-space"> </span><a class="ecxmoz-txt-link-abbreviated" href="mailto:angriawan@hotmail.com">angriawan@hotmail.com</a><br>CC:<span class="Apple-converted-space"> </span><a class="ecxmoz-txt-link-abbreviated" href="mailto:lldb-dev@cs.uiuc.edu">lldb-dev@cs.uiuc.edu</a><br>Subject: Re: [lldb-dev] Formatter for std::shared_ptr<std::wstring><br><br><div class="ecxmoz-cite-prefix">Oh,<br><br>I've seen, that the script attached to the mail is not on the server, so I attached it again, although it would be better to have it in the lldb svn.<br><br>Yust copy the script to your hom directory and ad the folowing line to your .lldbinit<br><br>script sys.path[:0] = [os.path.expanduser('~')]<br>command alias pwd script print os.getcwd()<br>script import wstring<br>type summary add --python-function wstring.wstring_summary "std::wstring"<br>type summary add --python-function wstring.wstring_summary "std::basic_string<int, class std::char_traits<int>, class std::allocator<int> >"<br>type summary add --python-function wstring.wstring_summary "std::basic_string<unsigned short, class std::char_traits<unsigned short>, class std::allocator<unsigned short> >"<br>type summary add --python-function wstring.wstring_summary "std::basic_string<wchar_t, class std::char_traits<wchar_t>, class std::allocator<wchar_t> >"<br><br><br>Cheers, Nino<br><br>Am 06.08.12 09:19, schrieb Alexander Angriawan:<br></div><blockquote cite="mid:BAY002-W210E45CFDD8359D8DB9B50CA5CF0@phx.gbl"><div dir="ltr"><div><font face="Calibri">Hello,</font></div><div><font face="Calibri"><br></font></div><div><font face="Calibri">I am looking to write data formatter for std::shared_ptr<std::wstring>.</font></div><div><font face="Calibri"><br></font></div><div><font face="Calibri">I found the following old article but this doesn't seem to work.</font></div><div><font face="Calibri">I have ver 159 installed.</font></div><font face="Calibri"><a class="ecxmoz-txt-link-freetext" href="http://lists.cs.uiuc.edu/pipermail/lldb-dev/2012-February/000825.html" target="_blank">http://lists.cs.uiuc.edu/pipermail/lldb-dev/2012-February/000825.html</a></font><div><font face="Calibri"><br></font></div><div><font face="Calibri">Any idea?</font></div><div><br></div><div><font face="Calibri">Thank you much,</font></div><div><font face="Calibri">PA</font></div></div><br><fieldset class="ecxmimeAttachmentHeader"></fieldset><br><pre>_______________________________________________
lldb-dev mailing list
<a class="ecxmoz-txt-link-abbreviated" href="mailto:lldb-dev@cs.uiuc.edu">lldb-dev@cs.uiuc.edu</a>
<a class="ecxmoz-txt-link-freetext" href="http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev</a>
</pre></blockquote><br></div></div></div></div></blockquote><br></div></div></div></blockquote><br></div>_______________________________________________<br>lldb-dev mailing list<br><a href="mailto:lldb-dev@cs.uiuc.edu">lldb-dev@cs.uiuc.edu</a><br><a href="http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev</a><br></blockquote></div><br></div></div></div></div></div></div></blockquote></div><br></div></div></div></div><span><formatter.bin></span></div></blockquote></div><br></div></body></html>