Changeset 19572 in webkit


Ignore:
Timestamp:
Feb 11, 2007 11:37:07 PM (17 years ago)
Author:
beidson
Message:

Reviewed by Maciej

First in what will be a series of HistoryItem enhancements to help debugging

  • history/HistoryItem.cpp: (WebCore::HistoryItem::showTree): (WebCore::HistoryItem::showTreeWithIndent): (showTree): Outside of WebCore namespace, and extern "C" - to make even the DWARF debugger able to find it... *sigh*
  • history/HistoryItem.h:
Location:
trunk/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r19571 r19572  
     12007-02-11  Brady Eidson <beidson@apple.com>
     2
     3        Reviewed by Maciej
     4
     5        First in what will be a series of HistoryItem enhancements to help debugging
     6
     7        * history/HistoryItem.cpp:
     8        (WebCore::HistoryItem::showTree):
     9        (WebCore::HistoryItem::showTreeWithIndent):
     10        (showTree): Outside of WebCore namespace, and extern "C" - to make even the
     11          DWARF debugger able to find it...  *sigh*
     12        * history/HistoryItem.h:
     13
    1142007-02-11  Eric Seidel  <eric@webkit.org>
    215
  • trunk/WebCore/history/HistoryItem.cpp

    r18603 r19572  
    503503}
    504504#ifndef NDEBUG
    505 void HistoryItem::print() const
    506 {
    507     fprintf(stderr, "%s\n", m_urlString.ascii().data());
     505int HistoryItem::showTree() const
     506{
     507    return showTreeWithIndent(0);
     508}
     509
     510int HistoryItem::showTreeWithIndent(unsigned indentLevel) const
     511{
     512    String prefix("");
     513    int totalSubItems = 0;
     514    unsigned i;
     515    for (i = 0; i < indentLevel; ++i)
     516        prefix.append("  ");
     517
     518    fprintf(stderr, "%s+-%s (%p)\n", prefix.ascii().data(), m_urlString.ascii().data(), this);
     519   
     520    for (unsigned int i = 0; i < m_subItems.size(); ++i) {
     521        totalSubItems += m_subItems[i]->showTreeWithIndent(indentLevel + 1);
     522    }
     523    return totalSubItems + 1;
    508524}
    509525#endif
     
    511527}; //namespace WebCore
    512528
     529#ifndef NDEBUG
     530int showTree(const WebCore::HistoryItem* item)
     531{
     532    return item->showTree();
     533}
     534#endif
     535
  • trunk/WebCore/history/HistoryItem.h

    r18874 r19572  
    148148   
    149149#ifndef NDEBUG
    150     void print() const;
     150    int showTree() const;
     151    int showTreeWithIndent(unsigned indentLevel) const;
    151152#endif
    152153
     
    191192} //namespace WebCore
    192193
     194#ifndef NDEBUG
     195// Outside the WebCore namespace for ease of invocation from gdb.
     196extern "C" int showTree(const WebCore::HistoryItem*);
     197#endif
     198
    193199#endif // HISTORYITEM_H
Note: See TracChangeset for help on using the changeset viewer.