MCPcopy Create free account
hub / github.com/SpartanJ/eepp / resolvePath

Method resolvePath

src/tools/ecode/plugins/debugger/models/variablesmodel.cpp:339–373  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

337}
338
339bool 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
375static int getLocationDistance( const ExpandedState::Location& loc1,
376 const ExpandedState::Location& loc2, bool unstableFrameId ) {

Callers

nothing calls this directly

Calls 7

getVariablesReferenceMethod · 0.80
runOnMainThreadMethod · 0.80
openRowWithPathMethod · 0.80
emptyMethod · 0.45
getChildMethod · 0.45
sizeMethod · 0.45
variablesMethod · 0.45

Tested by

no test coverage detected