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

Method testBreakOnReadBreakpoint2

plugins/debuggercommon/tests/debuggertestbase.cpp:759–785  ·  view source on GitHub ↗

This test adds a read watchpoint during a debug session rather than before it in order to work around the (already fixed) GDB bug http://sourceware.org/bugzilla/show_bug.cgi?id=10136

Source from the content-addressed store, hash-verified

757// This test adds a read watchpoint during a debug session rather than before it in order to
758// work around the (already fixed) GDB bug http://sourceware.org/bugzilla/show_bug.cgi?id=10136
759void DebuggerTestBase::testBreakOnReadBreakpoint2()
760{
761 if (isLldb()) {
762 QSKIP("Skipping... LLDB-MI does not have proper watchpoint support");
763 }
764 auto* const session = createTestDebugSession();
765 TestLaunchConfiguration cfg;
766
767 addDebugeeBreakpoint(25);
768 ActiveStateSessionSpy sessionSpy(session);
769 START_DEBUGGING_AND_WAIT_FOR_PAUSED_STATE_E(session, cfg, sessionSpy);
770 QCOMPARE(currentMiLine(session), 25);
771
772 breakpoints()->addReadWatchpoint("i");
773
774 CONTINUE_AND_WAIT_FOR_PAUSED_STATE(session, sessionSpy);
775 QCOMPARE(currentMiLine(session), 23); // ++i
776
777 CONTINUE_AND_WAIT_FOR_PAUSED_STATE(session, sessionSpy);
778 QCOMPARE(currentMiLine(session), 23); // int j = i
779
780 CONTINUE_AND_WAIT_FOR_PAUSED_STATE(session, sessionSpy);
781 QCOMPARE(currentMiLine(session), 25);
782
783 session->run();
784 WAIT_FOR_STATE(session, IDebugSession::EndedState);
785}
786
787void DebuggerTestBase::testBreakOnAccessBreakpoint()
788{

Callers

nothing calls this directly

Calls 3

currentMiLineFunction · 0.85
addReadWatchpointMethod · 0.80
runMethod · 0.45

Tested by

no test coverage detected