diff --git a/src/apps/debugger/user_interface/gui/team_window/VariablesView.cpp b/src/apps/debugger/user_interface/gui/team_window/VariablesView.cpp index ee47f921b6..4ac7c0e863 100644 --- a/src/apps/debugger/user_interface/gui/team_window/VariablesView.cpp +++ b/src/apps/debugger/user_interface/gui/team_window/VariablesView.cpp @@ -853,6 +853,13 @@ VariablesView::VariableTableModel::ValueNodeValueChanged(ValueNode* valueNode) if (modelNode == NULL) return; + if (valueNode->ChildCreationNeedsValue() + && !valueNode->ChildrenCreated()) { + status_t error = valueNode->CreateChildren(); + if (error != B_OK) + return; + } + // check whether the value actually changed Value* value = valueNode->GetValue(); if (value == modelNode->GetValue()) @@ -1115,6 +1122,11 @@ VariablesView::VariableTableModel::_AddChildNodes(ValueNodeChild* nodeChild) valueNode = nodeChild->Node(); } + // check if this node requires child creation + // to be deferred until after its location/value have been resolved + if (valueNode->ChildCreationNeedsValue()) + return B_OK; + // create the children, if not done yet if (valueNode->ChildrenCreated()) return B_OK; diff --git a/src/apps/debugger/value/ValueNode.h b/src/apps/debugger/value/ValueNode.h index 13c78872f4..449aba779d 100644 --- a/src/apps/debugger/value/ValueNode.h +++ b/src/apps/debugger/value/ValueNode.h @@ -47,6 +47,8 @@ public: { return fContainer; } void SetContainer(ValueNodeContainer* container); + virtual bool ChildCreationNeedsValue() const + { return false; } bool ChildrenCreated() const { return fChildrenCreated; } virtual status_t CreateChildren() = 0;