From 6a2d6f5062d43a3f5f631c699d3f0a90b0eff8bd Mon Sep 17 00:00:00 2001 From: Rene Gollent Date: Sat, 27 Apr 2013 16:04:33 -0400 Subject: [PATCH] Fix a case where values wouldn't be requested properly. - If a node was already expanded, and we then removed/replaced its children, those wouldn't automatically get their value nodes added. Consequently, value retrieval for them would fail until the parent was collapsed/re-expanded. If we encounter such a model node when receiving a value request, notify the table model so it can construct the value node appropriately. --- .../gui/team_window/VariablesView.cpp | 28 +++++++++++++------ 1 file changed, 20 insertions(+), 8 deletions(-) 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 df5ec67ad1..d86684706c 100644 --- a/src/apps/debugger/user_interface/gui/team_window/VariablesView.cpp +++ b/src/apps/debugger/user_interface/gui/team_window/VariablesView.cpp @@ -998,11 +998,9 @@ VariablesView::VariableTableModel::ValueNodeChildrenCreated( child->IsInternal(), childCount == 1); } - if (valueNode->ChildCreationNeedsValue()) { - ModelNode* childNode = fNodeTable.Lookup(child); - if (childNode != NULL) - fContainerListener->ModelNodeValueRequested(childNode); - } + ModelNode* childNode = fNodeTable.Lookup(child); + if (childNode != NULL) + fContainerListener->ModelNodeValueRequested(childNode); } if (valueNode->ChildCreationNeedsValue()) @@ -1921,9 +1919,23 @@ VariablesView::_RequestNodeValue(ModelNode* node) // get the value node and check whether its value has not yet been resolved ValueNode* valueNode = nodeChild->Node(); - if (valueNode == NULL - || valueNode->LocationAndValueResolutionState() - != VALUE_NODE_UNRESOLVED) { + if (valueNode == NULL) { + ModelNode* parent = node->Parent(); + if (parent != NULL) { + TreeTablePath path; + if (!fVariableTableModel->GetTreePath(parent, path)) + return; + + // if the parent node was already expanded when the child was + // added, we may not yet have added a value node. + // Notify the table model that this needs to be done. + if (fVariableTable->IsNodeExpanded(path)) + fVariableTableModel->NodeExpanded(parent); + } + } + + if (valueNode == NULL || valueNode->LocationAndValueResolutionState() + != VALUE_NODE_UNRESOLVED) { return; }