<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><blockquote type="cite"><div><br>Hi Enrico,<br><br>thank you for your help.<br><br></div></blockquote><div><br></div><div>You're welcome :)</div><div><br></div><blockquote type="cite"><div><blockquote type="cite">Since you're only really producing one child value, it looks like you may want to provide a summary for the wstring instead of synthetic children.<br></blockquote>Cool, thats exactly what I'm searching for, but I found only the synthetic children examples in the docu.<br><blockquote type="cite"><br></blockquote></div></blockquote><div><br></div><div>I think summaries are described here: <a href="http://lldb.llvm.org/varformats.html">http://lldb.llvm.org/varformats.html</a> (there is an example about computing the area of a rectangle via Python and use that as a summary)</div><br><blockquote type="cite"><div><blockquote type="cite">You are trying to bind a synthetic children provider to *every* std::basic_string<T>? Why?<br></blockquote>I am dealing with utf-8 utf-16 and utf-32 strings in my application and it would be great to be able to view all strings. Currently only the int version is implemented :-(<br></div></blockquote><div><br></div><div>Are you going to have a way to distinguish the several encodings once you bind every std::basic_string<T> to your summary function? If so, great :)</div><div>A nice thing to be told about regexp, is that an exact match always wins over them, so you can make this binding and still get std::string (which is std::basic_string<char>) for free with the default summary provider</div><br><blockquote type="cite"><div><blockquote type="cite">Again, I think a summary for std::wstring (and std::basic_string<wchar_t>) would be enough for the purpose.<br></blockquote>Yes<blockquote type="cite">What version of LLDB are you using? (LLDB has a "version" command you can use) This looks like an issue with the built-in synthetic children provider for class std::vector.<br></blockquote>LLDB-112<br></div></blockquote><div><br></div><div>You may want to try on TOT</div><br><blockquote type="cite"><div><blockquote type="cite">In order to test *your* wstring provider, you should have a single variable of type std::wstring and try to "frame variable" that one variable. Here, your entry point is the synthetic children provider for std::vector.<br></blockquote>Thats what I've allready done with:<br><br>(lldb) type synthetic add "std::wstring" --python-class wstring.StdWStringSynthProvider<br>(lldb) frame variable aWideString<br>(std::wstring) aWideString = {<br> HELLO WORLD!!! = 0x0000004500000048<br>}<br><br>But when I have a vector of std::wstring the type of each element is std::basic_string<int, ...> and the synth. children provider gets not invoked (thats why I tried to use "^(std::)?basic_string<.+>", without success)<br><br>(lldb) frame variable aWideStringVector<br>(vector<std::basic_string<wchar_t>, std::allocator<std::basic_string<wchar_t> > >) aWideStringVector = {<br> [0] = {<br> _M_dataplus = {<br> _M_p = 0x0000000107300aa8<br> }<br> }<br> [1] = {<br> _M_dataplus = {<br> _M_p = 0x0000000107300bc8<br> }<br> }<br></div></blockquote><div><br></div><div>This is promising, it looks like LLDB is displaying your vector items</div><br><blockquote type="cite"><div><blockquote type="cite">again, what you're doing here is asking the std::vector synthetic children provider (built into LLDB) to provide you with child at index 0 - your wstring provider is not being invoked at this moment.</blockquote></div></blockquote><blockquote type="cite"><div>The std::vector synthetic children provider returns the child at index 0. When lldb prints this child, the summary provider for wstring gets invoked, right?<br></div></blockquote><div><br></div><div>Yes, right</div><blockquote type="cite"><div><blockquote type="cite">1) Probably not - if you're using a recent version of LLDB then this issue might need further testing. Otherwise, it seems a good idea to retry this with TOT<br></blockquote><blockquote type="cite">2) Again, I would just use a summary string provider. On LLDB TOT, the attached Python file (which is a very slightly modified version of what you sent) works well in providing a summary for std::wstring<br></blockquote>Okay, the summary solution is obviously the better one. What is TOT? The latest lldb trunk version?<br></div></blockquote><div><br></div><div>Yes, TOT is the latest trunk of LLDB that you download from svn and build yourself</div><br><blockquote type="cite"><div><blockquote type="cite">(lldb) command script import wstring.py<br></blockquote><blockquote type="cite">(lldb) type summary add --python-function wstring.wstring_summary std::wstring<br></blockquote><blockquote type="cite">(lldb) frame variable<br></blockquote><blockquote type="cite">(std::wstring) foo = hello world<br></blockquote>Unfortunately, this does not work for me. LLDB seems not to invoke the summary provider:<br><br>(lldb) command script import /Users/nino.kettlitz/wstring.py<br>(lldb) type summary clear<br>(lldb) type summary add --python-function wstring.wstring_summary "std::wstring"<br>(lldb) frame variable aWideString<br>(std::wstring) aWideString = {<br> _M_dataplus = {<br> _M_p = 0x0000000107300b68<br> }<br>}<br><br><br></div></blockquote><div><br></div><div>Weird. But again, please use TOT before we explore other potential issues.</div><div><br></div></div></body></html>