| 235 | } |
| 236 | |
| 237 | bool MIDebugSession::startDebugging(ILaunchConfiguration* cfg, IExecutePlugin* iexec) |
| 238 | { |
| 239 | Q_ASSERT(cfg); |
| 240 | Q_ASSERT(iexec); |
| 241 | |
| 242 | // ExecutePlugin prints a descriptive warning when it detects an error. Do not show |
| 243 | // errorString in the UI, because this overload is called only from unit tests. |
| 244 | QString errorString; |
| 245 | |
| 246 | auto executablePath = iexec->executable(cfg, errorString).toLocalFile(); |
| 247 | if (!errorString.isEmpty()) { |
| 248 | return false; |
| 249 | } |
| 250 | if (!QFileInfo{executablePath}.isExecutable()) { |
| 251 | qCWarning(DEBUGGERCOMMON) << executablePath << "is not an executable"; |
| 252 | return false; |
| 253 | } |
| 254 | |
| 255 | auto arguments = iexec->arguments(cfg, errorString); |
| 256 | if (!errorString.isEmpty()) { |
| 257 | return false; |
| 258 | } |
| 259 | |
| 260 | QStringList terminal; |
| 261 | if (iexec->useTerminal(cfg)) { |
| 262 | terminal = iexec->terminal(cfg, errorString); |
| 263 | if (!errorString.isEmpty()) { |
| 264 | return false; |
| 265 | } |
| 266 | } |
| 267 | |
| 268 | return startDebugging({iexec, cfg, std::move(executablePath), std::move(arguments), std::move(terminal)}); |
| 269 | } |
| 270 | |
| 271 | bool MIDebugSession::startDebugging(const InferiorStartupInfo& startupInfo) |
| 272 | { |