| 1230 | } |
| 1231 | |
| 1232 | void DebuggerTestBase::testCatchpoint() |
| 1233 | { |
| 1234 | auto* const session = createTestDebugSession(); |
| 1235 | TestLaunchConfiguration cfg("debuggee_debugeeexception"); |
| 1236 | |
| 1237 | const auto* const stackModel = qobject_cast<FrameStackModel*>(session->frameStackModel()); |
| 1238 | QVERIFY(stackModel); |
| 1239 | |
| 1240 | breakpoints()->addCodeBreakpoint(QUrl::fromLocalFile(findSourceFile("debugeeexception.cpp")), 29); |
| 1241 | ActiveStateSessionSpy sessionSpy(session); |
| 1242 | START_DEBUGGING_AND_WAIT_FOR_PAUSED_STATE_E(session, cfg, sessionSpy); |
| 1243 | QCOMPARE(stackModel->currentFrame(), 0); |
| 1244 | QCOMPARE(session->currentLine(), 29); |
| 1245 | |
| 1246 | session->addCommand(MI::NonMI, isLldb() ? "break set -E c++" : "catch throw"); |
| 1247 | CONTINUE_AND_WAIT_FOR_PAUSED_STATE(session, sessionSpy); |
| 1248 | |
| 1249 | const auto frames = stackModel->frames(stackModel->currentThread()); |
| 1250 | QCOMPARE_GE(frames.size(), 2); |
| 1251 | // frame 0 is somewhere inside libstdc++ |
| 1252 | QCOMPARE(frames[1].file, QUrl::fromLocalFile(findSourceFile("debugeeexception.cpp"))); |
| 1253 | QCOMPARE(frames[1].line, 22); |
| 1254 | |
| 1255 | QCOMPARE(breakpoints()->rowCount(), 2); |
| 1256 | QVERIFY(!breakpoints()->breakpoint(0)->location().isEmpty()); |
| 1257 | QVERIFY(!breakpoints()->breakpoint(1)->location().isEmpty()); |
| 1258 | |
| 1259 | session->run(); |
| 1260 | WAIT_FOR_STATE(session, IDebugSession::EndedState); |
| 1261 | } |
| 1262 | |
| 1263 | void DebuggerTestBase::testShowStepInSource() |
| 1264 | { |
nothing calls this directly
no test coverage detected