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

Method testCatchpoint

plugins/debuggercommon/tests/debuggertestbase.cpp:1232–1261  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1230}
1231
1232void 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
1263void DebuggerTestBase::testShowStepInSource()
1264{

Callers

nothing calls this directly

Calls 14

findSourceFileFunction · 0.85
currentFrameMethod · 0.80
currentLineMethod · 0.80
framesMethod · 0.80
currentThreadMethod · 0.80
breakpointMethod · 0.80
addCommandMethod · 0.60
frameStackModelMethod · 0.45
addCodeBreakpointMethod · 0.45
sizeMethod · 0.45
rowCountMethod · 0.45
isEmptyMethod · 0.45

Tested by

no test coverage detected