MCPcopy Create free account
hub / github.com/KDE/kdevelop / testThreadAndFrameInfo

Method testThreadAndFrameInfo

plugins/debuggercommon/tests/debuggertestbase.cpp:1438–1466  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1436}
1437
1438void DebuggerTestBase::testThreadAndFrameInfo()
1439{
1440 // Verify that `--thread <current thread number>` is added to commands that can specify a thread but do not do so.
1441
1442 auto* const session = createTestDebugSession();
1443 TestLaunchConfiguration cfg("debuggee_debugeethreads");
1444 const auto fileName = findSourceFile("debugeethreads.cpp");
1445
1446 breakpoints()->addCodeBreakpoint(QUrl::fromLocalFile(fileName), 43); // QThread::msleep(600);
1447 const ActiveStateSessionSpy sessionSpy(session);
1448 START_DEBUGGING_AND_WAIT_FOR_PAUSED_STATE_E(session, cfg, sessionSpy);
1449
1450 const QSignalSpy userCommandOutputSpy(session, &MIDebugSession::debuggerUserCommandOutput);
1451
1452 session->addCommand(std::make_unique<MI::UserCommand>(MI::ThreadInfo, ""));
1453 session->addCommand(std::make_unique<MI::UserCommand>(MI::StackListLocals, "0"));
1454 WAIT_FOR_STATE_AND_IDLE(session, IDebugSession::PausedState); // wait for command finish
1455
1456 // The user command outputs should be:
1457 // 0. -thread-info
1458 // 1. ^done for thread-info
1459 // 2. -stack-list-locals
1460 // 3. ^done for -stack-list-locals
1461 QCOMPARE(userCommandOutputSpy.count(), 4);
1462 QVERIFY(userCommandOutputSpy.at(2).constFirst().toString().contains("--thread 1"));
1463
1464 session->run();
1465 WAIT_FOR_STATE(session, IDebugSession::EndedState);
1466}
1467
1468/**
1469 * @return the name of a core dump file

Callers

nothing calls this directly

Calls 8

findSourceFileFunction · 0.85
addCommandMethod · 0.60
addCodeBreakpointMethod · 0.45
countMethod · 0.45
containsMethod · 0.45
toStringMethod · 0.45
atMethod · 0.45
runMethod · 0.45

Tested by

no test coverage detected