Changeset View
Changeset View
Standalone View
Standalone View
debuggers/gdb/unittests/test_gdb.cpp
Show First 20 Lines • Show All 431 Lines • ▼ Show 20 Line(s) | 419 | { | |||
---|---|---|---|---|---|
432 | WAIT_FOR_STATE(session, DebugSession::EndedState); | 432 | WAIT_FOR_STATE(session, DebugSession::EndedState); | ||
433 | } | 433 | } | ||
434 | 434 | | |||
435 | void GdbTest::testUpdateBreakpoint() | 435 | void GdbTest::testUpdateBreakpoint() | ||
436 | { | 436 | { | ||
437 | TestDebugSession *session = new TestDebugSession; | 437 | TestDebugSession *session = new TestDebugSession; | ||
438 | TestLaunchConfiguration cfg; | 438 | TestLaunchConfiguration cfg; | ||
439 | 439 | | |||
440 | // breakpoint 1: line 29 | ||||
440 | KDevelop::Breakpoint * b = breakpoints()->addCodeBreakpoint(QUrl::fromLocalFile(debugeeFileName), 28); | 441 | KDevelop::Breakpoint * b = breakpoints()->addCodeBreakpoint(QUrl::fromLocalFile(debugeeFileName), 28); | ||
441 | QCOMPARE(breakpoints()->rowCount(), 1); | 442 | QCOMPARE(breakpoints()->rowCount(), 1); | ||
442 | 443 | | |||
443 | session->startProgram(&cfg, m_iface); | 444 | session->startProgram(&cfg, m_iface); | ||
444 | 445 | | |||
446 | // breakpoint 2: line 28 | ||||
445 | //insert custom command as user might do it using GDB console | 447 | //insert custom command as user might do it using GDB console | ||
446 | session->addCommand(new UserCommand(GDBMI::NonMI, "break "+debugeeFileName+":28")); | 448 | session->addCommand(new UserCommand(GDBMI::NonMI, "break "+debugeeFileName+":28")); | ||
447 | 449 | | |||
448 | WAIT_FOR_STATE(session, DebugSession::PausedState); | 450 | WAIT_FOR_STATE_AND_IDLE(session, DebugSession::PausedState); // stop at line 28 | ||
449 | QTest::qWait(100); | | |||
450 | session->stepInto(); | 451 | session->stepInto(); | ||
451 | WAIT_FOR_STATE(session, DebugSession::PausedState); | 452 | WAIT_FOR_STATE_AND_IDLE(session, DebugSession::PausedState); // stop after step | ||
452 | QCOMPARE(breakpoints()->rowCount(), 2); | 453 | QCOMPARE(breakpoints()->rowCount(), 2); | ||
453 | b = breakpoints()->breakpoint(1); | 454 | b = breakpoints()->breakpoint(1); | ||
454 | QCOMPARE(b->url(), QUrl::fromLocalFile(debugeeFileName)); | 455 | QCOMPARE(b->url(), QUrl::fromLocalFile(debugeeFileName)); | ||
455 | QCOMPARE(b->line(), 27); | 456 | QCOMPARE(b->line(), 27); | ||
456 | session->run(); | 457 | session->run(); | ||
458 | WAIT_FOR_STATE(session, DebugSession::PausedState); // stop at line 29 | ||||
459 | session->run(); | ||||
457 | WAIT_FOR_STATE(session, DebugSession::EndedState); | 460 | WAIT_FOR_STATE(session, DebugSession::EndedState); | ||
458 | } | 461 | } | ||
459 | 462 | | |||
460 | void GdbTest::testIgnoreHitsBreakpoint() | 463 | void GdbTest::testIgnoreHitsBreakpoint() | ||
461 | { | 464 | { | ||
462 | TestDebugSession *session = new TestDebugSession; | 465 | TestDebugSession *session = new TestDebugSession; | ||
463 | TestLaunchConfiguration cfg; | 466 | TestLaunchConfiguration cfg; | ||
464 | 467 | | |||
▲ Show 20 Lines • Show All 1569 Lines • Show Last 20 Lines |