Author: anevilyak Date: 2011-07-20 00:39:05 +0200 (Wed, 20 Jul 2011) New Revision: 42457 Changeset: https://dev.haiku-os.org/changeset/42457 Modified: haiku/trunk/src/apps/debugger/user_interface/gui/team_window/VariablesView.cpp Log: For value nodes with deferred child creation, value loading needs to be requested once the deferred load has been complete, otherwise their values would never be loaded if their parent node was already expanded while stepping through the debugger. There still remains an issue with saving/restoring view state for such nodes though. Modified: haiku/trunk/src/apps/debugger/user_interface/gui/team_window/VariablesView.cpp =================================================================== --- haiku/trunk/src/apps/debugger/user_interface/gui/team_window/VariablesView.cpp 2011-07-19 21:54:27 UTC (rev 42456) +++ haiku/trunk/src/apps/debugger/user_interface/gui/team_window/VariablesView.cpp 2011-07-19 22:39:05 UTC (rev 42457) @@ -48,7 +48,8 @@ enum { - MSG_MODEL_NODE_HIDDEN = 'monh' + MSG_MODEL_NODE_HIDDEN = 'monh', + MSG_VALUE_NODE_NEEDS_VALUE = 'mvnv' }; @@ -70,6 +71,8 @@ virtual void ModelNodeHidden(ModelNode* node); + virtual void ModelNodeValueRequested(ModelNode* node); + private: BHandler* fIndirectTarget; VariableTableModel* fModel; @@ -689,6 +692,20 @@ } +void +VariablesView::ContainerListener::ModelNodeValueRequested(ModelNode* node) +{ + BReference<ModelNode> nodeReference(node); + + BMessage message(MSG_VALUE_NODE_NEEDS_VALUE); + if (message.AddPointer("node", node) == B_OK + && fIndirectTarget->Looper()->PostMessage(&message, fIndirectTarget) + == B_OK) { + nodeReference.Detach(); + } +} + + // #pragma mark - VariableTableModel @@ -845,6 +862,13 @@ _AddNode(modelNode->GetVariable(), modelNode, child, child->IsInternal(), childCount == 1); } + + if (valueNode->ChildCreationNeedsValue()) { + ModelNode* childNode = fNodeTable.Lookup(child); + if (childNode != NULL) + fContainerListener->ModelNodeValueRequested(childNode); + } + } } @@ -882,6 +906,12 @@ status_t error = valueNode->CreateChildren(); if (error != B_OK) return; + + for (int32 i = 0; i < valueNode->CountChildren(); i++) { + ValueNodeChild* child = valueNode->ChildAt(i); + _CreateValueNode(child); + _AddChildNodes(child); + } } // check whether the value actually changed @@ -1407,6 +1437,7 @@ break; } + case MSG_VALUE_NODE_NEEDS_VALUE: case MSG_MODEL_NODE_HIDDEN: { ModelNode* node;