Changeset View
Changeset View
Standalone View
Standalone View
debugjob.cpp
Context not available. | |||||
60 | #include "debugsession.h" | 60 | #include "debugsession.h" | ||
---|---|---|---|---|---|
61 | #include "xdebugplugin.h" | 61 | #include "xdebugplugin.h" | ||
62 | #include "connection.h" | 62 | #include "connection.h" | ||
63 | #include "debuggerdebug.h" | ||||
63 | 64 | | |||
64 | namespace XDebug { | 65 | namespace XDebug { | ||
65 | XDebugJob::XDebugJob(DebugSession* session, KDevelop::ILaunchConfiguration* cfg, QObject* parent) | 66 | XDebugJob::XDebugJob(DebugSession* session, KDevelop::ILaunchConfiguration* cfg, QObject* parent) | ||
Context not available. | |||||
109 | } | 110 | } | ||
110 | 111 | | |||
111 | if (envgrp.isEmpty()) { | 112 | if (envgrp.isEmpty()) { | ||
112 | qWarning() << "Launch Configuration:" << cfg->name() << i18n("No environment group specified, looks like a broken " | 113 | qCWarning(KDEV_PHP_DEBUGGER) << "Launch Configuration:" << cfg->name() << i18n("No environment group specified, looks like a broken " | ||
113 | "configuration, please check run configuration '%1'. " | 114 | "configuration, please check run configuration '%1'. " | ||
114 | "Using default environment group.", cfg->name()); | 115 | "Using default environment group.", cfg->name()); | ||
115 | #if KDEVPLATFORM_VERSION < QT_VERSION_CHECK(5,1,40) | 116 | #if KDEVPLATFORM_VERSION < QT_VERSION_CHECK(5,1,40) | ||
Context not available. | |||||
126 | } | 127 | } | ||
127 | 128 | | |||
128 | if (error() != 0) { | 129 | if (error() != 0) { | ||
129 | qWarning() << "Launch Configuration:" << cfg->name() << "oops, problem" << errorText(); | 130 | qCWarning(KDEV_PHP_DEBUGGER) << "Launch Configuration:" << cfg->name() << "oops, problem" << errorText(); | ||
130 | return; | 131 | return; | ||
131 | } | 132 | } | ||
132 | 133 | | |||
Context not available. | |||||
175 | } | 176 | } | ||
176 | program << "XDEBUG_CONFIG=\"remote_enable=1 \""; | 177 | program << "XDEBUG_CONFIG=\"remote_enable=1 \""; | ||
177 | } | 178 | } | ||
178 | qDebug() << program; | 179 | qCDebug(KDEV_PHP_DEBUGGER) << program; | ||
179 | program << interpreter; | 180 | program << interpreter; | ||
180 | program << "-d xdebug.remote_enable=1"; | 181 | program << "-d xdebug.remote_enable=1"; | ||
181 | QString remoteHostSetting = cfg->config().readEntry("RemoteHost", QString()); | 182 | QString remoteHostSetting = cfg->config().readEntry("RemoteHost", QString()); | ||
Context not available. | |||||
188 | program << script.toLocalFile(); | 189 | program << script.toLocalFile(); | ||
189 | program << arguments; | 190 | program << arguments; | ||
190 | 191 | | |||
191 | qDebug() << "setting app:" << program; | 192 | qCDebug(KDEV_PHP_DEBUGGER) << "setting app:" << program; | ||
192 | 193 | | |||
193 | m_proc->setOutputChannelMode(KProcess::MergedChannels); | 194 | m_proc->setOutputChannelMode(KProcess::MergedChannels); | ||
194 | 195 | | |||
Context not available. | |||||
200 | 201 | | |||
201 | void XDebugJob::start() | 202 | void XDebugJob::start() | ||
202 | { | 203 | { | ||
203 | qDebug() << "launching?" << m_proc; | 204 | qCDebug(KDEV_PHP_DEBUGGER) << "launching?" << m_proc; | ||
204 | if (m_proc) { | 205 | if (m_proc) { | ||
205 | QString err; | 206 | QString err; | ||
206 | if (!m_session->listenForConnection(err)) { | 207 | if (!m_session->listenForConnection(err)) { | ||
207 | qWarning() << "listening for connection failed"; | 208 | qCWarning(KDEV_PHP_DEBUGGER) << "listening for connection failed"; | ||
208 | setError(-1); | 209 | setError(-1); | ||
209 | setErrorText(err); | 210 | setErrorText(err); | ||
210 | emitResult(); | 211 | emitResult(); | ||
Context not available. | |||||
212 | } | 213 | } | ||
213 | 214 | | |||
214 | startOutput(); | 215 | startOutput(); | ||
215 | qDebug() << "starting" << m_proc->program().join(" "); | 216 | qCDebug(KDEV_PHP_DEBUGGER) << "starting" << m_proc->program().join(" "); | ||
216 | appendLine(i18n("Starting: %1", m_proc->program().join(" "))); | 217 | appendLine(i18n("Starting: %1", m_proc->program().join(" "))); | ||
217 | m_proc->start(); | 218 | m_proc->start(); | ||
218 | } else | 219 | } else | ||
219 | { | 220 | { | ||
220 | qWarning() << "No process, something went wrong when creating the job"; | 221 | qCWarning(KDEV_PHP_DEBUGGER) << "No process, something went wrong when creating the job"; | ||
221 | // No process means we've returned early on from the constructor, some bad error happened | 222 | // No process means we've returned early on from the constructor, some bad error happened | ||
222 | emitResult(); | 223 | emitResult(); | ||
223 | } | 224 | } | ||
Context not available. | |||||
230 | 231 | | |||
231 | bool XDebugJob::doKill() | 232 | bool XDebugJob::doKill() | ||
232 | { | 233 | { | ||
233 | qDebug(); | 234 | qCDebug(KDEV_PHP_DEBUGGER); | ||
234 | if (m_session) { | 235 | if (m_session) { | ||
235 | m_session->stopDebugger(); | 236 | m_session->stopDebugger(); | ||
236 | } | 237 | } | ||
Context not available. | |||||
251 | } else { | 252 | } else { | ||
252 | appendLine(i18n("*** Crashed with return code: %1 ***", QString::number(exitCode))); | 253 | appendLine(i18n("*** Crashed with return code: %1 ***", QString::number(exitCode))); | ||
253 | } | 254 | } | ||
254 | qDebug() << "Process done"; | 255 | qCDebug(KDEV_PHP_DEBUGGER) << "Process done"; | ||
255 | emitResult(); | 256 | emitResult(); | ||
256 | 257 | | |||
257 | if (m_session && m_session->connection()) { | 258 | if (m_session && m_session->connection()) { | ||
Context not available. | |||||
268 | setErrorText(errmsg); | 269 | setErrorText(errmsg); | ||
269 | emitResult(); | 270 | emitResult(); | ||
270 | } | 271 | } | ||
271 | qDebug() << "Process error"; | 272 | qCDebug(KDEV_PHP_DEBUGGER) << "Process error"; | ||
272 | 273 | | |||
273 | if (m_session && m_session->connection()) { | 274 | if (m_session && m_session->connection()) { | ||
274 | m_session->connection()->setState(DebugSession::EndedState); | 275 | m_session->connection()->setState(DebugSession::EndedState); | ||
Context not available. | |||||
326 | 327 | | |||
327 | void XDebugBrowserJob::start() | 328 | void XDebugBrowserJob::start() | ||
328 | { | 329 | { | ||
329 | qDebug() << "launching?" << m_url; | 330 | qCDebug(KDEV_PHP_DEBUGGER) << "launching?" << m_url; | ||
330 | if (!m_url.isValid()) { | 331 | if (!m_url.isValid()) { | ||
331 | emitResult(); | 332 | emitResult(); | ||
332 | return; | 333 | return; | ||
Context not available. | |||||
334 | 335 | | |||
335 | QString err; | 336 | QString err; | ||
336 | if (!m_session->listenForConnection(err)) { | 337 | if (!m_session->listenForConnection(err)) { | ||
337 | qWarning() << "listening for connection failed"; | 338 | qCWarning(KDEV_PHP_DEBUGGER) << "listening for connection failed"; | ||
338 | setError(-1); | 339 | setError(-1); | ||
339 | setErrorText(err); | 340 | setErrorText(err); | ||
340 | emitResult(); | 341 | emitResult(); | ||
Context not available. | |||||
345 | url.setQuery("XDEBUG_SESSION_START=kdev"); | 346 | url.setQuery("XDEBUG_SESSION_START=kdev"); | ||
346 | if (m_browser.isEmpty()) { | 347 | if (m_browser.isEmpty()) { | ||
347 | if (!QDesktopServices::openUrl(url)) { | 348 | if (!QDesktopServices::openUrl(url)) { | ||
348 | qWarning() << "openUrl failed, something went wrong when creating the job"; | 349 | qCWarning(KDEV_PHP_DEBUGGER) << "openUrl failed, something went wrong when creating the job"; | ||
349 | emitResult(); | 350 | emitResult(); | ||
350 | } | 351 | } | ||
351 | } else { | 352 | } else { | ||
Context not available. | |||||
363 | 364 | | |||
364 | void XDebugBrowserJob::processFailedToStart() | 365 | void XDebugBrowserJob::processFailedToStart() | ||
365 | { | 366 | { | ||
366 | qWarning() << "Cannot start application" << m_browser; | 367 | qCWarning(KDEV_PHP_DEBUGGER) << "Cannot start application" << m_browser; | ||
367 | setError(-1); | 368 | setError(-1); | ||
368 | QString errmsg = i18n("Could not start program '%1'. Make sure that the " | 369 | QString errmsg = i18n("Could not start program '%1'. Make sure that the " | ||
369 | "path is specified correctly.", m_browser); | 370 | "path is specified correctly.", m_browser); | ||
370 | setErrorText(errmsg); | 371 | setErrorText(errmsg); | ||
371 | emitResult(); | 372 | emitResult(); | ||
372 | qDebug() << "Process error"; | 373 | qCDebug(KDEV_PHP_DEBUGGER) << "Process error"; | ||
373 | 374 | | |||
374 | if (m_session && m_session->connection()) { | 375 | if (m_session && m_session->connection()) { | ||
375 | m_session->connection()->setState(DebugSession::EndedState); | 376 | m_session->connection()->setState(DebugSession::EndedState); | ||
Context not available. | |||||
383 | 384 | | |||
384 | bool XDebugBrowserJob::doKill() | 385 | bool XDebugBrowserJob::doKill() | ||
385 | { | 386 | { | ||
386 | qDebug(); | 387 | qCDebug(KDEV_PHP_DEBUGGER); | ||
387 | m_session->stopDebugger(); | 388 | m_session->stopDebugger(); | ||
388 | QUrl url = m_url; | 389 | QUrl url = m_url; | ||
389 | url.setQuery("XDEBUG_SESSION_STOP_NO_EXEC=kdev"); | 390 | url.setQuery("XDEBUG_SESSION_STOP_NO_EXEC=kdev"); | ||
Context not available. |