Commit 385237db authored by Ulf Hermann's avatar Ulf Hermann

Use Utils::Port where possible

This solves the ambiguity between 0 and -1 being the "invalid" port.

Change-Id: I3bac11dd4117bb1820fbd58186699925b73df1c5
Reviewed-by: default avatarhjk <hjk@theqtcompany.com>
parent e1423865
......@@ -25,6 +25,7 @@
#pragma once
#include <utils/port.h>
#include <QString>
namespace QmlDebug {
......@@ -63,11 +64,13 @@ static inline QString qmlDebugCommandLineArguments(QmlDebugServicesPreset servic
.arg(QLatin1String(block ? ",block" : "")).arg(qmlDebugServices(services));
}
static inline QString qmlDebugTcpArguments(QmlDebugServicesPreset services, quint16 port = 0,
static inline QString qmlDebugTcpArguments(QmlDebugServicesPreset services,
Utils::Port port = Utils::Port(),
bool block = true)
{
return qmlDebugCommandLineArguments(services, port ? QString::fromLatin1("port:%1").arg(port) :
QStringLiteral("port:%qml_port%"), block);
return qmlDebugCommandLineArguments(services, port.isValid() ?
QString::fromLatin1("port:%1").arg(port.number()) :
QStringLiteral("port:%qml_port%"), block);
}
static inline QString qmlDebugNativeArguments(QmlDebugServicesPreset services, bool block = true)
......
......@@ -84,7 +84,7 @@ void QmlOutputParser::processOutput(const QString &output)
bool canConvert;
quint16 port = waitingTcp.cap(1).toUShort(&canConvert);
if (canConvert)
emit waitingForConnectionOnPort(port);
emit waitingForConnectionOnPort(Utils::Port(port));
continue;
}
} else if (status.startsWith(unableToListen)) {
......
......@@ -27,6 +27,7 @@
#include "qmldebug_global.h"
#include <utils/port.h>
#include <QObject>
namespace QmlDebug {
......@@ -41,7 +42,7 @@ public:
void processOutput(const QString &output);
signals:
void waitingForConnectionOnPort(quint16 port);
void waitingForConnectionOnPort(Utils::Port port);
void connectionEstablishedMessage();
void connectingToSocketMessage();
void errorMessage(const QString &detailedError);
......
......@@ -26,6 +26,7 @@
#pragma once
#include "utils_global.h"
#include "qtcassert.h"
namespace Utils {
......@@ -34,12 +35,28 @@ class QTCREATOR_UTILS_EXPORT Port
public:
Port() : m_port(-1) {}
explicit Port(quint16 port) : m_port(port) {}
explicit Port(int port) :
m_port((port < 0 || port > std::numeric_limits<quint16>::max()) ? -1 : port)
{
}
quint16 number() const { return quint16(m_port); }
explicit Port(uint port) :
m_port(port > std::numeric_limits<quint16>::max() ? -1 : port)
{
}
quint16 number() const { QTC_ASSERT(isValid(), return 0); return quint16(m_port); }
bool isValid() const { return m_port != -1; }
private:
int m_port;
};
inline bool operator<(const Port &p1, const Port &p2) { return p1.number() < p2.number(); }
inline bool operator<=(const Port &p1, const Port &p2) { return p1.number() <= p2.number(); }
inline bool operator>(const Port &p1, const Port &p2) { return p1.number() > p2.number(); }
inline bool operator>=(const Port &p1, const Port &p2) { return p1.number() >= p2.number(); }
inline bool operator==(const Port &p1, const Port &p2) { return p1.number() == p2.number(); }
inline bool operator!=(const Port &p1, const Port &p2) { return p1.number() != p2.number(); }
} // Utils
......@@ -35,7 +35,7 @@ namespace Utils {
namespace Internal {
namespace {
typedef QPair<int, int> Range;
typedef QPair<Port, Port> Range;
class PortsSpecParser
{
......@@ -82,19 +82,19 @@ private:
void parseElem()
{
const int startPort = parsePort();
const Port startPort = parsePort();
if (atEnd() || nextChar() != '-') {
m_portList.addPort(startPort);
return;
}
++m_pos;
const int endPort = parsePort();
const Port endPort = parsePort();
if (endPort < startPort)
throw ParseException("Invalid range (end < start).");
m_portList.addRange(startPort, endPort);
}
int parsePort()
Port parsePort()
{
if (atEnd())
throw ParseException("Empty port string.");
......@@ -108,7 +108,7 @@ private:
} while (!atEnd());
if (port == 0 || port >= 2 << 16)
throw ParseException("Invalid port value.");
return port;
return Port(port);
}
bool atEnd() const { return m_pos == m_portsSpec.length(); }
......@@ -153,16 +153,16 @@ PortList PortList::fromString(const QString &portsSpec)
return Internal::PortsSpecParser(portsSpec).parse();
}
void PortList::addPort(int port) { addRange(port, port); }
void PortList::addPort(Port port) { addRange(port, port); }
void PortList::addRange(int startPort, int endPort)
void PortList::addRange(Port startPort, Port endPort)
{
d->ranges << Internal::Range(startPort, endPort);
}
bool PortList::hasMore() const { return !d->ranges.isEmpty(); }
bool PortList::contains(int port) const
bool PortList::contains(Port port) const
{
foreach (const Internal::Range &r, d->ranges) {
if (port >= r.first && port <= r.second)
......@@ -175,16 +175,17 @@ int PortList::count() const
{
int n = 0;
foreach (const Internal::Range &r, d->ranges)
n += r.second - r.first + 1;
n += r.second.number() - r.first.number() + 1;
return n;
}
int PortList::getNext()
Port PortList::getNext()
{
Q_ASSERT(!d->ranges.isEmpty());
Internal::Range &firstRange = d->ranges.first();
const int next = firstRange.first++;
const Port next = firstRange.first;
firstRange.first = Port(firstRange.first.number() + 1);
if (firstRange.first > firstRange.second)
d->ranges.removeFirst();
return next;
......@@ -194,9 +195,9 @@ QString PortList::toString() const
{
QString stringRep;
foreach (const Internal::Range &range, d->ranges) {
stringRep += QString::number(range.first);
stringRep += QString::number(range.first.number());
if (range.second != range.first)
stringRep += QLatin1Char('-') + QString::number(range.second);
stringRep += QLatin1Char('-') + QString::number(range.second.number());
stringRep += QLatin1Char(',');
}
if (!stringRep.isEmpty())
......
......@@ -26,6 +26,7 @@
#pragma once
#include "utils_global.h"
#include "port.h"
QT_FORWARD_DECLARE_CLASS(QString)
......@@ -40,12 +41,12 @@ public:
PortList &operator=(const PortList &other);
~PortList();
void addPort(int port);
void addRange(int startPort, int endPort);
void addPort(Port port);
void addRange(Port startPort, Port endPort);
bool hasMore() const;
bool contains(int port) const;
bool contains(Port port) const;
int count() const;
int getNext();
Port getNext();
QString toString() const;
static PortList fromString(const QString &portsSpec);
......
......@@ -79,12 +79,12 @@ AndroidAnalyzeSupport::AndroidAnalyzeSupport(AndroidRunConfiguration *runConfig,
[runner]() { runner->start(); });
connect(&m_outputParser, &QmlDebug::QmlOutputParser::waitingForConnectionOnPort,
[this, runControl](quint16) {
[this, runControl](Utils::Port) {
runControl->notifyRemoteSetupDone(m_qmlPort);
});
connect(runner, &AndroidRunner::remoteProcessStarted,
[this](int, int qmlPort) {
[this](Utils::Port, Utils::Port qmlPort) {
m_qmlPort = qmlPort;
});
......
......@@ -49,7 +49,7 @@ public:
private:
QmlDebug::QmlOutputParser m_outputParser;
int m_qmlPort;
Utils::Port m_qmlPort;
};
} // namespace Internal
......
......@@ -171,7 +171,7 @@ AndroidDebugSupport::AndroidDebugSupport(AndroidRunConfiguration *runConfig,
});
}
void AndroidDebugSupport::handleRemoteProcessStarted(int gdbServerPort, int qmlPort)
void AndroidDebugSupport::handleRemoteProcessStarted(Utils::Port gdbServerPort, Utils::Port qmlPort)
{
disconnect(m_runner, &AndroidRunner::remoteProcessStarted,
this, &AndroidDebugSupport::handleRemoteProcessStarted);
......
......@@ -49,7 +49,7 @@ public:
QString *errorMessage);
private:
void handleRemoteProcessStarted(int gdbServerPort, int qmlPort);
void handleRemoteProcessStarted(Utils::Port gdbServerPort, Utils::Port qmlPort);
Debugger::DebuggerRunControl *m_runControl;
AndroidRunner * const m_runner;
......
......@@ -137,16 +137,16 @@ AndroidRunner::AndroidRunner(QObject *parent,
m_qmlDebugServices = QmlDebug::NoQmlDebugServices;
QString channel = runConfig->remoteChannel();
QTC_CHECK(channel.startsWith(QLatin1Char(':')));
m_localGdbServerPort = channel.mid(1).toUShort();
QTC_CHECK(m_localGdbServerPort);
m_localGdbServerPort = Utils::Port(channel.mid(1).toUShort());
QTC_CHECK(m_localGdbServerPort.isValid());
if (m_qmlDebugServices != QmlDebug::NoQmlDebugServices) {
QTcpServer server;
QTC_ASSERT(server.listen(QHostAddress::LocalHost)
|| server.listen(QHostAddress::LocalHostIPv6),
qDebug() << tr("No free ports available on host for QML debugging."));
m_qmlPort = server.serverPort();
m_qmlPort = Utils::Port(server.serverPort());
} else {
m_qmlPort = 0;
m_qmlPort = Utils::Port();
}
ProjectExplorer::Target *target = runConfig->target();
m_androidRunnable.intentName = AndroidManager::intentName(target);
......@@ -276,18 +276,18 @@ void AndroidRunner::checkPID()
if (m_useCppDebugger) {
// This will be funneled to the engine to actually start and attach
// gdb. Afterwards this ends up in handleRemoteDebuggerRunning() below.
QByteArray serverChannel = ':' + QByteArray::number(m_localGdbServerPort);
QByteArray serverChannel = ':' + QByteArray::number(m_localGdbServerPort.number());
emit remoteServerRunning(serverChannel, m_processPID);
} else if (m_qmlDebugServices == QmlDebug::QmlDebuggerServices) {
// This will be funneled to the engine to actually start and attach
// gdb. Afterwards this ends up in handleRemoteDebuggerRunning() below.
QByteArray serverChannel = QByteArray::number(m_qmlPort);
QByteArray serverChannel = QByteArray::number(m_qmlPort.number());
emit remoteServerRunning(serverChannel, m_processPID);
} else if (m_qmlDebugServices == QmlDebug::QmlProfilerServices) {
emit remoteProcessStarted(-1, m_qmlPort);
emit remoteProcessStarted(Utils::Port(), m_qmlPort);
} else {
// Start without debugging.
emit remoteProcessStarted(-1, -1);
emit remoteProcessStarted(Utils::Port(), Utils::Port());
}
m_wasStarted = true;
logcatReadStandardOutput();
......@@ -348,7 +348,7 @@ void AndroidRunner::asyncStart()
if (m_useCppDebugger) {
QProcess adb;
adb.start(m_adb, selector() << _("forward")
<< QString::fromLatin1("tcp:%1").arg(m_localGdbServerPort)
<< QString::fromLatin1("tcp:%1").arg(m_localGdbServerPort.number())
<< _("localfilesystem:") + m_gdbserverSocket);
if (!adb.waitForStarted()) {
emit remoteProcessFinished(tr("Failed to forward C++ debugging ports. Reason: %1.").arg(adb.errorString()));
......@@ -390,7 +390,7 @@ void AndroidRunner::asyncStart()
if (m_qmlDebugServices != QmlDebug::NoQmlDebugServices) {
// currently forward to same port on device and host
const QString port = QString::fromLatin1("tcp:%1").arg(m_qmlPort);
const QString port = QString::fromLatin1("tcp:%1").arg(m_qmlPort.number());
QProcess adb;
adb.start(m_adb, selector() << _("forward") << port << port);
if (!adb.waitForStarted()) {
......@@ -405,7 +405,7 @@ void AndroidRunner::asyncStart()
args << _("-e") << _("qml_debug") << _("true")
<< _("-e") << _("qmljsdebugger")
<< QString::fromLatin1("port:%1,block,services:%2")
.arg(m_qmlPort).arg(QmlDebug::qmlDebugServices(m_qmlDebugServices));
.arg(m_qmlPort.number()).arg(QmlDebug::qmlDebugServices(m_qmlDebugServices));
}
QProcess adb;
......
......@@ -68,7 +68,7 @@ public slots:
signals:
void remoteServerRunning(const QByteArray &serverChannel, int pid);
void remoteProcessStarted(int gdbServerPort, int qmlPort);
void remoteProcessStarted(Utils::Port gdbServerPort, Utils::Port qmlPort);
void remoteProcessFinished(const QString &errString = QString());
void remoteOutput(const QString &output);
......@@ -101,8 +101,8 @@ private:
qint64 m_processPID;
bool m_useCppDebugger;
QmlDebug::QmlDebugServicesPreset m_qmlDebugServices;
ushort m_localGdbServerPort; // Local end of forwarded debug socket.
quint16 m_qmlPort;
Utils::Port m_localGdbServerPort; // Local end of forwarded debug socket.
Utils::Port m_qmlPort;
QString m_pingFile;
QString m_pongFile;
QString m_gdbserverPath;
......
......@@ -31,6 +31,7 @@
#include <projectexplorer/runconfiguration.h>
#include <utils/outputformat.h>
#include <utils/port.h>
namespace Debugger {
......@@ -51,7 +52,7 @@ public:
virtual void pause() {}
virtual void unpause() {}
virtual void notifyRemoteSetupDone(quint16) {}
virtual void notifyRemoteSetupDone(Utils::Port) {}
virtual void notifyRemoteFinished() {}
signals:
......
......@@ -29,6 +29,7 @@
#include <projectexplorer/runnables.h>
#include <ssh/sshconnection.h>
#include <utils/port.h>
#include <QMetaType>
......@@ -40,7 +41,7 @@ public:
QSsh::SshConnectionParameters connParams;
QString analyzerHost;
QString analyzerSocket;
quint16 analyzerPort = 0;
Utils::Port analyzerPort;
};
DEBUGGER_EXPORT bool operator==(const AnalyzerConnection &c1, const AnalyzerConnection &c2);
......
......@@ -896,26 +896,27 @@ void DebuggerEngine::notifyEngineRemoteSetupFinished(const RemoteSetupResult &re
if (result.success) {
showMessage(_("NOTE: REMOTE SETUP DONE: GDB SERVER PORT: %1 QML PORT %2")
.arg(result.gdbServerPort).arg(result.qmlServerPort));
.arg(result.gdbServerPort.number()).arg(result.qmlServerPort.number()));
if (d->remoteSetupState() != RemoteSetupCancelled)
d->setRemoteSetupState(RemoteSetupSucceeded);
if (result.gdbServerPort != InvalidPid) {
if (result.gdbServerPort.isValid()) {
QString &rc = d->m_runParameters.remoteChannel;
const int sepIndex = rc.lastIndexOf(QLatin1Char(':'));
if (sepIndex != -1) {
rc.replace(sepIndex + 1, rc.count() - sepIndex - 1,
QString::number(result.gdbServerPort));
QString::number(result.gdbServerPort.number()));
}
} else if (result.inferiorPid != InvalidPid && runParameters().startMode == AttachExternal) {
// e.g. iOS Simulator
runParameters().attachPID = result.inferiorPid;
}
if (result.qmlServerPort != InvalidPort) {
if (result.qmlServerPort.isValid()) {
d->m_runParameters.qmlServerPort = result.qmlServerPort;
d->m_runParameters.inferior.commandLineArguments.replace(_("%qml_port%"), QString::number(result.qmlServerPort));
d->m_runParameters.inferior.commandLineArguments.replace(
_("%qml_port%"), QString::number(result.qmlServerPort.number()));
}
} else {
......
......@@ -2112,8 +2112,10 @@ void DebuggerPluginPrivate::attachToQmlPort()
const QVariant qmlServerPort = configValue("LastQmlServerPort");
if (qmlServerPort.isValid())
dlg.setPort(qmlServerPort.toInt());
else if (rp.qmlServerPort.isValid())
dlg.setPort(rp.qmlServerPort.number());
else
dlg.setPort(rp.qmlServerPort);
dlg.setPort(-1);
const Id kitId = Id::fromSetting(configValue("LastProfile"));
if (kitId.isValid())
......@@ -2132,7 +2134,7 @@ void DebuggerPluginPrivate::attachToQmlPort()
rp.connParams = device->sshParameters();
rp.qmlServerAddress = device->qmlProfilerHost();
}
rp.qmlServerPort = dlg.port();
rp.qmlServerPort = Utils::Port(dlg.port());
rp.startMode = AttachToRemoteProcess;
rp.closeMode = KillAtClose;
rp.languages = QmlLanguage;
......@@ -2863,7 +2865,7 @@ static QString formatStartParameters(DebuggerRunParameters &sp)
}
if (!sp.qmlServerAddress.isEmpty())
str << "QML server: " << sp.qmlServerAddress << ':'
<< sp.qmlServerPort << '\n';
<< (sp.qmlServerPort.isValid() ? sp.qmlServerPort.number() : -1) << '\n';
if (!sp.remoteChannel.isEmpty())
str << "Remote: " << sp.remoteChannel << '\n';
str << "Sysroot: " << sp.sysRoot << '\n';
......
......@@ -440,7 +440,7 @@ static DebuggerRunControl *doCreate(DebuggerRunParameters rp, RunConfiguration *
return 0;
}
rp.qmlServerAddress = server.serverAddress().toString();
rp.qmlServerPort = server.serverPort();
rp.qmlServerPort = Utils::Port(server.serverPort());
// Makes sure that all bindings go through the JavaScript engine, so that
// breakpoints are actually hit!
......
......@@ -30,6 +30,7 @@
#include <ssh/sshconnection.h>
#include <utils/environment.h>
#include <utils/port.h>
#include <projectexplorer/abi.h>
#include <projectexplorer/runconfiguration.h>
#include <projectexplorer/runnables.h>
......@@ -44,14 +45,13 @@ namespace Debugger {
// Note: This is part of the "soft interface" of the debugger plugin.
// Do not add anything that needs implementation in a .cpp file.
const int InvalidPort = -1;
const qint64 InvalidPid = -1;
class DEBUGGER_EXPORT RemoteSetupResult
{
public:
int gdbServerPort = InvalidPort;
int qmlServerPort = InvalidPort;
Utils::Port gdbServerPort;
Utils::Port qmlServerPort;
qint64 inferiorPid = InvalidPid;
bool success = false;
QString reason;
......@@ -73,7 +73,7 @@ public:
// Used by Qml debugging.
QString qmlServerAddress;
int qmlServerPort = InvalidPort;
Utils::Port qmlServerPort;
// Used by general remote debugging.
QString remoteChannel;
......
......@@ -108,8 +108,8 @@ void GdbServerStarter::run()
void GdbServerStarter::portListReady()
{
PortList ports = d->device->freePorts();
const int port = d->gatherer.getNextFreePort(&ports);
if (port == -1) {
const Port port = d->gatherer.getNextFreePort(&ports);
if (!port.isValid()) {
QTC_ASSERT(false, /**/);
emit logMessage(tr("Process aborted"));
return;
......@@ -130,7 +130,7 @@ void GdbServerStarter::portListReady()
if (gdbServerPath.isEmpty())
gdbServerPath = "gdbserver";
QByteArray cmd = gdbServerPath + " --attach :"
+ QByteArray::number(port) + ' ' + QByteArray::number(d->process.pid);
+ QByteArray::number(port.number()) + ' ' + QByteArray::number(d->process.pid);
logMessage(tr("Running command: %1").arg(QString::fromLatin1(cmd)));
d->runner.run(cmd, d->device->sshParameters());
}
......
......@@ -347,7 +347,7 @@ void QmlEngine::connectionEstablished()
notifyEngineRunAndInferiorRunOk();
}
void QmlEngine::tryToConnect(quint16 port)
void QmlEngine::tryToConnect(Utils::Port port)
{
showMessage(QLatin1String("QML Debugger: No application output received in time, trying to connect ..."), LogStatus);
d->retryOnConnectFail = true;
......@@ -366,7 +366,7 @@ void QmlEngine::tryToConnect(quint16 port)
}
}
void QmlEngine::beginConnection(quint16 port)
void QmlEngine::beginConnection(Utils::Port port)
{
d->noDebugOutputTimer.stop();
......@@ -391,13 +391,13 @@ void QmlEngine::beginConnection(quint16 port)
* the connection will be closed again (instead of returning the "connection refused"
* error that we expect).
*/
if (runParameters().qmlServerPort > 0)
if (runParameters().qmlServerPort.isValid())
port = runParameters().qmlServerPort;
if (!d->connection || d->connection->isConnected())
return;
d->connection->connectToHost(host, port);
d->connection->connectToHost(host, port.number());
//A timeout to check the connection state
d->connectionTimer.start();
......@@ -563,7 +563,7 @@ void QmlEngine::notifyEngineRemoteSetupFinished(const RemoteSetupResult &result)
DebuggerEngine::notifyEngineRemoteSetupFinished(result);
if (result.success) {
if (result.qmlServerPort != InvalidPort)
if (result.qmlServerPort.isValid())
runParameters().qmlServerPort = result.qmlServerPort;
notifyEngineSetupOk();
......@@ -587,7 +587,7 @@ void QmlEngine::notifyEngineRemoteServerRunning(const QByteArray &serverChannel,
bool ok = false;
quint16 qmlPort = serverChannel.toUInt(&ok);
if (ok)
runParameters().qmlServerPort = qmlPort;
runParameters().qmlServerPort = Utils::Port(qmlPort);
else
qWarning() << tr("QML debugging port not set: Unable to convert %1 to unsigned int.").arg(QString::fromLatin1(serverChannel));
......
......@@ -60,8 +60,8 @@ private slots:
void errorMessageBoxFinished(int result);
void updateCurrentContext();
void tryToConnect(quint16 port = 0);
void beginConnection(quint16 port = 0);
void tryToConnect(Utils::Port port = Utils::Port());
void beginConnection(Utils::Port port = Utils::Port());
void connectionEstablished();
void connectionStartupFailed();
void appStartupFailed(const QString &errorMessage);
......
......@@ -97,13 +97,13 @@ void IosAnalyzeSupport::qmlServerReady()
m_runControl->notifyRemoteSetupDone(m_qmlPort);
}
void IosAnalyzeSupport::handleServerPorts(int gdbServerPort, int qmlPort)
void IosAnalyzeSupport::handleServerPorts(Utils::Port gdbServerPort, Utils::Port qmlPort)
{
Q_UNUSED(gdbServerPort);
m_qmlPort = qmlPort;
}
void IosAnalyzeSupport::handleGotInferiorPid(qint64 pid, int qmlPort)
void IosAnalyzeSupport::handleGotInferiorPid(qint64 pid, Utils::Port qmlPort)
{
Q_UNUSED(pid);
m_qmlPort = qmlPort;
......
......@@ -28,6 +28,7 @@
#include "iosrunconfiguration.h"
#include <qmldebug/qmloutputparser.h>
#include <utils/port.h>
#include <QProcess>
#include <QObject>
......@@ -51,8 +52,8 @@ public:
private:
void qmlServerReady();
void handleServerPorts(int gdbServerFd, int qmlPort);
void handleGotInferiorPid(qint64 pid, int qmlPort);
void handleServerPorts(Utils::Port gdbServerPort, Utils::Port qmlPort);
void handleGotInferiorPid(qint64 pid, Utils::Port qmlPort);
void handleRemoteProcessFinished(bool cleanEnd);
void handleRemoteOutput(const QString &output);
......@@ -61,7 +62,7 @@ private:
Debugger::AnalyzerRunControl *m_runControl;
IosRunner * const m_runner;
QmlDebug::QmlOutputParser m_outputParser;
int m_qmlPort;
Utils::Port m_qmlPort;
};
} // namespace Internal
......
......@@ -181,18 +181,19 @@ IosDebugSupport::~IosDebugSupport()
{
}
void IosDebugSupport::handleServerPorts(int gdbServerPort, int qmlPort)
void IosDebugSupport::handleServerPorts(Utils::Port gdbServerPort, Utils::Port qmlPort)
{
RemoteSetupResult result;
result.gdbServerPort = gdbServerPort;
result.qmlServerPort = qmlPort;
result.success = gdbServerPort > 0 || (m_runner && !m_runner->cppDebug() && qmlPort > 0);
result.success = gdbServerPort.isValid()
|| (m_runner && !m_runner->cppDebug() && qmlPort.isValid());
if (!result.success)
result.reason = tr("Could not get debug server file descriptor.");
m_runControl->notifyEngineRemoteSetupFinished(result);
}
void IosDebugSupport::handleGotInferiorPid(qint64 pid, int qmlPort)
void IosDebugSupport::handleGotInferiorPid(qint64 pid, Utils::Port qmlPort)
{
RemoteSetupResult result;
result.qmlServerPort = qmlPort;
......
......@@ -50,8 +50,8 @@ public:
~IosDebugSupport();
private:
void handleServerPorts(int gdbServerFd, int qmlPort);
void handleGotInferiorPid(qint64, int qmlPort);
void handleServerPorts(Utils::Port gdbServerPort, Utils::Port qmlPort);
void handleGotInferiorPid(qint64, Utils::Port qmlPort);
void handleRemoteProcessFinished(bool cleanEnd);
void handleRemoteOutput(const QString &output);
......
......@@ -88,8 +88,8 @@ IosDevice::IosDevice()
setDisplayName(IosDevice::name());
setDeviceState(DeviceDisconnected);
Utils::PortList ports;
ports.addRange(Constants::IOS_DEVICE_PORT_START,
Constants::IOS_DEVICE_PORT_END);
ports.addRange(Utils::Port(Constants::IOS_DEVICE_PORT_START),
Utils::Port(Constants::IOS_DEVICE_PORT_END));
setFreePorts(ports);
}
......@@ -200,12 +200,12 @@ QString IosDevice::osVersion() const
return m_extraInfo.value(QLatin1String("osVersion"));
}
quint16 IosDevice::nextPort() const
Utils::Port IosDevice::nextPort() const
{