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

Method testBreakpointErrors

plugins/debuggercommon/tests/debuggertestbase.cpp:818–868  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

816}
817
818void DebuggerTestBase::testBreakpointErrors()
819{
820 auto* const session = createTestDebugSession();
821 TestLaunchConfiguration cfg;
822
823 // The following breakpoint data makes GDB/MI (but not lldb-mi) report breakpoint errors.
824 // Verify that a debug session works correctly despite such uncommon error reports.
825
826 // clang-format off
827 constexpr std::array expressions = {
828 ":resourcepath",
829 ":resourcepath:1",
830 ":/colonslash:1",
831 ":./colondotslash",
832 };
833 constexpr std::array urls = {
834 "file::resourcepath",
835 "file::/colonslash",
836 "file::../colondotdotslash",
837 };
838 constexpr std::array conditions = {
839 "not_exist_var > 3",
840 };
841 // clang-format on
842
843 for (const auto expression : expressions) {
844 breakpoints()->addCodeBreakpoint(QString::fromUtf8(expression));
845 }
846 for (const auto url : urls) {
847 breakpoints()->addCodeBreakpoint(QUrl{QString::fromUtf8(url)}, 1);
848 }
849 for (const auto condition : conditions) {
850 auto* const breakpoint = addDebugeeBreakpoint(29);
851 breakpoint->setCondition(QString::fromUtf8(condition));
852 }
853
854 addDebugeeBreakpoint(30);
855 ActiveStateSessionSpy sessionSpy(session);
856 START_DEBUGGING_AND_WAIT_FOR_PAUSED_STATE_E(session, cfg, sessionSpy);
857
858 const auto debuggerStopsOnInvalidCondition = isLldb();
859 if (debuggerStopsOnInvalidCondition) {
860 QCOMPARE(currentMiLine(session), 29);
861 CONTINUE_AND_WAIT_FOR_PAUSED_STATE(session, sessionSpy);
862 }
863
864 QCOMPARE(currentMiLine(session), 30);
865 session->run();
866
867 WAIT_FOR_STATE(session, IDebugSession::EndedState);
868}
869
870void DebuggerTestBase::testInsertBreakpointWhileRunning()
871{

Callers

nothing calls this directly

Calls 4

currentMiLineFunction · 0.85
setConditionMethod · 0.80
addCodeBreakpointMethod · 0.45
runMethod · 0.45

Tested by

no test coverage detected