<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Aug 6, 2015 at 2:43 PM, Enrico Granata <span dir="ltr"><<a href="mailto:egranata@apple.com" target="_blank">egranata@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div>To be honest, my favorite approach would be to modify clang’s TypePrinter to do this, and then hooking up GetDisplayTypeName() to use whatever flags would be necessary to invoke that bit of magic</div></div></blockquote><div><br></div><div>Do you mean that clang's "pretty printer" should be made extensible by a script?</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div><div class="h5"><div><br></div><div><blockquote type="cite"><div>On Aug 6, 2015, at 2:33 PM, Siva Chandra <<a href="mailto:sivachandra@google.com" target="_blank">sivachandra@google.com</a>> wrote:</div><br><div><div>FWIW, GDB has a similar concept called type-printers:<br><a href="https://sourceware.org/gdb/current/onlinedocs/gdb/Type-Printing-API.html" target="_blank">https://sourceware.org/gdb/current/onlinedocs/gdb/Type-Printing-API.html</a><br><br>On Thu, Aug 6, 2015 at 2:24 PM, Siva Chandra <<a href="mailto:sivachandra@google.com" target="_blank">sivachandra@google.com</a>> wrote:<br><blockquote type="cite">Hi Enrico,<br><br>I was thinking about the same issue today. Could we add a concept<br>called "TypeNameModifier" and provide ability to define modifiers in<br>scripts and command line? With this, a name like<br>std::__1::basic_string<...> can be modified into a more friendly name<br>like std::string? We could ofcourse have more complex modifications.<br><br>I think it is doable, but what is your (and the community's) opinion<br>about adding such a feature? If you are OK, I would like to take up<br>adding such a feature.<br><br>Thanks,<br>Siva Chandra<br><br>On Thu, Aug 6, 2015 at 2:15 PM, Enrico Granata via lldb-dev<br><<a href="mailto:lldb-dev@lists.llvm.org" target="_blank">lldb-dev@lists.llvm.org</a>> wrote:<br><blockquote type="cite">Hi Eugene,<br><br>On Aug 6, 2015, at 2:02 PM, Eugene Birukov via lldb-dev<br><<a href="mailto:lldb-dev@lists.llvm.org" target="_blank">lldb-dev@lists.llvm.org</a>> wrote:<br><br>Hi,<br><br>I am using LLDB C++ API to create custom debugger and trying to dump<br>variables with their types. To do that I am using SBValue.GetTypeName() API.<br>Some types are OK, but some others - especially ones related to STL - are<br>quite unreadable:<br><br><br>those type names are the actual fully-specialized STL type names. I am not<br>sure how to control GDB to stop truncating your string formatting, but after<br>the “…” there actually is more text<br>It looks like what you have is std::unique_ptr<std::vector<std::string> > ><br>and those templates all take more arguments which are defaulted so you don’t<br>have to type them in code - but are reflected in the type name<br><br>(gdb) p value.GetTypeName()<br>$1 = 0x7fffe419be40<br>"std::__1::unique_ptr<std::__1::vector<std::__1::basic_string<char,<br>std::__1::char_traits<char>, std::__1::allocator<char> >,<br>std::__1::allocator<std::__1::basic_string<char,<br>std::__1::char_traits<char"...<br>(gdb) p value.GetDisplayTypeName()<br>$2 = 0x7fffe419be40<br>"std::__1::unique_ptr<std::__1::vector<std::__1::basic_string<char,<br>std::__1::char_traits<char>, std::__1::allocator<char> >,<br>std::__1::allocator<std::__1::basic_string<char,<br>std::__1::char_traits<char"...<br>(gdb)<br><br><br>So, is there any way to convert them into some more human-friendly form?<br><br><br>Not currently. What one would have to do is hook into the C++ type printing<br>logic such that it would know to leave out these extra template arguments<br>when they have a default value<br><br><br>Thanks,<br>Eugene<br>_______________________________________________<br>lldb-dev mailing list<br><a href="mailto:lldb-dev@lists.llvm.org" target="_blank">lldb-dev@lists.llvm.org</a><br><a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev</a><br><br><br><br>Thanks,<br>- Enrico<br>📩 egranata@.com ️ 27683<br><br><br>_______________________________________________<br>lldb-dev mailing list<br><a href="mailto:lldb-dev@lists.llvm.org" target="_blank">lldb-dev@lists.llvm.org</a><br><a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev</a><br><br></blockquote></blockquote></div></div></blockquote></div><br><div>
<div style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><br>Thanks,</div><div style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><i>- Enrico</i><br>📩 egranata@<font color="#ff2600"></font>.com ☎️ 27683</div>
</div>
<br></div></div></div></blockquote></div><br></div></div>