Commit 242ad7e5 authored by hjk's avatar hjk

Debugger: Remove avoidable platform dependent compilation

Less chance for compile fix ping pong.

Change-Id: I2b055d1a12ba848f86d5246592ed7bb6d06fff51
Reviewed-by: Nicolas Arnaud-Cormos's avatarNicolas Arnaud-Cormos <nicolas@kdab.com>
Reviewed-by: default avatarDavid Schulz <david.schulz@digia.com>
parent 8098c085
......@@ -736,13 +736,15 @@ void QtcProcess::terminate()
QProcess::terminate();
}
#ifdef Q_OS_WIN
void QtcProcess::interrupt()
{
#ifdef Q_OS_WIN
QTC_ASSERT(m_useCtrlCStub, return);
EnumWindows(sendInterruptMessageToAllWindowsOfProcess_enumWnd, pid()->dwProcessId);
#endif
}
#ifdef Q_OS_WIN
// This function assumes that the resulting string will be quoted.
// That's irrelevant if it does not contain quotes itself.
static int quoteArgInternal(QString &ret, int bslashes)
......
......@@ -45,22 +45,16 @@ public:
QtcProcess(QObject *parent = 0)
: QProcess(parent),
m_haveEnv(false)
#ifdef Q_OS_WIN
, m_useCtrlCStub(false)
#endif
{}
void setEnvironment(const Environment &env)
{ m_environment = env; m_haveEnv = true; }
void setCommand(const QString &command, const QString &arguments)
{ m_command = command; m_arguments = arguments; }
#ifdef Q_OS_WIN
void setUseCtrlCStub(bool enabled) { m_useCtrlCStub = enabled; }
#endif
void start();
void terminate();
#ifdef Q_OS_WIN
void interrupt();
#endif
enum SplitError {
SplitOk = 0, //! All went just fine
......@@ -150,9 +144,7 @@ private:
QString m_arguments;
Environment m_environment;
bool m_haveEnv;
#ifdef Q_OS_WIN
bool m_useCtrlCStub;
#endif
};
// Converts the Q_PID into a integer value. This is a no-op
......
......@@ -84,7 +84,6 @@ bool GdbProcess::interrupt()
return interruptProcess(pid, GdbEngineType, &m_errorString);
}
#ifdef Q_OS_WIN
void GdbProcess::setUseCtrlCStub(bool enable)
{
m_gdbProc.setUseCtrlCStub(enable);
......@@ -94,7 +93,6 @@ void GdbProcess::winInterruptByCtrlC()
{
m_gdbProc.interrupt();
}
#endif
QProcess::ProcessState GdbProcess::state() const
{
......
......@@ -50,10 +50,8 @@ public:
qint64 write(const QByteArray &data);
void kill();
bool interrupt();
#ifdef Q_OS_WIN
void setUseCtrlCStub(bool enable);
void winInterruptByCtrlC();
#endif
QProcess::ProcessState state() const;
QString errorString() const;
......
......@@ -435,10 +435,8 @@ void GdbRemoteServerEngine::interruptInferior2()
if (debuggerCore()->boolSetting(TargetAsync)) {
postCommand("-exec-interrupt", GdbEngine::Immediate,
CB(handleInterruptInferior));
#ifdef Q_OS_WIN
} else if (m_isQnxGdb) {
} else if (m_isQnxGdb && Utils::HostOsInfo::isWindowsHost()) {
m_gdbProc->winInterruptByCtrlC();
#endif
} else {
bool ok = m_gdbProc->interrupt();
if (!ok) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment