| 437 | } |
| 438 | |
| 439 | void DebuggerTestBase::testDisableBreakpoint() |
| 440 | { |
| 441 | auto* const session = createTestDebugSession(); |
| 442 | TestLaunchConfiguration cfg; |
| 443 | |
| 444 | // Description: we must stop only on the third breakpoint. |
| 445 | const auto firstBreakLine = 29; |
| 446 | const auto secondBreakLine = 24; |
| 447 | const auto thirdBreakLine = 25; |
| 448 | const auto fourthBreakLine = 32; |
| 449 | |
| 450 | Breakpoint* breakpoint; |
| 451 | |
| 452 | breakpoint = addDebugeeBreakpoint(firstBreakLine); |
| 453 | breakpoint->setData(Breakpoint::EnableColumn, Qt::Unchecked); |
| 454 | |
| 455 | // This is needed to emulate debug from GUI. If we are in edit mode, the debugSession doesn't exist. |
| 456 | Breakpoint* thirdBreak; |
| 457 | { |
| 458 | QSignalBlocker signalBlocker(breakpoints()); |
| 459 | |
| 460 | breakpoint = addDebugeeBreakpoint(secondBreakLine); |
| 461 | breakpoint->setData(Breakpoint::EnableColumn, Qt::Unchecked); |
| 462 | // all disabled breakpoints were added |
| 463 | |
| 464 | thirdBreak = addDebugeeBreakpoint(thirdBreakLine); |
| 465 | } |
| 466 | |
| 467 | ActiveStateSessionSpy sessionSpy(session); |
| 468 | START_DEBUGGING_AND_WAIT_FOR_PAUSED_STATE_E(session, cfg, sessionSpy); |
| 469 | QCOMPARE(session->currentLine(), thirdBreak->line()); |
| 470 | |
| 471 | // disable existing breakpoint |
| 472 | thirdBreak->setData(Breakpoint::EnableColumn, Qt::Unchecked); |
| 473 | |
| 474 | // add another disabled breakpoint |
| 475 | breakpoint = addDebugeeBreakpoint(fourthBreakLine); |
| 476 | WAIT_FOR_STATE_AND_IDLE(session, IDebugSession::PausedState); |
| 477 | breakpoint->setData(Breakpoint::EnableColumn, Qt::Unchecked); |
| 478 | |
| 479 | session->run(); |
| 480 | WAIT_FOR_STATE(session, IDebugSession::EndedState); |
| 481 | } |
| 482 | |
| 483 | void DebuggerTestBase::testChangeLocationBreakpoint() |
| 484 | { |
nothing calls this directly
no test coverage detected