Title: [87438] trunk/Source/_javascript_Core
Revision
87438
Author
[email protected]
Date
2011-05-26 15:09:55 -0700 (Thu, 26 May 2011)

Log Message

2011-05-26  Ryosuke Niwa  <[email protected]>

        Reviewed by Eric Seidel.

        [debug feature] WTFString should have show() method
        https://bugs.webkit.org/show_bug.cgi?id=61149

        Added String::show and AtomicString::show in NDEBUG.

        * wtf/text/AtomicString.cpp:
        (WTF::AtomicString::show):
        * wtf/text/AtomicString.h:
        * wtf/text/WTFString.cpp:
        (String::show):
        * wtf/text/WTFString.h:

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (87437 => 87438)


--- trunk/Source/_javascript_Core/ChangeLog	2011-05-26 22:06:54 UTC (rev 87437)
+++ trunk/Source/_javascript_Core/ChangeLog	2011-05-26 22:09:55 UTC (rev 87438)
@@ -1,3 +1,19 @@
+2011-05-26  Ryosuke Niwa  <[email protected]>
+
+        Reviewed by Eric Seidel.
+
+        [debug feature] WTFString should have show() method
+        https://bugs.webkit.org/show_bug.cgi?id=61149
+
+        Added String::show and AtomicString::show in NDEBUG.
+
+        * wtf/text/AtomicString.cpp:
+        (WTF::AtomicString::show):
+        * wtf/text/AtomicString.h:
+        * wtf/text/WTFString.cpp:
+        (String::show):
+        * wtf/text/WTFString.h:
+
 2011-05-26  Geoffrey Garen  <[email protected]>
 
         Reviewed by Geoffrey Garen.

Modified: trunk/Source/_javascript_Core/wtf/text/AtomicString.cpp (87437 => 87438)


--- trunk/Source/_javascript_Core/wtf/text/AtomicString.cpp	2011-05-26 22:06:54 UTC (rev 87437)
+++ trunk/Source/_javascript_Core/wtf/text/AtomicString.cpp	2011-05-26 22:09:55 UTC (rev 87438)
@@ -365,4 +365,11 @@
     return atomicString;
 }
 
+#ifndef NDEBUG
+void AtomicString::show()
+{
+    m_string.show();
+}
+#endif
+
 } // namespace WTF

Modified: trunk/Source/_javascript_Core/wtf/text/AtomicString.h (87437 => 87438)


--- trunk/Source/_javascript_Core/wtf/text/AtomicString.h	2011-05-26 22:06:54 UTC (rev 87437)
+++ trunk/Source/_javascript_Core/wtf/text/AtomicString.h	2011-05-26 22:09:55 UTC (rev 87438)
@@ -113,6 +113,9 @@
     static AtomicString fromUTF8(const char*, size_t);
     static AtomicString fromUTF8(const char*);
 
+#ifndef NDEBUG
+    void show();
+#endif
 private:
     String m_string;
     

Modified: trunk/Source/_javascript_Core/wtf/text/WTFString.cpp (87437 => 87438)


--- trunk/Source/_javascript_Core/wtf/text/WTFString.cpp	2011-05-26 22:06:54 UTC (rev 87437)
+++ trunk/Source/_javascript_Core/wtf/text/WTFString.cpp	2011-05-26 22:09:55 UTC (rev 87438)
@@ -964,6 +964,11 @@
 Vector<char> asciiDebug(StringImpl* impl);
 Vector<char> asciiDebug(String& string);
 
+void String::show()
+{
+    fprintf(stderr, "%s\n", asciiDebug(impl()).data());
+}
+
 String* string(const char* s)
 {
     // leaks memory!

Modified: trunk/Source/_javascript_Core/wtf/text/WTFString.h (87437 => 87438)


--- trunk/Source/_javascript_Core/wtf/text/WTFString.h	2011-05-26 22:06:54 UTC (rev 87437)
+++ trunk/Source/_javascript_Core/wtf/text/WTFString.h	2011-05-26 22:09:55 UTC (rev 87438)
@@ -347,6 +347,10 @@
     String(WTF::HashTableDeletedValueType) : m_impl(WTF::HashTableDeletedValue) { }
     WTF_EXPORT_PRIVATE bool isHashTableDeletedValue() const { return m_impl.isHashTableDeletedValue(); }
 
+#ifndef NDEBUG
+    void show();
+#endif
+
 private:
     RefPtr<StringImpl> m_impl;
 };
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to