<div dir="ltr">Hi,<br><br>I came across the formatter example in unicode_strings.py where in utf16_summary() I see this code:<br><br><font face="monospace, monospace">string_data = value.process.ReadMemory(pointer, length, error)<br># utf8 is safe to emit as-is on OSX<br>return '"%s"' % (string_data.decode('utf-16').encode('utf-8'))</font><br><div><font face="monospace, monospace"><br></font></div><div><font face="arial, helvetica, sans-serif">I am trying to replicate that in my own formatter and I'm having difficulty converting the pointer to an addr_t which is what ReadMemory wants. In my case </font><font face="monospace, monospace">pointer</font><font face="arial, helvetica, sans-serif"> comes from:</font></div><font face="arial, helvetica, sans-serif"><br></font><font face="monospace, monospace">self.rep.GetChildMemberWithName("__l").GetChildMemberWithName("__data_")<br><br></font><div>(this is a basic_string which has a union:</div><font face="monospace, monospace">struct __rep<br>{<br>   union {<br>   __long  __l; // Used for long strings<br>   __short __s; // Used for short strings  - stores in place<br>   __raw   __r; // ??<br>   };<br>};</font><br><br>and __long is defined as:<br><br><font face="monospace, monospace">struct __long {<br>   pointer __data_;<br>   size_type __size_;<br>   size_type __cap_;<br>};</font><div><br></div><div>So __data_ is a basic_string::pointer (plain C pointer).</div><div><br></div><div>How do I convert this pointer to the addr_t that I need? I believe that the <span style="font-family:monospace,monospace">GetChildMemberWithName </span>returns an SBValue. I tried <font face="monospace, monospace">pointer.GetPointeeData(0, 1).GetLoadAddress()</font> but I'm not getting the corect results.<br><br>Thanks!<br><br>Florin</div></div>