<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><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>
<p class="p1"><span class="s1"><b>(lldb) </b></span><b>frame variable x</b></p>
<p class="p1">(std::__1::wstring) x = {</p>
<p class="p1"> __r_ = {</p>
<p class="p1"> 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> > = {</p>
<p class="p1"> __first_ = {</p>
<p class="p1"> = {</p>
<p class="p1"> __l = {</p>
<p class="p1"> __cap_ = 17</p>
<p class="p1"> __size_ = 12</p>
<p class="p1"> __data_ = 0x00000001001009c0</p>
<p class="p1"> }</p>
<p class="p1"> __s = {</p>
<p class="p1"> = {</p>
<p class="p1"> __size_ = '\x11'</p>
<p class="p1"> _ = \x11\0\0\0</p>
<p class="p1"> }</p>
<p class="p1"> __data_ = {</p>
<p class="p1"> [0] = \0\0\0\0</p>
<p class="p1"> [1] = \f\0\0\0</p>
<p class="p1"> [2] = \0\0\0\0</p>
<p class="p1"> [3] = \xc0\t\x10\0</p>
<p class="p1"> [4] = \x01\0\0\0</p>
<p class="p1"> }</p>
<p class="p1"> }</p>
<p class="p1"> __r = {</p>
<p class="p1"> __words = {</p>
<p class="p1"> [0] = 17</p>
<p class="p1"> [1] = 12</p>
<p class="p1"> [2] = 4296018368</p>
<p class="p1"> }</p>
<p class="p1"> }</p>
<p class="p1"> }</p>
<p class="p1"> }</p>
<p class="p1"> }</p>
<p class="p1"> }</p>
<p class="p1">}</p>
<p class="p2"><b>(lldb) </b></p></div><div><br></div><div>Thanks,</div><div>PA</div><div><br><div><div id="SkyDrivePlaceholder"></div><hr id="stopSpelling">Date: Mon, 6 Aug 2012 11:24:48 +0200<br>From: nino.kettlitz@googlemail.com<br>To: angriawan@hotmail.com<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. <br>
<br>
Am 06.08.12 10:54, schrieb Alexander Angriawan:<br>
</div>
<blockquote cite="mid:BAY002-W941E7A98D9C35E7266970BA5CF0@phx.gbl">
<style><!--
.ExternalClass .ecxhmmessage P
{padding:0px;}
.ExternalClass body.ecxhmmessage
{font-size:12pt;font-family:Calibri;}
--></style>
<div dir="ltr"><font face="Calibri" size="3">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="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">
<p class="ecxp1"><span class="ecxs1">int</span> main(<span class="ecxs1">int</span> argc, <span class="ecxs1">const</span>
<span class="ecxs1">char</span> * argv[])</p>
<p class="ecxp1">{</p>
<p class="ecxp2"><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"> x = L</span><span style="font-size:12pt">"fooo"</span><span class="ecxs2" style="font-size:12pt">;</span></p>
<p class="ecxp4"><span class="ecxs2"></span> return<span class="ecxs2"> </span><span class="ecxs4">0</span><span class="ecxs2">;</span></p>
<p class="ecxp1">}</p>
</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: <a class="ecxmoz-txt-link-abbreviated" href="mailto:nino.kettlitz@googlemail.com">nino.kettlitz@googlemail.com</a><br>
To: <a class="ecxmoz-txt-link-abbreviated" href="mailto:angriawan@hotmail.com">angriawan@hotmail.com</a><br>
CC: <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">
<style><!--
.ExternalClass .ecxhmmessage P
{padding:0px;}
.ExternalClass body.ecxhmmessage
{font-size:12pt;font-family:Calibri;}
--></style>
<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></body>
</html>