| 97 | } |
| 98 | |
| 99 | void 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 | |
| 130 | void GdbTest::testManualBreakpoint() |
| 131 | { |
nothing calls this directly
no test coverage detected