[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677

kocienda kocienda at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 08:49:14 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit d5d04754e1d7b83eadec4b6182f79a60cb7242fd
Author: kocienda <kocienda at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Jul 8 21:08:03 2004 +0000

            Reviewed by Vicki
    
            Added some helper functions which provide strings to display in the
            Xcode debugger's variable inspector window. These functions are called
            from the LabyrinthDataFormatter debugger plugin I just checked in to
            the Labyrinth/Tools directory.
    
            Note that these functions are compiled in on Development builds only.
    
            * WebCore-combined.exp:
            * WebCore-tests.exp: Export all the formatForDebugger symbols so the
            debugger program can link with them.
            * khtml/xml/dom2_rangeimpl.cpp:
            (DOM::RangeImpl::formatForDebugger):
            * khtml/xml/dom2_rangeimpl.h:
            * khtml/xml/dom_elementimpl.cpp:
            (ElementImpl::formatForDebugger):
            * khtml/xml/dom_elementimpl.h:
            * khtml/xml/dom_nodeimpl.cpp:
            * khtml/xml/dom_nodeimpl.h:
            * khtml/xml/dom_position.cpp:
            (DOM::Position::formatForDebugger):
            * khtml/xml/dom_position.h:
            * khtml/xml/dom_selection.cpp:
            (DOM::Selection::formatForDebugger):
            * khtml/xml/dom_selection.h:
            * khtml/xml/dom_textimpl.cpp:
            (TextImpl::formatForDebugger):
            * khtml/xml/dom_textimpl.h:
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@6980 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 9e9fd9c..36f64e3 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,35 @@
+2004-07-08  Ken Kocienda  <kocienda at apple.com>
+
+        Reviewed by Vicki
+
+        Added some helper functions which provide strings to display in the 
+        Xcode debugger's variable inspector window. These functions are called
+        from the LabyrinthDataFormatter debugger plugin I just checked in to 
+        the Labyrinth/Tools directory.
+        
+        Note that these functions are compiled in on Development builds only.
+
+        * WebCore-combined.exp:
+        * WebCore-tests.exp: Export all the formatForDebugger symbols so the
+        debugger program can link with them.
+        * khtml/xml/dom2_rangeimpl.cpp:
+        (DOM::RangeImpl::formatForDebugger):
+        * khtml/xml/dom2_rangeimpl.h:
+        * khtml/xml/dom_elementimpl.cpp:
+        (ElementImpl::formatForDebugger):
+        * khtml/xml/dom_elementimpl.h:
+        * khtml/xml/dom_nodeimpl.cpp:
+        * khtml/xml/dom_nodeimpl.h:
+        * khtml/xml/dom_position.cpp:
+        (DOM::Position::formatForDebugger):
+        * khtml/xml/dom_position.h:
+        * khtml/xml/dom_selection.cpp:
+        (DOM::Selection::formatForDebugger):
+        * khtml/xml/dom_selection.h:
+        * khtml/xml/dom_textimpl.cpp:
+        (TextImpl::formatForDebugger):
+        * khtml/xml/dom_textimpl.h:
+
 2004-07-08  John Sullivan  <sullivan at apple.com>
 
         Reviewed by Vicki.
diff --git a/WebCore/WebCore-combined.exp b/WebCore/WebCore-combined.exp
index 2d35384..9d7891b 100644
--- a/WebCore/WebCore-combined.exp
+++ b/WebCore/WebCore-combined.exp
@@ -408,3 +408,9 @@ __ZplPKcRK7QString
 __ZplRK5QSizeS1_
 __ZplRK6QPointS1_
 __ZplcRK7QString
+__ZNK3DOM11ElementImpl17formatForDebuggerEPcj
+__ZNK3DOM8NodeImpl17formatForDebuggerEPcj
+__ZNK3DOM8Position17formatForDebuggerEPcj
+__ZNK3DOM8TextImpl17formatForDebuggerEPcj
+__ZNK3DOM9RangeImpl17formatForDebuggerEPcj
+__ZNK3DOM9Selection17formatForDebuggerEPcj
diff --git a/WebCore/WebCore-tests.exp b/WebCore/WebCore-tests.exp
index 6e8641b..fc7ce42 100644
--- a/WebCore/WebCore-tests.exp
+++ b/WebCore/WebCore-tests.exp
@@ -297,3 +297,9 @@ __ZplPKcRK7QString
 __ZplRK5QSizeS1_
 __ZplRK6QPointS1_
 __ZplcRK7QString
+__ZNK3DOM11ElementImpl17formatForDebuggerEPcj
+__ZNK3DOM8NodeImpl17formatForDebuggerEPcj
+__ZNK3DOM8Position17formatForDebuggerEPcj
+__ZNK3DOM8TextImpl17formatForDebuggerEPcj
+__ZNK3DOM9RangeImpl17formatForDebuggerEPcj
+__ZNK3DOM9Selection17formatForDebuggerEPcj
diff --git a/WebCore/khtml/editing/SelectionController.cpp b/WebCore/khtml/editing/SelectionController.cpp
index d760d8f..9f68914 100644
--- a/WebCore/khtml/editing/SelectionController.cpp
+++ b/WebCore/khtml/editing/SelectionController.cpp
@@ -961,4 +961,29 @@ void Selection::debugPosition() const
     fprintf(stderr, "================================\n");
 }
 
+#ifndef NDEBUG
+#define FormatBufferSize 1024
+void Selection::formatForDebugger(char *buffer, unsigned length) const
+{
+    DOMString result;
+    DOMString s;
+    
+    if (isEmpty()) {
+        result = "<empty>";
+    }
+    else {
+        char s[FormatBufferSize];
+        result += "from ";
+        m_start.formatForDebugger(s, FormatBufferSize);
+        result += s;
+        result += " to ";
+        m_end.formatForDebugger(s, FormatBufferSize);
+        result += s;
+    }
+          
+    strncpy(buffer, result.string().latin1(), length - 1);
+}
+#undef FormatBufferSize
+#endif
+
 } // namespace DOM
diff --git a/WebCore/khtml/editing/SelectionController.h b/WebCore/khtml/editing/SelectionController.h
index e997df4..39e3933 100644
--- a/WebCore/khtml/editing/SelectionController.h
+++ b/WebCore/khtml/editing/SelectionController.h
@@ -108,6 +108,10 @@ public:
     
     friend class KHTMLPart;
 
+#ifndef NDEBUG
+    void formatForDebugger(char *buffer, unsigned length) const;
+#endif
+
 private:
     enum EPositionType { START, END, BASE, EXTENT };
 
diff --git a/WebCore/khtml/editing/selection.cpp b/WebCore/khtml/editing/selection.cpp
index d760d8f..9f68914 100644
--- a/WebCore/khtml/editing/selection.cpp
+++ b/WebCore/khtml/editing/selection.cpp
@@ -961,4 +961,29 @@ void Selection::debugPosition() const
     fprintf(stderr, "================================\n");
 }
 
+#ifndef NDEBUG
+#define FormatBufferSize 1024
+void Selection::formatForDebugger(char *buffer, unsigned length) const
+{
+    DOMString result;
+    DOMString s;
+    
+    if (isEmpty()) {
+        result = "<empty>";
+    }
+    else {
+        char s[FormatBufferSize];
+        result += "from ";
+        m_start.formatForDebugger(s, FormatBufferSize);
+        result += s;
+        result += " to ";
+        m_end.formatForDebugger(s, FormatBufferSize);
+        result += s;
+    }
+          
+    strncpy(buffer, result.string().latin1(), length - 1);
+}
+#undef FormatBufferSize
+#endif
+
 } // namespace DOM
diff --git a/WebCore/khtml/editing/selection.h b/WebCore/khtml/editing/selection.h
index e997df4..39e3933 100644
--- a/WebCore/khtml/editing/selection.h
+++ b/WebCore/khtml/editing/selection.h
@@ -108,6 +108,10 @@ public:
     
     friend class KHTMLPart;
 
+#ifndef NDEBUG
+    void formatForDebugger(char *buffer, unsigned length) const;
+#endif
+
 private:
     enum EPositionType { START, END, BASE, EXTENT };
 
diff --git a/WebCore/khtml/xml/dom2_rangeimpl.cpp b/WebCore/khtml/xml/dom2_rangeimpl.cpp
index 4cd9b6f..d186dc7 100644
--- a/WebCore/khtml/xml/dom2_rangeimpl.cpp
+++ b/WebCore/khtml/xml/dom2_rangeimpl.cpp
@@ -1342,4 +1342,33 @@ NodeImpl *RangeImpl::pastEndNode() const
     return m_endContainer->traverseNextSibling();
 }
 
+#ifndef NDEBUG
+#define FormatBufferSize 1024
+void RangeImpl::formatForDebugger(char *buffer, unsigned length) const
+{
+    DOMString result;
+    DOMString s;
+    
+    if (!m_startContainer || !m_endContainer) {
+        result = "<empty>";
+    }
+    else {
+        char s[FormatBufferSize];
+        result += "from offset ";
+        result += QString::number(m_startOffset);
+        result += " of ";
+        m_startContainer->formatForDebugger(s, FormatBufferSize);
+        result += s;
+        result += " to offset ";
+        result += QString::number(m_endOffset);
+        result += " of ";
+        m_endContainer->formatForDebugger(s, FormatBufferSize);
+        result += s;
+    }
+          
+    strncpy(buffer, result.string().latin1(), length - 1);
+}
+#undef FormatBufferSize
+#endif
+
 }
diff --git a/WebCore/khtml/xml/dom2_rangeimpl.h b/WebCore/khtml/xml/dom2_rangeimpl.h
index cea110c..5709e0b 100644
--- a/WebCore/khtml/xml/dom2_rangeimpl.h
+++ b/WebCore/khtml/xml/dom2_rangeimpl.h
@@ -97,6 +97,10 @@ public:
     static Range createInstance (RangeImpl *impl);
 #endif
 
+#ifndef NDEBUG
+    void formatForDebugger(char *buffer, unsigned length) const;
+#endif
+
 protected:
     DocumentPtr *m_ownerDocument;
     NodeImpl *m_startContainer;
diff --git a/WebCore/khtml/xml/dom_elementimpl.cpp b/WebCore/khtml/xml/dom_elementimpl.cpp
index 090e5de..1521287 100644
--- a/WebCore/khtml/xml/dom_elementimpl.cpp
+++ b/WebCore/khtml/xml/dom_elementimpl.cpp
@@ -625,6 +625,37 @@ void ElementImpl::dump(QTextStream *stream, QString ind) const
 }
 #endif
 
+#ifndef NDEBUG
+void ElementImpl::formatForDebugger(char *buffer, unsigned length) const
+{
+    DOMString result;
+    DOMString s;
+    
+    s = nodeName();
+    if (s.length() > 0) {
+        result += s;
+    }
+          
+    s = getAttribute(ATTR_ID);
+    if (s.length() > 0) {
+        if (result.length() > 0)
+            result += "; ";
+        result += "id=";
+        result += s;
+    }
+          
+    s = getAttribute(ATTR_CLASS);
+    if (s.length() > 0) {
+        if (result.length() > 0)
+            result += "; ";
+        result += "class=";
+        result += s;
+    }
+          
+    strncpy(buffer, result.string().latin1(), length - 1);
+}
+#endif
+
 // -------------------------------------------------------------------------
 
 XMLElementImpl::XMLElementImpl(DocumentPtr *doc, DOMStringImpl *_tagName)
diff --git a/WebCore/khtml/xml/dom_elementimpl.h b/WebCore/khtml/xml/dom_elementimpl.h
index fe954d3..0d2b29e 100644
--- a/WebCore/khtml/xml/dom_elementimpl.h
+++ b/WebCore/khtml/xml/dom_elementimpl.h
@@ -226,6 +226,11 @@ public:
 #if APPLE_CHANGES
     static Element createInstance(ElementImpl *impl);
 #endif
+
+#ifndef NDEBUG
+    virtual void formatForDebugger(char *buffer, unsigned length) const;
+#endif
+
 protected:
     virtual void createAttributeMap() const;
     DOMString openTagStartToString() const;
diff --git a/WebCore/khtml/xml/dom_nodeimpl.cpp b/WebCore/khtml/xml/dom_nodeimpl.cpp
index a2a3488..cf3bf46 100644
--- a/WebCore/khtml/xml/dom_nodeimpl.cpp
+++ b/WebCore/khtml/xml/dom_nodeimpl.cpp
@@ -1388,6 +1388,22 @@ Position NodeImpl::positionForCoordinates(int x, int y)
     return Position(this, 0);
 }
 
+#ifndef NDEBUG
+void NodeImpl::formatForDebugger(char *buffer, unsigned length) const
+{
+    DOMString result;
+    DOMString s;
+    
+    s = nodeName();
+    if (s.length() == 0)
+        result += "<none>";
+    else
+        result += s;
+          
+    strncpy(buffer, result.string().latin1(), length - 1);
+}
+#endif
+
 //-------------------------------------------------------------------------
 
 NodeBaseImpl::NodeBaseImpl(DocumentPtr *doc)
diff --git a/WebCore/khtml/xml/dom_nodeimpl.h b/WebCore/khtml/xml/dom_nodeimpl.h
index 3faebc7..bb4be4b 100644
--- a/WebCore/khtml/xml/dom_nodeimpl.h
+++ b/WebCore/khtml/xml/dom_nodeimpl.h
@@ -436,6 +436,10 @@ public:
     virtual void childrenChanged();
 
     virtual DOMString toString() const = 0;
+    
+#ifndef NDEBUG
+    virtual void formatForDebugger(char *buffer, unsigned length) const;
+#endif
 
 private: // members
     DocumentPtr *document;
diff --git a/WebCore/khtml/xml/dom_position.cpp b/WebCore/khtml/xml/dom_position.cpp
index 19f412d..e958195 100644
--- a/WebCore/khtml/xml/dom_position.cpp
+++ b/WebCore/khtml/xml/dom_position.cpp
@@ -889,4 +889,28 @@ void Position::debugPosition(const char *msg) const
         fprintf(stderr, "Position [%s]: %s [%p] at %d\n", msg, getTagName(node()->id()).string().latin1(), node(), offset());
 }
 
+#ifndef NDEBUG
+#define FormatBufferSize 1024
+void Position::formatForDebugger(char *buffer, unsigned length) const
+{
+    DOMString result;
+    DOMString s;
+    
+    if (isEmpty()) {
+        result = "<empty>";
+    }
+    else {
+        char s[FormatBufferSize];
+        result += "offset ";
+        result += QString::number(m_offset);
+        result += " of ";
+        m_node->formatForDebugger(s, FormatBufferSize);
+        result += s;
+    }
+          
+    strncpy(buffer, result.string().latin1(), length - 1);
+}
+#undef FormatBufferSize
+#endif
+
 } // namespace DOM
\ No newline at end of file
diff --git a/WebCore/khtml/xml/dom_position.h b/WebCore/khtml/xml/dom_position.h
index 58c87bc..f22ac39 100644
--- a/WebCore/khtml/xml/dom_position.h
+++ b/WebCore/khtml/xml/dom_position.h
@@ -82,6 +82,10 @@ public:
     friend bool operator!=(const Position &a, const Position &b);
     
     void debugPosition(const char *msg="") const;
+
+#ifndef NDEBUG
+    void formatForDebugger(char *buffer, unsigned length) const;
+#endif
     
 private:
     NodeImpl *m_node;
diff --git a/WebCore/khtml/xml/dom_selection.cpp b/WebCore/khtml/xml/dom_selection.cpp
index d760d8f..9f68914 100644
--- a/WebCore/khtml/xml/dom_selection.cpp
+++ b/WebCore/khtml/xml/dom_selection.cpp
@@ -961,4 +961,29 @@ void Selection::debugPosition() const
     fprintf(stderr, "================================\n");
 }
 
+#ifndef NDEBUG
+#define FormatBufferSize 1024
+void Selection::formatForDebugger(char *buffer, unsigned length) const
+{
+    DOMString result;
+    DOMString s;
+    
+    if (isEmpty()) {
+        result = "<empty>";
+    }
+    else {
+        char s[FormatBufferSize];
+        result += "from ";
+        m_start.formatForDebugger(s, FormatBufferSize);
+        result += s;
+        result += " to ";
+        m_end.formatForDebugger(s, FormatBufferSize);
+        result += s;
+    }
+          
+    strncpy(buffer, result.string().latin1(), length - 1);
+}
+#undef FormatBufferSize
+#endif
+
 } // namespace DOM
diff --git a/WebCore/khtml/xml/dom_selection.h b/WebCore/khtml/xml/dom_selection.h
index e997df4..39e3933 100644
--- a/WebCore/khtml/xml/dom_selection.h
+++ b/WebCore/khtml/xml/dom_selection.h
@@ -108,6 +108,10 @@ public:
     
     friend class KHTMLPart;
 
+#ifndef NDEBUG
+    void formatForDebugger(char *buffer, unsigned length) const;
+#endif
+
 private:
     enum EPositionType { START, END, BASE, EXTENT };
 
diff --git a/WebCore/khtml/xml/dom_textimpl.cpp b/WebCore/khtml/xml/dom_textimpl.cpp
index 1398eff..02b91f5 100644
--- a/WebCore/khtml/xml/dom_textimpl.cpp
+++ b/WebCore/khtml/xml/dom_textimpl.cpp
@@ -477,6 +477,29 @@ DOMString TextImpl::toString() const
     return nodeValue();
 }
 
+#ifndef NDEBUG
+void TextImpl::formatForDebugger(char *buffer, unsigned length) const
+{
+    DOMString result;
+    DOMString s;
+    
+    s = nodeName();
+    if (s.length() > 0) {
+        result += s;
+    }
+          
+    s = nodeValue();
+    if (s.length() > 0) {
+        if (result.length() > 0)
+            result += "; ";
+        result += "value=";
+        result += s;
+    }
+          
+    strncpy(buffer, result.string().latin1(), length - 1);
+}
+#endif
+
 // ---------------------------------------------------------------------------
 
 CDATASectionImpl::CDATASectionImpl(DocumentPtr *impl, const DOMString &_text) : TextImpl(impl,_text)
diff --git a/WebCore/khtml/xml/dom_textimpl.h b/WebCore/khtml/xml/dom_textimpl.h
index 2f71c43..aded3f9 100644
--- a/WebCore/khtml/xml/dom_textimpl.h
+++ b/WebCore/khtml/xml/dom_textimpl.h
@@ -143,6 +143,10 @@ public:
     static Text createInstance(TextImpl *impl);
 #endif
 
+#ifndef NDEBUG
+    virtual void formatForDebugger(char *buffer, unsigned length) const;
+#endif
+
 protected:
     virtual TextImpl *createNew(DOMStringImpl *_str);
 };

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list