<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div>On Aug 28, 2013, at 2:05 PM, Jakob Leben <<a href="mailto:jakob.leben@gmail.com">jakob.leben@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">On Wed, Aug 28, 2013 at 11:25 AM, Enrico Granata <<a href="mailto:egranata@apple.com">egranata@apple.com</a>> wrote:<br><blockquote type="cite">That makes sense. An std::string only has one child, which is a struct that<br>then contains the pointer<br>std::string has no synthetic children, also.<br>It only has a summary.<br></blockquote><br>Well, we have established that "elements" of a std::list are only<br>called so in a "synthetic" sense. I think characters are elements of a<br>std::string in exactly the same sense, so I think the same API should<br>support accessing both.<br><br>Moreover, the "summary" has the notion of pretty-printing, and does<br>not seem logically suitable for actual-data access.<br><br>What do you think of this?<br></blockquote><div><br></div><div>If you feel the need for a synthetic children provider for std::string that vends the actual characters as items, then by all means feel free to make one.</div><div><br></div><div>I think such a visualization would be highly inconvenient for most users most of the time, much as you do not want to see a char* so much as an array of chars but rather as a logical “string”, the same is true of std::string</div><div><div>Also, if you know the layout of the string class, you can directly access the data buffer and read the individual bytes out of memory, which is also a discouraging argument from going down the synthetic children route: the added value compared to the actual type layout is quite low.</div></div><div>This is why LLDB vends a summary instead of synthetic children.</div><div><br></div><div>Nothing says that you cannot vend both of course (a vector vends a summary, the count, and then the individual items as children), so you could keep the builtin summary and then plug your own synthetic children provider for the purpose of fetching the individual bytes if you need this level of access.</div><div>If you need support to figure out the moving parts in this process, feel free to ping back :)</div><div><br></div><div>
<div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div style=" orphans: 2; widows: 2; border-collapse: separate; border-spacing: 0px;"><span style="font-size: 12px; orphans: auto; widows: auto;">Enrico Granata</span><br style="font-size: 12px; orphans: auto; widows: auto;"><span style="font-size: 12px; orphans: auto; widows: auto;">📩 egranata@</span><font color="#ff2600" style="font-size: 12px; orphans: auto; widows: auto;"></font><span style="font-size: 12px; orphans: auto; widows: auto;">.com</span><br style="font-size: 12px; orphans: auto; widows: auto;"><span style="font-size: 12px; orphans: auto; widows: auto;">☎️ 27683</span></div></div></div>
</div>
<br><div><div><br></div></div></body></html>