| 1436 | } |
| 1437 | |
| 1438 | void 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 |
nothing calls this directly
no test coverage detected