forked from qt-creator/qt-creator
Debugger: remove platform ifdefs in terminal adapter
The code still assumes host == target in some places... Change-Id: Ief495df6ff5fbff890fc46d42a6b29eee3a1ed2c Reviewed-by: Eike Ziller <eike.ziller@digia.com> Reviewed-by: Robert Loehning <robert.loehning@digia.com>
This commit is contained in:
@@ -71,9 +71,8 @@ public:
|
||||
void killProcess();
|
||||
void killStub();
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
qint64 applicationMainThreadID() const;
|
||||
#else
|
||||
#ifndef Q_OS_WIN
|
||||
void detachStub();
|
||||
#endif
|
||||
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
#include "qtcprocess.h"
|
||||
|
||||
#include <utils/hostosinfo.h>
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <QCoreApplication>
|
||||
#include <QTimer>
|
||||
@@ -64,6 +65,12 @@ ConsoleProcess::ConsoleProcess(QObject *parent) :
|
||||
d->m_process.setProcessChannelMode(QProcess::ForwardedChannels);
|
||||
}
|
||||
|
||||
qint64 ConsoleProcess::applicationMainThreadID() const
|
||||
{
|
||||
QTC_CHECK(false);
|
||||
return -1;
|
||||
}
|
||||
|
||||
void ConsoleProcess::setSettings(QSettings *settings)
|
||||
{
|
||||
d->m_settings = settings;
|
||||
|
||||
@@ -41,6 +41,8 @@
|
||||
|
||||
#include <QMessageBox>
|
||||
|
||||
using namespace Utils;
|
||||
|
||||
namespace Debugger {
|
||||
namespace Internal {
|
||||
|
||||
@@ -120,12 +122,11 @@ void GdbTermEngine::setupInferior()
|
||||
{
|
||||
QTC_ASSERT(state() == InferiorSetupRequested, qDebug() << state());
|
||||
const qint64 attachedPID = m_stubProc.applicationPID();
|
||||
#ifdef Q_OS_WIN
|
||||
const qint64 attachedMainThreadID = m_stubProc.applicationMainThreadID();
|
||||
showMessage(QString::fromLatin1("Attaching to %1 (%2)").arg(attachedPID).arg(attachedMainThreadID), LogMisc);
|
||||
#else
|
||||
showMessage(QString::fromLatin1("Attaching to %1").arg(attachedPID), LogMisc);
|
||||
#endif
|
||||
const QString msg = (attachedMainThreadID != -1)
|
||||
? QString::fromLatin1("Attaching to %1 (%2)").arg(attachedPID).arg(attachedMainThreadID)
|
||||
: QString::fromLatin1("Attaching to %1").arg(attachedPID);
|
||||
showMessage(msg, LogMisc);
|
||||
notifyInferiorPid(attachedPID);
|
||||
postCommand("attach " + QByteArray::number(attachedPID),
|
||||
CB(handleStubAttached));
|
||||
@@ -143,11 +144,7 @@ void GdbTermEngine::handleStubAttached(const GdbResponse &response)
|
||||
} else {
|
||||
QString errorMessage;
|
||||
// Resume thread that was suspended by console stub process (see stub code).
|
||||
#ifdef Q_OS_WIN
|
||||
const qint64 mainThreadId = m_stubProc.applicationMainThreadID();
|
||||
#else
|
||||
const qint64 mainThreadId = -1;
|
||||
#endif
|
||||
if (winResumeThread(mainThreadId, &errorMessage)) {
|
||||
showMessage(QString::fromLatin1("Inferior attached, thread %1 resumed").
|
||||
arg(mainThreadId), LogMisc);
|
||||
|
||||
Reference in New Issue
Block a user