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

Method testUpdateBreakpoint

plugins/gdb/unittests/test_gdb.cpp:99–128  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

97}
98
99void GdbTest::testUpdateBreakpoint()
100{
101 auto *session = new TestDebugSession;
102 TestLaunchConfiguration cfg;
103
104 // breakpoint 1: real line 29: foo();
105 auto* b = breakpoints()->addCodeBreakpoint(debugeeUrl(), 28);
106 QCOMPARE(breakpoints()->rowCount(), 1);
107
108 START_DEBUGGING_E(session, cfg);
109
110 // breakpoint 2: real line 32: const char *x = "Hello";
111 //insert custom command as user might do it using GDB console
112 session->addCommand(std::make_unique<MI::UserCommand>(MI::NonMI, "break " + debugeeLocationAt(32)));
113
114 WAIT_FOR_STATE_AND_IDLE(session, DebugSession::PausedState); // stop at breakpoint 1, with custom command handled
115 QCOMPARE(session->currentLine(), 28);
116
117 // check breakpoint 2 got picked up
118 QCOMPARE(breakpoints()->rowCount(), 2);
119 b = breakpoints()->breakpoint(1);
120 QCOMPARE(b->url(), debugeeUrl());
121 QCOMPARE(b->line(), 31);
122
123 session->run();
124 WAIT_FOR_STATE(session, DebugSession::PausedState); // stop at breakpoint 2
125 QCOMPARE(session->currentLine(), 31);
126 session->run();
127 WAIT_FOR_STATE(session, DebugSession::EndedState);
128}
129
130void GdbTest::testManualBreakpoint()
131{

Callers

nothing calls this directly

Calls 8

currentLineMethod · 0.80
breakpointMethod · 0.80
addCommandMethod · 0.60
addCodeBreakpointMethod · 0.45
rowCountMethod · 0.45
urlMethod · 0.45
lineMethod · 0.45
runMethod · 0.45

Tested by

no test coverage detected