diff options
Diffstat (limited to 'src/plugins/debugger/gdb/remotegdbserveradapter.cpp')
-rw-r--r-- | src/plugins/debugger/gdb/remotegdbserveradapter.cpp | 43 |
1 files changed, 26 insertions, 17 deletions
diff --git a/src/plugins/debugger/gdb/remotegdbserveradapter.cpp b/src/plugins/debugger/gdb/remotegdbserveradapter.cpp index 9cd71bd3a9..174fbb9069 100644 --- a/src/plugins/debugger/gdb/remotegdbserveradapter.cpp +++ b/src/plugins/debugger/gdb/remotegdbserveradapter.cpp @@ -233,9 +233,16 @@ void RemoteGdbServerAdapter::handleFileExecAndSymbols(const GdbResponse &respons if (response.resultClass == GdbResultDone) { callTargetRemote(); } else { + QByteArray reason = response.data.findChild("msg").data(); QString msg = tr("Reading debug information failed:\n"); - msg += QString::fromLocal8Bit(response.data.findChild("msg").data()); - m_engine->notifyInferiorSetupFailed(msg); + msg += QString::fromLocal8Bit(reason); + if (reason.endsWith("No such file or directory.")) { + showMessage(_("INFERIOR STARTUP: BINARY NOT FOUND")); + showMessage(msg, StatusBar); + callTargetRemote(); // Proceed nevertheless. + } else { + m_engine->notifyInferiorSetupFailed(msg); + } } } @@ -247,14 +254,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) @@ -355,14 +372,6 @@ void RemoteGdbServerAdapter::handleInterruptInferior(const GdbResponse &response } } -void RemoteGdbServerAdapter::shutdownInferior() -{ - if (m_engine->startParameters().startMode == AttachToRemoteServer) - m_engine->defaultInferiorShutdown("detach"); - else - m_engine->defaultInferiorShutdown("kill"); -} - void RemoteGdbServerAdapter::shutdownAdapter() { m_engine->notifyAdapterShutdownOk(); |