Changeset View
Changeset View
Standalone View
Standalone View
debuggers/gdb/unittests/test_gdb.cpp
Show First 20 Lines • Show All 57 Lines • ▼ Show 20 Line(s) | 57 | #define SKIP_IF_ATTACH_FORBIDDEN() \ | |||
---|---|---|---|---|---|
58 | do { \ | 58 | do { \ | ||
59 | if (KDevMI::isAttachForbidden(__FILE__, __LINE__)) \ | 59 | if (KDevMI::isAttachForbidden(__FILE__, __LINE__)) \ | ||
60 | return; \ | 60 | return; \ | ||
61 | } while(0) | 61 | } while(0) | ||
62 | 62 | | |||
63 | using KDevelop::AutoTestShell; | 63 | using KDevelop::AutoTestShell; | ||
64 | using KDevMI::findExecutable; | 64 | using KDevMI::findExecutable; | ||
65 | using KDevMI::findSourceFile; | 65 | using KDevMI::findSourceFile; | ||
66 | using KDevMI::findFile; | ||||
66 | 67 | | |||
67 | namespace KDevMI { namespace GDB { | 68 | namespace KDevMI { namespace GDB { | ||
68 | 69 | | |||
69 | void GdbTest::initTestCase() | 70 | void GdbTest::initTestCase() | ||
70 | { | 71 | { | ||
71 | AutoTestShell::init(); | 72 | AutoTestShell::init(); | ||
72 | KDevelop::TestCore::initialize(KDevelop::Core::NoUi); | 73 | KDevelop::TestCore::initialize(KDevelop::Core::NoUi); | ||
73 | 74 | | |||
▲ Show 20 Lines • Show All 468 Lines • ▼ Show 20 Line(s) | 535 | { | |||
542 | WAIT_FOR_STATE_AND_IDLE(session, DebugSession::PausedState); | 543 | WAIT_FOR_STATE_AND_IDLE(session, DebugSession::PausedState); | ||
543 | QCOMPARE(session->line(), 24); | 544 | QCOMPARE(session->line(), 24); | ||
544 | 545 | | |||
545 | breakpoints()->addWatchpoint(QStringLiteral("i")); | 546 | breakpoints()->addWatchpoint(QStringLiteral("i")); | ||
546 | QTest::qWait(100); | 547 | QTest::qWait(100); | ||
547 | 548 | | |||
548 | session->run(); | 549 | session->run(); | ||
549 | WAIT_FOR_STATE(session, DebugSession::PausedState); | 550 | WAIT_FOR_STATE(session, DebugSession::PausedState); | ||
550 | QCOMPARE(session->line(), 23); | 551 | QCOMPARE(session->line(), 22); // line 23: ++i; int j = i; | ||
551 | session->run(); | 552 | session->run(); | ||
552 | WAIT_FOR_STATE(session, DebugSession::PausedState); | 553 | WAIT_FOR_STATE(session, DebugSession::PausedState); | ||
553 | QCOMPARE(session->line(), 24); | 554 | QCOMPARE(session->line(), 24); | ||
554 | session->run(); | 555 | session->run(); | ||
555 | WAIT_FOR_STATE(session, DebugSession::EndedState); | 556 | WAIT_FOR_STATE(session, DebugSession::EndedState); | ||
556 | } | 557 | } | ||
557 | 558 | | |||
558 | void GdbTest::testBreakOnWriteWithConditionBreakpoint() | 559 | void GdbTest::testBreakOnWriteWithConditionBreakpoint() | ||
Show All 9 Lines | 560 | { | |||
568 | QCOMPARE(session->line(), 24); | 569 | QCOMPARE(session->line(), 24); | ||
569 | 570 | | |||
570 | KDevelop::Breakpoint *b = breakpoints()->addWatchpoint(QStringLiteral("i")); | 571 | KDevelop::Breakpoint *b = breakpoints()->addWatchpoint(QStringLiteral("i")); | ||
571 | b->setCondition(QStringLiteral("i==2")); | 572 | b->setCondition(QStringLiteral("i==2")); | ||
572 | QTest::qWait(100); | 573 | QTest::qWait(100); | ||
573 | 574 | | |||
574 | session->run(); | 575 | session->run(); | ||
575 | WAIT_FOR_STATE(session, DebugSession::PausedState); | 576 | WAIT_FOR_STATE(session, DebugSession::PausedState); | ||
576 | QCOMPARE(session->line(), 23); | 577 | QCOMPARE(session->line(), 22); // line 23: ++i; int j = i; | ||
577 | session->run(); | 578 | session->run(); | ||
578 | WAIT_FOR_STATE(session, DebugSession::PausedState); | 579 | WAIT_FOR_STATE(session, DebugSession::PausedState); | ||
579 | QCOMPARE(session->line(), 24); | 580 | QCOMPARE(session->line(), 24); | ||
580 | session->run(); | 581 | session->run(); | ||
581 | WAIT_FOR_STATE(session, DebugSession::EndedState); | 582 | WAIT_FOR_STATE(session, DebugSession::EndedState); | ||
582 | } | 583 | } | ||
583 | 584 | | |||
584 | void GdbTest::testBreakOnReadBreakpoint() | 585 | void GdbTest::testBreakOnReadBreakpoint() | ||
Show All 26 Lines | 605 | { | |||
611 | 612 | | |||
612 | WAIT_FOR_STATE_AND_IDLE(session, DebugSession::PausedState); | 613 | WAIT_FOR_STATE_AND_IDLE(session, DebugSession::PausedState); | ||
613 | QCOMPARE(session->line(), 24); | 614 | QCOMPARE(session->line(), 24); | ||
614 | 615 | | |||
615 | breakpoints()->addReadWatchpoint(QStringLiteral("i")); | 616 | breakpoints()->addReadWatchpoint(QStringLiteral("i")); | ||
616 | 617 | | |||
617 | session->run(); | 618 | session->run(); | ||
618 | WAIT_FOR_STATE(session, DebugSession::PausedState); | 619 | WAIT_FOR_STATE(session, DebugSession::PausedState); | ||
619 | QCOMPARE(session->line(), 22); | 620 | QCOMPARE(session->line(), 22); // ++i | ||
621 | | ||||
622 | session->run(); | ||||
623 | WAIT_FOR_STATE(session, DebugSession::PausedState); | ||||
624 | QCOMPARE(session->line(), 22); // int j = i | ||||
620 | 625 | | |||
621 | session->run(); | 626 | session->run(); | ||
622 | WAIT_FOR_STATE(session, DebugSession::PausedState); | 627 | WAIT_FOR_STATE(session, DebugSession::PausedState); | ||
623 | QCOMPARE(session->line(), 24); | 628 | QCOMPARE(session->line(), 24); | ||
624 | 629 | | |||
625 | session->run(); | 630 | session->run(); | ||
626 | WAIT_FOR_STATE(session, DebugSession::EndedState); | 631 | WAIT_FOR_STATE(session, DebugSession::EndedState); | ||
627 | } | 632 | } | ||
Show All 9 Lines | 635 | { | |||
637 | 642 | | |||
638 | WAIT_FOR_STATE_AND_IDLE(session, DebugSession::PausedState); | 643 | WAIT_FOR_STATE_AND_IDLE(session, DebugSession::PausedState); | ||
639 | QCOMPARE(session->line(), 24); | 644 | QCOMPARE(session->line(), 24); | ||
640 | 645 | | |||
641 | breakpoints()->addAccessWatchpoint(QStringLiteral("i")); | 646 | breakpoints()->addAccessWatchpoint(QStringLiteral("i")); | ||
642 | 647 | | |||
643 | session->run(); | 648 | session->run(); | ||
644 | WAIT_FOR_STATE(session, DebugSession::PausedState); | 649 | WAIT_FOR_STATE(session, DebugSession::PausedState); | ||
645 | QCOMPARE(session->line(), 22); | 650 | QCOMPARE(session->line(), 22); // line 23: ++i (read) | ||
646 | 651 | | |||
647 | session->run(); | 652 | session->run(); | ||
648 | WAIT_FOR_STATE(session, DebugSession::PausedState); | 653 | WAIT_FOR_STATE(session, DebugSession::PausedState); | ||
649 | QCOMPARE(session->line(), 23); | 654 | QCOMPARE(session->line(), 22); // line 23: ++i (write) | ||
650 | 655 | | |||
656 | session->run(); | ||||
657 | WAIT_FOR_STATE(session, DebugSession::PausedState); | ||||
658 | QCOMPARE(session->line(), 22); // line 23: int j = i (read) | ||||
651 | 659 | | |||
652 | session->run(); | 660 | session->run(); | ||
653 | WAIT_FOR_STATE(session, DebugSession::PausedState); | 661 | WAIT_FOR_STATE(session, DebugSession::PausedState); | ||
654 | QCOMPARE(session->line(), 24); | 662 | QCOMPARE(session->line(), 24); | ||
655 | 663 | | |||
656 | session->run(); | 664 | session->run(); | ||
657 | WAIT_FOR_STATE(session, DebugSession::EndedState); | 665 | WAIT_FOR_STATE(session, DebugSession::EndedState); | ||
658 | } | 666 | } | ||
▲ Show 20 Lines • Show All 221 Lines • ▼ Show 20 Line(s) | 843 | { | |||
880 | COMPARE_DATA(stackModel->index(41, 0, tIdx), "41"); | 888 | COMPARE_DATA(stackModel->index(41, 0, tIdx), "41"); | ||
881 | COMPARE_DATA(stackModel->index(42, 0, tIdx), "42"); | 889 | COMPARE_DATA(stackModel->index(42, 0, tIdx), "42"); | ||
882 | COMPARE_DATA(stackModel->index(119, 0, tIdx), "119"); | 890 | COMPARE_DATA(stackModel->index(119, 0, tIdx), "119"); | ||
883 | COMPARE_DATA(stackModel->index(120, 0, tIdx), "120"); | 891 | COMPARE_DATA(stackModel->index(120, 0, tIdx), "120"); | ||
884 | 892 | | |||
885 | stackModel->fetchMoreFrames(); | 893 | stackModel->fetchMoreFrames(); | ||
886 | QTest::qWait(200); | 894 | QTest::qWait(200); | ||
887 | QCOMPARE(stackModel->fetchFramesCalled, 4); | 895 | QCOMPARE(stackModel->fetchFramesCalled, 4); | ||
888 | QCOMPARE(stackModel->rowCount(tIdx), 301); | 896 | QCOMPARE(stackModel->rowCount(tIdx), 299); | ||
889 | COMPARE_DATA(stackModel->index(120, 0, tIdx), "120"); | 897 | COMPARE_DATA(stackModel->index(120, 0, tIdx), "120"); | ||
890 | COMPARE_DATA(stackModel->index(121, 0, tIdx), "121"); | 898 | COMPARE_DATA(stackModel->index(121, 0, tIdx), "121"); | ||
891 | COMPARE_DATA(stackModel->index(122, 0, tIdx), "122"); | 899 | COMPARE_DATA(stackModel->index(122, 0, tIdx), "122"); | ||
892 | COMPARE_DATA(stackModel->index(300, 0, tIdx), "300"); | 900 | COMPARE_DATA(stackModel->index(298, 0, tIdx), "298"); | ||
893 | COMPARE_DATA(stackModel->index(300, 1, tIdx), "main"); | 901 | COMPARE_DATA(stackModel->index(298, 1, tIdx), "main"); | ||
894 | COMPARE_DATA(stackModel->index(300, 2, tIdx), fileName+":30"); | 902 | COMPARE_DATA(stackModel->index(298, 2, tIdx), fileName+":30"); | ||
895 | 903 | | |||
896 | stackModel->fetchMoreFrames(); //nothing to fetch, we are at the end | 904 | stackModel->fetchMoreFrames(); //nothing to fetch, we are at the end | ||
897 | QTest::qWait(200); | 905 | QTest::qWait(200); | ||
898 | QCOMPARE(stackModel->fetchFramesCalled, 4); | 906 | QCOMPARE(stackModel->fetchFramesCalled, 4); | ||
899 | QCOMPARE(stackModel->rowCount(tIdx), 301); | 907 | QCOMPARE(stackModel->rowCount(tIdx), 299); | ||
900 | 908 | | |||
901 | session->run(); | 909 | session->run(); | ||
902 | WAIT_FOR_STATE(session, DebugSession::EndedState); | 910 | WAIT_FOR_STATE(session, DebugSession::EndedState); | ||
903 | } | 911 | } | ||
904 | 912 | | |||
905 | void GdbTest::testStackDeactivateAndActive() | 913 | void GdbTest::testStackDeactivateAndActive() | ||
906 | { | 914 | { | ||
907 | TestDebugSession *session = new TestDebugSession; | 915 | TestDebugSession *session = new TestDebugSession; | ||
▲ Show 20 Lines • Show All 92 Lines • ▼ Show 20 Line(s) | 1003 | { | |||
1000 | KProcess debugeeProcess; | 1008 | KProcess debugeeProcess; | ||
1001 | debugeeProcess << QStringLiteral("nice") << findExecutable(QStringLiteral("debuggee_debugeeslow")).toLocalFile(); | 1009 | debugeeProcess << QStringLiteral("nice") << findExecutable(QStringLiteral("debuggee_debugeeslow")).toLocalFile(); | ||
1002 | debugeeProcess.start(); | 1010 | debugeeProcess.start(); | ||
1003 | QVERIFY(debugeeProcess.waitForStarted()); | 1011 | QVERIFY(debugeeProcess.waitForStarted()); | ||
1004 | 1012 | | |||
1005 | TestDebugSession *session = new TestDebugSession; | 1013 | TestDebugSession *session = new TestDebugSession; | ||
1006 | 1014 | | |||
1007 | TestLaunchConfiguration cfg; | 1015 | TestLaunchConfiguration cfg; | ||
1008 | cfg.config().writeEntry(Config::RemoteGdbRunEntry, QUrl::fromLocalFile(findSourceFile(QStringLiteral("gdb_script_empty")))); | 1016 | cfg.config().writeEntry(Config::RemoteGdbRunEntry, | ||
1017 | QUrl::fromLocalFile(findFile(GDB_SRC_DIR, | ||||
1018 | QStringLiteral("unittests/gdb_script_empty")))); | ||||
1009 | QVERIFY(session->startDebugging(&cfg, m_iface)); | 1019 | QVERIFY(session->startDebugging(&cfg, m_iface)); | ||
1010 | 1020 | | |||
1011 | session->addCommand(MI::NonMI, QStringLiteral("attach %0").arg(debugeeProcess.pid())); | 1021 | session->addCommand(MI::NonMI, QStringLiteral("attach %0").arg(debugeeProcess.pid())); | ||
1012 | WAIT_FOR_STATE(session, DebugSession::PausedState); | 1022 | WAIT_FOR_STATE(session, DebugSession::PausedState); | ||
1013 | 1023 | | |||
1014 | session->run(); | 1024 | session->run(); | ||
1015 | QTest::qWait(2000); // give the slow inferior some extra time to run | 1025 | QTest::qWait(2000); // give the slow inferior some extra time to run | ||
1016 | WAIT_FOR_STATE(session, DebugSession::EndedState); | 1026 | WAIT_FOR_STATE(session, DebugSession::EndedState); | ||
1017 | } | 1027 | } | ||
1018 | 1028 | | |||
1019 | void GdbTest::testCoreFile() | 1029 | void GdbTest::testCoreFile() | ||
1020 | { | 1030 | { | ||
1021 | QFileInfo f(QStringLiteral("core")); | 1031 | QFileInfo f(QStringLiteral("core")); | ||
1022 | if (f.exists()) QFile::remove(f.canonicalFilePath()); | 1032 | f.setCaching(false); // don't cache information | ||
1033 | if (f.exists()) { | ||||
1034 | QVERIFY(QFile::remove(f.canonicalFilePath())); | ||||
1035 | } | ||||
1023 | 1036 | | |||
1024 | KProcess debugeeProcess; | 1037 | KProcess debugeeProcess; | ||
1025 | debugeeProcess.setOutputChannelMode(KProcess::MergedChannels); | 1038 | debugeeProcess.setOutputChannelMode(KProcess::MergedChannels); | ||
1026 | debugeeProcess << QStringLiteral("bash") << QStringLiteral("-c") | 1039 | debugeeProcess << QStringLiteral("bash") << QStringLiteral("-c") | ||
1027 | << "ulimit -c unlimited; " | 1040 | << "ulimit -c unlimited; " | ||
1028 | + findExecutable(QStringLiteral("debuggee_crash")).toLocalFile(); | 1041 | + findExecutable(QStringLiteral("debuggee_crash")).toLocalFile(); | ||
1029 | debugeeProcess.start(); | 1042 | debugeeProcess.start(); | ||
1030 | debugeeProcess.waitForFinished(); | 1043 | debugeeProcess.waitForFinished(); | ||
1031 | qDebug() << debugeeProcess.readAll(); | 1044 | qDebug() << debugeeProcess.readAll(); | ||
1032 | 1045 | | |||
1033 | bool coreFileFound = f.exists(); | 1046 | bool coreFileFound = f.exists(); | ||
1034 | if (!coreFileFound) { | 1047 | if (!coreFileFound) { | ||
1035 | // Try to use coredumpctl | 1048 | // Try to use coredumpctl | ||
1036 | auto coredumpctl = QStandardPaths::findExecutable(QStringLiteral("coredumpctl")); | 1049 | auto coredumpctl = QStandardPaths::findExecutable(QStringLiteral("coredumpctl")); | ||
1037 | if (!coredumpctl.isEmpty()) { | 1050 | if (!coredumpctl.isEmpty()) { | ||
1038 | KProcess::execute(coredumpctl, {"-1", "-o", f.canonicalFilePath(), "dump", "debugeecrash"}); | 1051 | KProcess::execute(coredumpctl, {"-1", "-o", f.absoluteFilePath(), "dump", "debuggee_crash"}); | ||
1039 | coreFileFound = f.exists(); | 1052 | coreFileFound = f.exists(); | ||
1040 | } | 1053 | } | ||
1041 | } | 1054 | } | ||
1042 | if (!coreFileFound) | 1055 | if (!coreFileFound) | ||
1043 | QSKIP("no core dump found, check your system configuration (see /proc/sys/kernel/core_pattern).", SkipSingle); | 1056 | QSKIP("no core dump found, check your system configuration (see /proc/sys/kernel/core_pattern).", SkipSingle); | ||
1044 | 1057 | | |||
1045 | TestDebugSession *session = new TestDebugSession; | 1058 | TestDebugSession *session = new TestDebugSession; | ||
1046 | session->examineCoreFile(findExecutable(QStringLiteral("debuggee_crash")), | 1059 | session->examineCoreFile(findExecutable(QStringLiteral("debuggee_crash")), | ||
Show All 28 Lines | 1082 | { | |||
1075 | breakpoints()->addCodeBreakpoint(QUrl::fromLocalFile(debugeeFileName), 22); | 1088 | breakpoints()->addCodeBreakpoint(QUrl::fromLocalFile(debugeeFileName), 22); | ||
1076 | QVERIFY(session->startDebugging(&cfg, m_iface)); | 1089 | QVERIFY(session->startDebugging(&cfg, m_iface)); | ||
1077 | WAIT_FOR_STATE(session, DebugSession::PausedState); | 1090 | WAIT_FOR_STATE(session, DebugSession::PausedState); | ||
1078 | QTest::qWait(1000); | 1091 | QTest::qWait(1000); | ||
1079 | 1092 | | |||
1080 | QCOMPARE(variableCollection()->rowCount(), 2); | 1093 | QCOMPARE(variableCollection()->rowCount(), 2); | ||
1081 | QModelIndex i = variableCollection()->index(1, 0); | 1094 | QModelIndex i = variableCollection()->index(1, 0); | ||
1082 | COMPARE_DATA(i, "Locals"); | 1095 | COMPARE_DATA(i, "Locals"); | ||
1083 | QCOMPARE(variableCollection()->rowCount(i), 1); | 1096 | QCOMPARE(variableCollection()->rowCount(i), 2); | ||
1084 | COMPARE_DATA(variableCollection()->index(0, 0, i), "i"); | 1097 | COMPARE_DATA(variableCollection()->index(0, 0, i), "i"); | ||
1085 | COMPARE_DATA(variableCollection()->index(0, 1, i), "0"); | 1098 | COMPARE_DATA(variableCollection()->index(0, 1, i), "0"); | ||
1099 | COMPARE_DATA(variableCollection()->index(1, 0, i), "j"); | ||||
1100 | // COMPARE_DATA(variableCollection()->index(1, 1, i), "1"); // j is not initialized yet | ||||
1086 | session->run(); | 1101 | session->run(); | ||
1087 | QTest::qWait(1000); | 1102 | QTest::qWait(1000); | ||
1088 | WAIT_FOR_STATE(session, DebugSession::PausedState); | 1103 | WAIT_FOR_STATE(session, DebugSession::PausedState); | ||
1089 | COMPARE_DATA(variableCollection()->index(0, 0, i), "i"); | 1104 | COMPARE_DATA(variableCollection()->index(0, 0, i), "i"); | ||
1090 | COMPARE_DATA(variableCollection()->index(0, 1, i), "1"); | 1105 | COMPARE_DATA(variableCollection()->index(0, 1, i), "1"); | ||
1106 | COMPARE_DATA(variableCollection()->index(1, 0, i), "j"); | ||||
1107 | COMPARE_DATA(variableCollection()->index(1, 1, i), "1"); | ||||
1091 | session->run(); | 1108 | session->run(); | ||
1092 | WAIT_FOR_STATE(session, DebugSession::EndedState); | 1109 | WAIT_FOR_STATE(session, DebugSession::EndedState); | ||
1093 | } | 1110 | } | ||
1094 | 1111 | | |||
1095 | void GdbTest::testVariablesLocalsStruct() | 1112 | void GdbTest::testVariablesLocalsStruct() | ||
1096 | { | 1113 | { | ||
1097 | TestDebugSession *session = new TestDebugSession; | 1114 | TestDebugSession *session = new TestDebugSession; | ||
1098 | session->variableController()->setAutoUpdate(KDevelop::IVariableController::UpdateLocals); | 1115 | session->variableController()->setAutoUpdate(KDevelop::IVariableController::UpdateLocals); | ||
▲ Show 20 Lines • Show All 234 Lines • ▼ Show 20 Line(s) | 1344 | { | |||
1333 | 1350 | | |||
1334 | breakpoints()->addCodeBreakpoint(QUrl::fromLocalFile(debugeeFileName), 24); | 1351 | breakpoints()->addCodeBreakpoint(QUrl::fromLocalFile(debugeeFileName), 24); | ||
1335 | QVERIFY(session->startDebugging(&cfg, m_iface)); | 1352 | QVERIFY(session->startDebugging(&cfg, m_iface)); | ||
1336 | WAIT_FOR_STATE(session, DebugSession::PausedState); | 1353 | WAIT_FOR_STATE(session, DebugSession::PausedState); | ||
1337 | QTest::qWait(500); | 1354 | QTest::qWait(500); | ||
1338 | 1355 | | |||
1339 | QModelIndex i = variableCollection()->index(1, 0); | 1356 | QModelIndex i = variableCollection()->index(1, 0); | ||
1340 | COMPARE_DATA(i, "Locals"); | 1357 | COMPARE_DATA(i, "Locals"); | ||
1341 | QCOMPARE(variableCollection()->rowCount(i), 1); | 1358 | QCOMPARE(variableCollection()->rowCount(i), 2); | ||
1342 | COMPARE_DATA(variableCollection()->index(0, 0, i), "i"); | 1359 | COMPARE_DATA(variableCollection()->index(0, 0, i), "i"); | ||
1343 | COMPARE_DATA(variableCollection()->index(0, 1, i), "1"); | 1360 | COMPARE_DATA(variableCollection()->index(0, 1, i), "1"); | ||
1361 | COMPARE_DATA(variableCollection()->index(1, 0, i), "j"); | ||||
1344 | 1362 | | |||
1345 | stackModel->setCurrentFrame(1); | 1363 | stackModel->setCurrentFrame(1); | ||
1346 | QTest::qWait(200); | 1364 | QTest::qWait(200); | ||
1347 | 1365 | | |||
1348 | i = variableCollection()->index(1, 0); | 1366 | i = variableCollection()->index(1, 0); | ||
1349 | QCOMPARE(variableCollection()->rowCount(i), 4); | 1367 | QCOMPARE(variableCollection()->rowCount(i), 4); | ||
1350 | COMPARE_DATA(variableCollection()->index(2, 0, i), "argc"); | 1368 | COMPARE_DATA(variableCollection()->index(2, 0, i), "argc"); | ||
1351 | COMPARE_DATA(variableCollection()->index(2, 1, i), "1"); | 1369 | COMPARE_DATA(variableCollection()->index(2, 1, i), "1"); | ||
Show All 14 Lines | 1378 | { | |||
1366 | 1384 | | |||
1367 | breakpoints()->addCodeBreakpoint(QUrl::fromLocalFile(debugeeFileName), 24); | 1385 | breakpoints()->addCodeBreakpoint(QUrl::fromLocalFile(debugeeFileName), 24); | ||
1368 | QVERIFY(session->startDebugging(&cfg, m_iface)); | 1386 | QVERIFY(session->startDebugging(&cfg, m_iface)); | ||
1369 | WAIT_FOR_STATE(session, DebugSession::PausedState); | 1387 | WAIT_FOR_STATE(session, DebugSession::PausedState); | ||
1370 | QTest::qWait(500); | 1388 | QTest::qWait(500); | ||
1371 | 1389 | | |||
1372 | QModelIndex i = variableCollection()->index(1, 0); | 1390 | QModelIndex i = variableCollection()->index(1, 0); | ||
1373 | COMPARE_DATA(i, "Locals"); | 1391 | COMPARE_DATA(i, "Locals"); | ||
1374 | QCOMPARE(variableCollection()->rowCount(i), 1); | 1392 | QCOMPARE(variableCollection()->rowCount(i), 2); | ||
1375 | COMPARE_DATA(variableCollection()->index(0, 0, i), "i"); | 1393 | COMPARE_DATA(variableCollection()->index(0, 0, i), "i"); | ||
1376 | COMPARE_DATA(variableCollection()->index(0, 1, i), "1"); | 1394 | COMPARE_DATA(variableCollection()->index(0, 1, i), "1"); | ||
1395 | COMPARE_DATA(variableCollection()->index(1, 0, i), "j"); | ||||
1377 | 1396 | | |||
1378 | stackModel->setCurrentFrame(1); | 1397 | stackModel->setCurrentFrame(1); | ||
1379 | QTest::qWait(300); | 1398 | QTest::qWait(300); | ||
1380 | stackModel->setCurrentFrame(0); | 1399 | stackModel->setCurrentFrame(0); | ||
1381 | QTest::qWait(1); | 1400 | QTest::qWait(1); | ||
1382 | stackModel->setCurrentFrame(1); | 1401 | stackModel->setCurrentFrame(1); | ||
1383 | QTest::qWait(1); | 1402 | QTest::qWait(1); | ||
1384 | stackModel->setCurrentFrame(0); | 1403 | stackModel->setCurrentFrame(0); | ||
▲ Show 20 Lines • Show All 701 Lines • Show Last 20 Lines |