forked from qt-creator/qt-creator
debugger: simpler handling of the ipv6 case
Change-Id: If1d5bdd5afd2aeebfcf39e72045ef4327cb84c0c Reviewed-by: Fawzi Mohamed <fawzi.mohamed@nokia.com>
This commit is contained in:
@@ -247,14 +247,24 @@ void RemoteGdbServerAdapter::callTargetRemote()
|
||||
// (1) connects to the gdb server
|
||||
// (2) starts the remote application
|
||||
// (3) stops the remote application (early, e.g. in the dynamic linker)
|
||||
QString channel = startParameters().remoteChannel;
|
||||
if (m_engine->m_isQnxGdb) {
|
||||
m_engine->postCommand("target qnx " + channel.toLatin1(),
|
||||
CB(handleTargetQnx));
|
||||
} else {
|
||||
m_engine->postCommand("target remote " + channel.toLatin1(),
|
||||
CB(handleTargetRemote));
|
||||
QByteArray channel = startParameters().remoteChannel.toLatin1();
|
||||
|
||||
// Don't touch channels with explicitly set protocols.
|
||||
if (!channel.startsWith("tcp:") && !channel.startsWith("udp:")
|
||||
&& !channel.startsWith("file:") && channel.contains(':'))
|
||||
{
|
||||
// "Fix" the IPv6 case with host names without '['...']'
|
||||
if (!channel.startsWith('[') && channel.count(':') >= 2) {
|
||||
channel.insert(0, '[');
|
||||
channel.insert(channel.lastIndexOf(':'), ']');
|
||||
}
|
||||
channel = "tcp:" + channel;
|
||||
}
|
||||
|
||||
if (m_engine->m_isQnxGdb)
|
||||
m_engine->postCommand("target qnx " + channel, CB(handleTargetQnx));
|
||||
else
|
||||
m_engine->postCommand("target remote " + channel, CB(handleTargetRemote));
|
||||
}
|
||||
|
||||
void RemoteGdbServerAdapter::handleTargetRemote(const GdbResponse &record)
|
||||
|
||||
@@ -110,10 +110,7 @@ DebuggerStartParameters AbstractRemoteLinuxDebugSupport::startParameters(const R
|
||||
params.startMode = AttachToRemoteServer;
|
||||
params.executable = runConfig->localExecutableFilePath();
|
||||
params.debuggerCommand = runConfig->gdbCmd();
|
||||
QString host = devConf->sshParameters().host;
|
||||
params.remoteChannel = host.contains(QLatin1Char(':'))
|
||||
? QString::fromLatin1("[%1]:-1").arg(host)
|
||||
: host + QLatin1String(":-1");
|
||||
params.remoteChannel = devConf->sshParameters().host + QLatin1String(":-1");
|
||||
|
||||
// TODO: This functionality should be inside the debugger.
|
||||
const ProjectExplorer::Abi &abi = runConfig->target()
|
||||
|
||||
@@ -359,12 +359,7 @@ void StartGdbServerDialog::reportOpenPort(int port)
|
||||
return;
|
||||
|
||||
LinuxDeviceConfiguration::ConstPtr device = d->currentDevice();
|
||||
QString host = device->sshParameters().host;
|
||||
QString channel;
|
||||
if (host.contains(QLatin1Char(':')))
|
||||
channel = QString::fromLatin1("[%1]:%2").arg(host).arg(port);
|
||||
else
|
||||
channel = QString::fromLatin1("%1:%2").arg(host).arg(port);
|
||||
QString channel = QString("%1:%2").arg(device->sshParameters().host).arg(port);
|
||||
logMessage(tr("Server started on %1").arg(channel));
|
||||
|
||||
QMetaObject::invokeMethod(ob, "gdbServerStarted", Qt::QueuedConnection,
|
||||
|
||||
Reference in New Issue
Block a user