| 1341 | } |
| 1342 | |
| 1343 | void DebuggerTestBase::testStackFetchMore() |
| 1344 | { |
| 1345 | auto* const session = createTestDebugSession(); |
| 1346 | TestLaunchConfiguration cfg("debuggee_debugeerecursion"); |
| 1347 | const auto fileName = findSourceFile("debugeerecursion.cpp"); |
| 1348 | constexpr auto recursionDepth = 295; |
| 1349 | |
| 1350 | auto* const stackModel = session->frameStackModel(); |
| 1351 | |
| 1352 | breakpoints()->addCodeBreakpoint(QUrl::fromLocalFile(fileName), 25); |
| 1353 | const ActiveStateSessionSpy sessionSpy(session); |
| 1354 | START_DEBUGGING_AND_WAIT_FOR_PAUSED_STATE_E(session, cfg, sessionSpy); |
| 1355 | |
| 1356 | const auto threadIndex = stackModel->index(0, 0); |
| 1357 | |
| 1358 | QCOMPARE(fetchFramesCallCount(stackModel), 1); |
| 1359 | VALIDATE_COLUMN_COUNTS_THREAD_COUNT_AND_STACK_FRAME_NUMBERS(threadIndex, 1); |
| 1360 | COMPARE_DATA(threadIndex, adjustedStackModelFrameName("#1 at foo")); |
| 1361 | QCOMPARE(stackModel->rowCount(threadIndex), 21); |
| 1362 | COMPARE_DATA(stackModel->index(0, 1, threadIndex), adjustedStackModelFrameName("foo")); |
| 1363 | COMPARE_DATA(stackModel->index(0, 2, threadIndex), fileName + ":26"); |
| 1364 | COMPARE_DATA(stackModel->index(1, 1, threadIndex), adjustedStackModelFrameName("foo")); |
| 1365 | COMPARE_DATA(stackModel->index(1, 2, threadIndex), fileName + ":24"); |
| 1366 | COMPARE_DATA(stackModel->index(2, 1, threadIndex), adjustedStackModelFrameName("foo")); |
| 1367 | COMPARE_DATA(stackModel->index(2, 2, threadIndex), fileName + ":24"); |
| 1368 | |
| 1369 | stackModel->fetchMoreFrames(); |
| 1370 | WAIT_FOR_STATE_AND_IDLE(session, IDebugSession::PausedState); |
| 1371 | QCOMPARE(fetchFramesCallCount(stackModel), 2); |
| 1372 | |
| 1373 | VALIDATE_COLUMN_COUNTS_THREAD_COUNT_AND_STACK_FRAME_NUMBERS(threadIndex, 1); |
| 1374 | QCOMPARE(stackModel->rowCount(threadIndex), 41); |
| 1375 | |
| 1376 | stackModel->fetchMoreFrames(); |
| 1377 | WAIT_FOR_STATE_AND_IDLE(session, IDebugSession::PausedState); |
| 1378 | QCOMPARE(fetchFramesCallCount(stackModel), 3); |
| 1379 | |
| 1380 | VALIDATE_COLUMN_COUNTS_THREAD_COUNT_AND_STACK_FRAME_NUMBERS(threadIndex, 1); |
| 1381 | QCOMPARE(stackModel->rowCount(threadIndex), 121); |
| 1382 | |
| 1383 | stackModel->fetchMoreFrames(); |
| 1384 | WAIT_FOR_STATE_AND_IDLE(session, IDebugSession::PausedState); |
| 1385 | QCOMPARE(fetchFramesCallCount(stackModel), 4); |
| 1386 | |
| 1387 | VALIDATE_COLUMN_COUNTS_THREAD_COUNT_AND_STACK_FRAME_NUMBERS(threadIndex, 1); |
| 1388 | COMPARE_ENTIRE_MAIN_THREAD_STACK_FRAME_COUNT(stackModel, threadIndex, recursionDepth + 1); |
| 1389 | COMPARE_DATA(stackModel->index(recursionDepth, 1, threadIndex), "main"); |
| 1390 | COMPARE_DATA(stackModel->index(recursionDepth, 2, threadIndex), fileName + ":30"); |
| 1391 | |
| 1392 | stackModel->fetchMoreFrames(); // nothing to fetch, we are at the end |
| 1393 | WAIT_FOR_STATE_AND_IDLE(session, IDebugSession::PausedState); |
| 1394 | QCOMPARE(fetchFramesCallCount(stackModel), 4); |
| 1395 | |
| 1396 | VALIDATE_COLUMN_COUNTS_THREAD_COUNT_AND_STACK_FRAME_NUMBERS(threadIndex, 1); |
| 1397 | COMPARE_ENTIRE_MAIN_THREAD_STACK_FRAME_COUNT(stackModel, threadIndex, recursionDepth + 1); |
| 1398 | |
| 1399 | session->run(); |
| 1400 | WAIT_FOR_STATE(session, IDebugSession::EndedState); |
nothing calls this directly
no test coverage detected