forked from qt-creator/qt-creator
ProjectExplorer: Always compile WinDebugInterface
Makes it easier to re-shuffle calling code on non-Windows. Change-Id: Ia6d7e313e9eb42fc7b19a469c1a6f33d226d1e88 Reviewed-by: David Schulz <david.schulz@qt.io> Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
@@ -180,6 +180,7 @@ add_qtc_plugin(ProjectExplorer
|
|||||||
userfileaccessor.cpp userfileaccessor.h
|
userfileaccessor.cpp userfileaccessor.h
|
||||||
vcsannotatetaskhandler.cpp vcsannotatetaskhandler.h
|
vcsannotatetaskhandler.cpp vcsannotatetaskhandler.h
|
||||||
waitforstopdialog.cpp waitforstopdialog.h
|
waitforstopdialog.cpp waitforstopdialog.h
|
||||||
|
windebuginterface.cpp windebuginterface.h
|
||||||
xcodebuildparser.cpp xcodebuildparser.h
|
xcodebuildparser.cpp xcodebuildparser.h
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -197,7 +198,6 @@ extend_qtc_plugin(ProjectExplorer
|
|||||||
|
|
||||||
extend_qtc_plugin(ProjectExplorer
|
extend_qtc_plugin(ProjectExplorer
|
||||||
CONDITION WIN32
|
CONDITION WIN32
|
||||||
SOURCES windebuginterface.cpp windebuginterface.h
|
|
||||||
DEFINES UNICODE _UNICODE
|
DEFINES UNICODE _UNICODE
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -24,10 +24,12 @@
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include "applicationlauncher.h"
|
#include "applicationlauncher.h"
|
||||||
#ifdef Q_OS_WIN
|
|
||||||
|
#include "devicesupport/desktopdevice.h"
|
||||||
|
#include "projectexplorer.h"
|
||||||
|
#include "projectexplorersettings.h"
|
||||||
|
#include "runcontrol.h"
|
||||||
#include "windebuginterface.h"
|
#include "windebuginterface.h"
|
||||||
#include <qt_windows.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
|
|
||||||
@@ -36,11 +38,6 @@
|
|||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
#include <utils/qtcprocess.h>
|
#include <utils/qtcprocess.h>
|
||||||
|
|
||||||
#include "devicesupport/desktopdevice.h"
|
|
||||||
#include "projectexplorer.h"
|
|
||||||
#include "projectexplorersettings.h"
|
|
||||||
#include "runcontrol.h"
|
|
||||||
|
|
||||||
#include <QTextCodec>
|
#include <QTextCodec>
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
|
|
||||||
@@ -83,8 +80,6 @@ public:
|
|||||||
void handleDone();
|
void handleDone();
|
||||||
|
|
||||||
// Local
|
// Local
|
||||||
void cannotRetrieveLocalDebugOutput();
|
|
||||||
void checkLocalDebugOutput(qint64 pid, const QString &message);
|
|
||||||
qint64 applicationPID() const;
|
qint64 applicationPID() const;
|
||||||
bool isRunning() const;
|
bool isRunning() const;
|
||||||
|
|
||||||
@@ -131,12 +126,20 @@ ApplicationLauncherPrivate::ApplicationLauncherPrivate(ApplicationLauncher *pare
|
|||||||
connect(&m_process, &QtcProcess::readyReadStandardOutput,
|
connect(&m_process, &QtcProcess::readyReadStandardOutput,
|
||||||
this, &ApplicationLauncherPrivate::handleStandardOutput);
|
this, &ApplicationLauncherPrivate::handleStandardOutput);
|
||||||
|
|
||||||
#ifdef Q_OS_WIN
|
if (WinDebugInterface::instance()) {
|
||||||
connect(WinDebugInterface::instance(), &WinDebugInterface::cannotRetrieveDebugOutput,
|
connect(WinDebugInterface::instance(), &WinDebugInterface::cannotRetrieveDebugOutput,
|
||||||
this, &ApplicationLauncherPrivate::cannotRetrieveLocalDebugOutput);
|
this, [this] {
|
||||||
connect(WinDebugInterface::instance(), &WinDebugInterface::debugOutput,
|
disconnect(WinDebugInterface::instance(), nullptr, this, nullptr);
|
||||||
this, &ApplicationLauncherPrivate::checkLocalDebugOutput);
|
emit q->appendMessage(ApplicationLauncher::tr("Cannot retrieve debugging output.")
|
||||||
#endif
|
+ QLatin1Char('\n'), ErrorMessageFormat);
|
||||||
|
});
|
||||||
|
|
||||||
|
connect(WinDebugInterface::instance(), &WinDebugInterface::debugOutput,
|
||||||
|
this, [this](qint64 pid, const QString &message) {
|
||||||
|
if (applicationPID() == pid)
|
||||||
|
emit q->appendMessage(message, DebugFormat);
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ApplicationLauncher::ApplicationLauncher(QObject *parent) : QObject(parent),
|
ApplicationLauncher::ApplicationLauncher(QObject *parent) : QObject(parent),
|
||||||
@@ -282,21 +285,6 @@ void ApplicationLauncherPrivate::handleStandardError()
|
|||||||
emit q->appendMessage(msg, StdErrFormat, false);
|
emit q->appendMessage(msg, StdErrFormat, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ApplicationLauncherPrivate::cannotRetrieveLocalDebugOutput()
|
|
||||||
{
|
|
||||||
#ifdef Q_OS_WIN
|
|
||||||
disconnect(WinDebugInterface::instance(), nullptr, this, nullptr);
|
|
||||||
emit q->appendMessage(ApplicationLauncher::tr("Cannot retrieve debugging output.")
|
|
||||||
+ QLatin1Char('\n'), ErrorMessageFormat);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
void ApplicationLauncherPrivate::checkLocalDebugOutput(qint64 pid, const QString &message)
|
|
||||||
{
|
|
||||||
if (applicationPID() == pid)
|
|
||||||
emit q->appendMessage(message, DebugFormat);
|
|
||||||
}
|
|
||||||
|
|
||||||
int ApplicationLauncher::exitCode() const
|
int ApplicationLauncher::exitCode() const
|
||||||
{
|
{
|
||||||
return d->m_resultData.m_exitCode;
|
return d->m_resultData.m_exitCode;
|
||||||
@@ -335,10 +323,8 @@ void ApplicationLauncherPrivate::start()
|
|||||||
m_process.setEnvironment(env);
|
m_process.setEnvironment(env);
|
||||||
|
|
||||||
m_processRunning = true;
|
m_processRunning = true;
|
||||||
#ifdef Q_OS_WIN
|
|
||||||
if (!WinDebugInterface::instance()->isRunning())
|
WinDebugInterface::startIfNeeded();
|
||||||
WinDebugInterface::instance()->start(); // Try to start listener again...
|
|
||||||
#endif
|
|
||||||
|
|
||||||
CommandLine cmdLine = m_runnable.command;
|
CommandLine cmdLine = m_runnable.command;
|
||||||
|
|
||||||
|
|||||||
@@ -794,14 +794,12 @@ void AppOutputPane::slotRunControlFinished2(RunControl *sender)
|
|||||||
|
|
||||||
ProjectExplorerPlugin::updateRunActions();
|
ProjectExplorerPlugin::updateRunActions();
|
||||||
|
|
||||||
#ifdef Q_OS_WIN
|
|
||||||
const bool isRunning = Utils::anyOf(m_runControlTabs, [](const RunControlTab &rt) {
|
const bool isRunning = Utils::anyOf(m_runControlTabs, [](const RunControlTab &rt) {
|
||||||
return rt.runControl && rt.runControl->isRunning();
|
return rt.runControl && rt.runControl->isRunning();
|
||||||
});
|
});
|
||||||
if (!isRunning)
|
|
||||||
WinDebugInterface::instance()->stop();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
if (!isRunning)
|
||||||
|
WinDebugInterface::stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool AppOutputPane::canNext() const
|
bool AppOutputPane::canNext() const
|
||||||
|
|||||||
@@ -159,6 +159,7 @@ Project {
|
|||||||
"userfileaccessor.cpp", "userfileaccessor.h",
|
"userfileaccessor.cpp", "userfileaccessor.h",
|
||||||
"vcsannotatetaskhandler.cpp", "vcsannotatetaskhandler.h",
|
"vcsannotatetaskhandler.cpp", "vcsannotatetaskhandler.h",
|
||||||
"waitforstopdialog.cpp", "waitforstopdialog.h",
|
"waitforstopdialog.cpp", "waitforstopdialog.h",
|
||||||
|
"windebuginterface.cpp", "windebuginterface.h",
|
||||||
"xcodebuildparser.cpp", "xcodebuildparser.h"
|
"xcodebuildparser.cpp", "xcodebuildparser.h"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -242,8 +243,6 @@ Project {
|
|||||||
files: [
|
files: [
|
||||||
"msvctoolchain.cpp",
|
"msvctoolchain.cpp",
|
||||||
"msvctoolchain.h",
|
"msvctoolchain.h",
|
||||||
"windebuginterface.cpp",
|
|
||||||
"windebuginterface.h",
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -56,9 +56,9 @@ WinDebugInterface *WinDebugInterface::instance()
|
|||||||
|
|
||||||
bool WinDebugInterface::stop()
|
bool WinDebugInterface::stop()
|
||||||
{
|
{
|
||||||
if (!m_waitHandles[TerminateEventHandle])
|
if (!m_instance->m_waitHandles[TerminateEventHandle])
|
||||||
return false;
|
return false;
|
||||||
SetEvent(m_waitHandles[TerminateEventHandle]);
|
SetEvent(m_instance->m_waitHandles[TerminateEventHandle]);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -198,6 +198,12 @@ void WinDebugInterface::dispatchDebugOutput()
|
|||||||
emit _q_debugOutputReady();
|
emit _q_debugOutputReady();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void WinDebugInterface::startIfNeeded()
|
||||||
|
{
|
||||||
|
if (!m_instance->isRunning())
|
||||||
|
m_instance->start();
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
} // namespace ProjectExplorer
|
} // namespace ProjectExplorer
|
||||||
|
|
||||||
@@ -222,6 +228,10 @@ void WinDebugInterface::emitReadySignal() { }
|
|||||||
|
|
||||||
void WinDebugInterface::dispatchDebugOutput() { }
|
void WinDebugInterface::dispatchDebugOutput() { }
|
||||||
|
|
||||||
|
bool WinDebugInterface::stop() { return false; }
|
||||||
|
|
||||||
|
void WinDebugInterface::startIfNeeded() { }
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
} // namespace ProjectExplorer
|
} // namespace ProjectExplorer
|
||||||
|
|
||||||
|
|||||||
@@ -45,7 +45,8 @@ public:
|
|||||||
|
|
||||||
static WinDebugInterface *instance();
|
static WinDebugInterface *instance();
|
||||||
|
|
||||||
bool stop();
|
static bool stop();
|
||||||
|
static void startIfNeeded();
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void debugOutput(qint64 pid, const QString &message);
|
void debugOutput(qint64 pid, const QString &message);
|
||||||
|
|||||||
Reference in New Issue
Block a user