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

Method testManualBreakpoint

plugins/lldb/unittests/test_lldb.cpp:146–184  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

144}
145
146void LldbTest::testManualBreakpoint()
147{
148 auto *session = new TestDebugSession;
149 TestLaunchConfiguration cfg;
150
151 breakpoints()->addCodeBreakpoint(QStringLiteral("main"));
152 ActiveStateSessionSpy sessionSpy(session);
153 START_DEBUGGING_AND_WAIT_FOR_PAUSED_STATE_E(session, cfg, sessionSpy);
154 QCOMPARE(session->currentLine(), 27);
155
156 breakpoints()->removeRows(0, 1);
157 WAIT_FOR_STATE_AND_IDLE(session, DebugSession::PausedState);
158 QCOMPARE(breakpoints()->rowCount(), 0);
159
160 session->addCommand(MI::NonMI, QStringLiteral("break set --file debugee.cpp --line 23"));
161 WAIT_FOR_STATE_AND_IDLE(session, DebugSession::PausedState);
162 QTRY_COMPARE(breakpoints()->rowCount(), 1);
163
164 auto b = breakpoints()->breakpoint(0);
165 QCOMPARE(b->line(), 22);
166
167 session->addCommand(MI::NonMI, QStringLiteral("break disable 2"));
168 session->addCommand(MI::NonMI, QStringLiteral("break modify -c 'i == 1' 2"));
169 session->addCommand(MI::NonMI, QStringLiteral("break modify -i 1 2"));
170 WAIT_FOR_STATE_AND_IDLE(session, DebugSession::PausedState);
171 QCOMPARE(b->enabled(), false);
172 QEXPECT_FAIL("", "LLDB 4.0 does not report condition in mi response", Continue);
173 QCOMPARE(b->condition(), QString("i == 1"));
174 QEXPECT_FAIL("", "LLDB 4.0 does not report ignore hits in mi response", Continue);
175 QCOMPARE(b->ignoreHits(), 1);
176
177 session->addCommand(MI::NonMI, QStringLiteral("break delete 2"));
178 WAIT_FOR_STATE_AND_IDLE(session, DebugSession::PausedState);
179 QEXPECT_FAIL("", "LLDB 4.0 does not report breakpoint deletion as mi notification", Continue);
180 QCOMPARE(breakpoints()->rowCount(), 0);
181
182 session->run();
183 WAIT_FOR_STATE(session, DebugSession::EndedState);
184}
185
186void LldbTest::testBreakpointDisabledOnStart()
187{

Callers

nothing calls this directly

Calls 12

currentLineMethod · 0.80
breakpointMethod · 0.80
enabledMethod · 0.80
conditionMethod · 0.80
ignoreHitsMethod · 0.80
addCommandMethod · 0.60
QStringClass · 0.50
addCodeBreakpointMethod · 0.45
removeRowsMethod · 0.45
rowCountMethod · 0.45
lineMethod · 0.45
runMethod · 0.45

Tested by

no test coverage detected