Fix gdbserver connecttion

Remove extra `:` character from empty scheme.
Is needed to fix gdb target remote string from `tcp::<ip>:<port>` to
`tcp:<ip>:<port>`.

Fix baremetal channelString

Change-Id: I169a93599419ee54c182973c2a1f734390f4a035
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
BogDan Vatra
2025-04-17 17:51:01 +03:00
committed by BogDan Vatra
parent 6da6aede61
commit 108dbb4dd3
2 changed files with 4 additions and 5 deletions

View File

@@ -73,6 +73,7 @@ void IDebugServerProvider::setChannel(const QUrl &channel)
void IDebugServerProvider::setChannel(const QString &host, int port) void IDebugServerProvider::setChannel(const QString &host, int port)
{ {
m_channel.setScheme("tcp");
m_channel.setHost(host); m_channel.setHost(host);
m_channel.setPort(port); m_channel.setPort(port);
} }
@@ -84,10 +85,7 @@ QUrl IDebugServerProvider::channel() const
QString IDebugServerProvider::channelString() const QString IDebugServerProvider::channelString() const
{ {
// Just return as "host:port" form. return m_channel.toString();
if (m_channel.port() <= 0)
return m_channel.host();
return m_channel.host() + ':' + QString::number(m_channel.port());
} }
QString IDebugServerProvider::id() const QString IDebugServerProvider::id() const
@@ -336,6 +334,7 @@ void HostWidget::setChannel(const QUrl &channel)
QUrl HostWidget::channel() const QUrl HostWidget::channel() const
{ {
QUrl url; QUrl url;
url.setScheme("tcp");
url.setHost(m_hostLineEdit->text()); url.setHost(m_hostLineEdit->text());
url.setPort(m_portSpinBox->value()); url.setPort(m_portSpinBox->value());
return url; return url;

View File

@@ -4603,7 +4603,7 @@ static QString extractRemoteChannel(const QUrl &url, const QString &pipe)
QString scheme = url.scheme(); QString scheme = url.scheme();
if (scheme.isEmpty()) if (scheme.isEmpty())
scheme = "tcp:"; scheme = "tcp";
// "Fix" the IPv6 case with host names without '['...']' // "Fix" the IPv6 case with host names without '['...']'
QString host = url.host(); QString host = url.host();