| 337 | } |
| 338 | |
| 339 | bool VariablesHolder::resolvePath( std::vector<std::string> path, DebuggerClient* client, |
| 340 | UITreeView* uiVariables, ModelVariableNode::NodePtr parentNode, |
| 341 | int pathPos ) { |
| 342 | if ( path.empty() || !parentNode ) |
| 343 | return false; |
| 344 | |
| 345 | auto currentNodeOpt = parentNode->getChild( path[pathPos] ); |
| 346 | if ( !currentNodeOpt ) |
| 347 | return false; |
| 348 | |
| 349 | auto currentNode = *currentNodeOpt; |
| 350 | |
| 351 | if ( currentNode->getVariablesReference() > 0 ) { |
| 352 | const auto onVariablesReceived = [this, uiVariables, path, currentNode, pathPos, |
| 353 | client]( const int variablesReference, |
| 354 | std::vector<Variable>&& vars ) { |
| 355 | addVariables( variablesReference, std::move( vars ) ); |
| 356 | |
| 357 | uiVariables->runOnMainThread( |
| 358 | [uiVariables, path] { uiVariables->openRowWithPath( path, false ); } ); |
| 359 | |
| 360 | auto nextPos = pathPos + 1; |
| 361 | if ( nextPos < static_cast<Int64>( path.size() ) ) { |
| 362 | resolvePath( path, client, uiVariables, currentNode, nextPos ); |
| 363 | } |
| 364 | }; |
| 365 | |
| 366 | client->variables( currentNode->getVariablesReference(), Variable::Type::Both, |
| 367 | onVariablesReceived ); |
| 368 | |
| 369 | return true; |
| 370 | } |
| 371 | |
| 372 | return false; |
| 373 | } |
| 374 | |
| 375 | static int getLocationDistance( const ExpandedState::Location& loc1, |
| 376 | const ExpandedState::Location& loc2, bool unstableFrameId ) { |
nothing calls this directly
no test coverage detected