gdb that comes with XCode 3 doesn't support printing WTFString. We should add a show() method to WTFString to ease the pain.
Yes please. I'm getting tired of gdb crashing when trying to print WTF Strings using p string.utf8().data();
(In reply to comment #1) > Yes please. I'm getting tired of gdb crashing when trying to print WTF Strings using p string.utf8().data(); Yeah, that gdb bug is driving me nuts. I don't remember how many times I had to spend minutes getting into the right breakpoint and the first "p ~~" crashed :(
Created attachment 94134 [details] adds String::show
I wonder if we should also add it to AtomicString and QualifiedName.
Created attachment 94138 [details] adds String::show and AtomicString::show
Adding it to QualifiedName is a bit tricky because we'd have to export String::show from JSC to WebCore so I'll put that aside for now.
(In reply to comment #6) > Adding it to QualifiedName is a bit tricky because we'd have to export String::show from JSC to WebCore so I'll put that aside for now. The following in your .gdbinit will allow you to type string_print followed by a WTF::String to print it out: define wchar_print echo " set $i = 0 while (1 == 1) set $c = (char)(($arg0)[$i++]) if ($c == '\0') loop_break end printf "%c", $c end echo "\n end define string_print wchar_print ($arg0) end Just sayin' ;)
Any reviewer?
Comment on attachment 94138 [details] adds String::show and AtomicString::show OK.
Since Darin authored many of our string classes, I figure he might like to see this go by, but it looks like you already CC'd him. Thanks.
Thanks for the review!
We can always remove this if it turns out be redundant or useless.
Committed r87438: <http://trac.webkit.org/changeset/87438>