| 109 | } |
| 110 | |
| 111 | void MIDebugJob::start() |
| 112 | { |
| 113 | if (!m_startupInfo) { |
| 114 | Q_ASSERT(error() != NoError); |
| 115 | emitResult(); |
| 116 | return; |
| 117 | } |
| 118 | Q_ASSERT(error() == NoError); |
| 119 | |
| 120 | setStandardToolView(IOutputView::DebugView); |
| 121 | setBehaviours(IOutputView::Behaviours(IOutputView::AllowUserClose) | KDevelop::IOutputView::AutoScroll); |
| 122 | |
| 123 | auto model = new KDevelop::OutputModel; |
| 124 | model->setFilteringStrategy(OutputModel::NativeAppErrorFilter); |
| 125 | setModel(model); |
| 126 | |
| 127 | connect(m_session, &MIDebugSession::inferiorStdoutLines, model, &OutputModel::appendLines); |
| 128 | connect(m_session, &MIDebugSession::inferiorStderrLines, model, &OutputModel::appendLines); |
| 129 | |
| 130 | setTitle(m_startupInfo->launchConfiguration->name()); |
| 131 | |
| 132 | const auto grp = m_startupInfo->launchConfiguration->config(); |
| 133 | QString startWith = grp.readEntry(Config::StartWithEntry, QStringLiteral("ApplicationOutput")); |
| 134 | if (startWith == QLatin1String("ApplicationOutput")) { |
| 135 | setVerbosity(Verbose); |
| 136 | } else { |
| 137 | setVerbosity(Silent); |
| 138 | } |
| 139 | |
| 140 | startOutput(); |
| 141 | |
| 142 | // An output view for this job was just added to the Debug tool view. Raise the |
| 143 | // Debug tool view in the end to show the output of the debuggee in the Code area. |
| 144 | m_session->setToolViewToRaiseAtEnd(IDebugSession::ToolView::Debug); |
| 145 | |
| 146 | if (!m_session->startDebugging(std::move(*m_startupInfo))) { |
| 147 | done(); |
| 148 | } |
| 149 | m_startupInfo.reset(); // no more use for the info, so release the memory |
| 150 | } |
| 151 | |
| 152 | void MIDebugJob::initializeStartupInfo(IExecutePlugin* execute, ILaunchConfiguration* launchConfiguration) |
| 153 | { |
no test coverage detected