Index: /trunk/src/VBox/Debugger/VBoxDbgStatsQt4.cpp
===================================================================
--- /trunk/src/VBox/Debugger/VBoxDbgStatsQt4.cpp	(revision 12818)
+++ /trunk/src/VBox/Debugger/VBoxDbgStatsQt4.cpp	(revision 12819)
@@ -1805,7 +1805,5 @@
                 PDBGGUISTATSNODE pAdv = prevNode(pCur); Assert(pAdv || !pPrev);
                 if (!isNodeAncestorOf(pCur, pNode))
-                {
                     removeAndDestroyNode(pCur);
-                }
                 pCur = pAdv;
             }
@@ -1875,69 +1873,82 @@
 
     /*
-     * Advance to the next node.
-     * (Again, we're ASSUMING that the input is sorted on (full) path name.)
-     */
-    PDBGGUISTATSNODE pParent = pNode->pParent;
-    if (pNode->cChildren)
-    {
-        /* decend to the children. */
-        pThis->m_iUpdateChild = 0;
-        Assert(pThis->m_cchUpdateParent + pNode->cchName + 2 < sizeof(pThis->m_szUpdateParent));
-        memcpy(&pThis->m_szUpdateParent[pThis->m_cchUpdateParent], pNode->pszName, pNode->cchName);
-        pThis->m_cchUpdateParent += pNode->cchName;
-        pThis->m_szUpdateParent[pThis->m_cchUpdateParent++] = '/';
-        pThis->m_szUpdateParent[pThis->m_cchUpdateParent] = '\0';
-        pThis->m_pUpdateParent = pNode;
-    }
-    else if (pNode->iSelf + 1 < pParent->cChildren)
-    {
-        /* next sibling  */
-        pThis->m_iUpdateChild = pNode->iSelf + 1;
-        Assert(pThis->m_pUpdateParent == pNode->pParent);
-    }
-    else if (pThis->m_iUpdateChild != UINT32_MAX)
-    {
-        /* move up and down- / on-wards */
-        for (;;)
-        {
-            /* ascend */
-            pNode = pParent;
-            pParent = pParent->pParent;
-            if (!pParent)
+     * Advance to the next node with data.
+     *
+     * ASSUMES a leaf *must* have data and again we're ASSUMING the sorting
+     * on slash separated sub-strings.
+     */
+    if (pThis->m_iUpdateChild != UINT32_MAX)
+    {
+#ifdef VBOX_STRICT
+        PDBGGUISTATSNODE const pCorrectNext = nextDataNode(pNode);
+#endif
+        PDBGGUISTATSNODE pParent = pNode->pParent;
+        if (pNode->cChildren)
+        {
+            /* decend to the first child. */
+            Assert(pThis->m_cchUpdateParent + pNode->cchName + 2 < sizeof(pThis->m_szUpdateParent));
+            memcpy(&pThis->m_szUpdateParent[pThis->m_cchUpdateParent], pNode->pszName, pNode->cchName);
+            pThis->m_cchUpdateParent += pNode->cchName;
+            pThis->m_szUpdateParent[pThis->m_cchUpdateParent++] = '/';
+            pThis->m_szUpdateParent[pThis->m_cchUpdateParent] = '\0';
+
+            pNode = pNode->papChildren[0];
+        }
+        else if (pNode->iSelf + 1 < pParent->cChildren)
+        {
+            /* next sibling or one if its descendants. */
+            Assert(pThis->m_pUpdateParent == pParent);
+            pNode = pParent->papChildren[pNode->iSelf + 1];
+        }
+        else
+        {
+            /* move up and down- / on-wards */
+            for (;;)
             {
-                Assert(pNode == pThis->m_pRoot);
-                pThis->m_iUpdateChild = UINT32_MAX;
-                pThis->m_szUpdateParent[0] = '\0';
-                pThis->m_cchUpdateParent = 0;
-                pThis->m_pUpdateParent = NULL;
-                break;
+                /* ascend */
+                pNode = pParent;
+                pParent = pParent->pParent;
+                if (!pParent)
+                {
+                    Assert(pNode == pThis->m_pRoot);
+                    pThis->m_iUpdateChild = UINT32_MAX;
+                    pThis->m_szUpdateParent[0] = '\0';
+                    pThis->m_cchUpdateParent = 0;
+                    pThis->m_pUpdateParent = NULL;
+                    break;
+                }
+                Assert(pThis->m_cchUpdateParent > pNode->cchName + 1);
+                pThis->m_cchUpdateParent -= pNode->cchName + 1;
+
+                /* try advance */
+                if (pNode->iSelf + 1 < pParent->cChildren)
+                {
+                    pNode = pParent->papChildren[pNode->iSelf + 1];
+                    pThis->m_szUpdateParent[pThis->m_cchUpdateParent] = '\0';
+                    break;
+                }
             }
-            Assert(pThis->m_cchUpdateParent > pNode->cchName + 1);
-            pThis->m_cchUpdateParent -= pNode->cchName + 1;
-
-            /* try advance */
-            if (pNode->iSelf + 1 < pParent->cChildren)
+        }
+
+        /* decend to a node containing data and finalize the globals. (ASSUMES leaf has data.) */
+        if (pThis->m_iUpdateChild != UINT32_MAX)
+        {
+            while (   pNode->enmType == STAMTYPE_INVALID
+                   && pNode->cChildren > 0)
             {
-                pNode = pParent->papChildren[pNode->iSelf + 1];
-
-                /* decend to a node containing data. */
-                while (   pNode->enmType == STAMTYPE_INVALID
-                       && pNode->cChildren > 0)
-                {
-                    Assert(pNode->enmState == kDbgGuiStatsNodeState_kVisible);
-
-                    Assert(pThis->m_cchUpdateParent + pNode->cchName + 2 < sizeof(pThis->m_szUpdateParent));
-                    memcpy(&pThis->m_szUpdateParent[pThis->m_cchUpdateParent], pNode->pszName, pNode->cchName);
-                    pThis->m_cchUpdateParent += pNode->cchName;
-                    pThis->m_szUpdateParent[pThis->m_cchUpdateParent++] = '/';
-
-                    pNode = pNode->papChildren[0];
-                }
-                Assert(pNode->enmType != STAMTYPE_INVALID);
+                Assert(pNode->enmState == kDbgGuiStatsNodeState_kVisible);
+
+                Assert(pThis->m_cchUpdateParent + pNode->cchName + 2 < sizeof(pThis->m_szUpdateParent));
+                memcpy(&pThis->m_szUpdateParent[pThis->m_cchUpdateParent], pNode->pszName, pNode->cchName);
+                pThis->m_cchUpdateParent += pNode->cchName;
+                pThis->m_szUpdateParent[pThis->m_cchUpdateParent++] = '/';
                 pThis->m_szUpdateParent[pThis->m_cchUpdateParent] = '\0';
-                pThis->m_iUpdateChild = pNode->iSelf;
-                pThis->m_pUpdateParent = pNode->pParent;
-                break;
+
+                pNode = pNode->papChildren[0];
             }
+            Assert(pNode->enmType != STAMTYPE_INVALID);
+            pThis->m_iUpdateChild = pNode->iSelf;
+            pThis->m_pUpdateParent = pNode->pParent;
+            Assert(pNode == pCorrectNext);
         }
     }
@@ -1994,14 +2005,11 @@
     {
         PDBGGUISTATSNODE const pLast = prevDataNode(m_pUpdateParent->papChildren[m_iUpdateChild]);
-        for (;;)
-        {
-            PDBGGUISTATSNODE pNode = nextNode(pLast);
-            if (!pNode)
-                break;
-char szFoo[1024];
-getNodePath(pNode, szFoo, 1024); fprintf(stderr, "removing pNode=%p: %s\n", pNode, szFoo);
-if (pLast) getNodePath(pLast, szFoo, 1024); else szFoo[0] = '\0';
-                                 fprintf(stderr, "         pLast=%p: %s\n", pLast, szFoo);
-            removeAndDestroyNode(pNode);
+        if (!pLast)
+            setRootNode(createRootNode());
+        else
+        {
+            PDBGGUISTATSNODE pNode;
+            while ((pNode = nextNode(pLast)))
+                removeAndDestroyNode(pNode);
         }
         m_fUpdateInsertRemove = true;
Index: /trunk/src/VBox/Debugger/VBoxDbgStatsQt4.h
===================================================================
--- /trunk/src/VBox/Debugger/VBoxDbgStatsQt4.h	(revision 12818)
+++ /trunk/src/VBox/Debugger/VBoxDbgStatsQt4.h	(revision 12819)
@@ -77,30 +77,4 @@
      */
     void resetStats(const QString &rPatStr);
-
-private:
-    /**
-     * Callback function for the STAMR3Enum() made by update().
-     *
-     * @returns 0 (i.e. never halt enumeration).
-     *
-     * @param   pszName         The name of the sample.
-     * @param   enmType         The type.
-     * @param   pvSample        Pointer to the data. enmType indicates the format of this data.
-     * @param   enmUnit         The unit.
-     * @param   enmVisibility   The visibility.
-     * @param   pszDesc         The description.
-     * @param   pvUser          Pointer to the VBoxDbgStatsView object.
-     */
-//later:    static DECLCALLBACK(int) updateCallback(const char *pszName, STAMTYPE enmType, void *pvSample, STAMUNIT enmUnit,
-//later:                                            STAMVISIBILITY enmVisibility, const char *pszDesc, void *pvUser);
-
-protected:
-    /**
-     * Creates / finds the path to the specified stats item and makes is visible.
-     *
-     * @returns Parent node.
-     * @param   pszName     Path to a stats item.
-     */
-//    VBoxDbgStatsItem *createPath(const char *pszName);
 
 protected slots:
