Commit 54a114e6 authored by Volker Vogelhuber's avatar Volker Vogelhuber Committed by hjk
Browse files

fixed memcheck using valgrind on remote device



Change-Id: Ie2ded39c73dce99db574b16cb8e0e1ffb7ba2415
Reviewed-by: default avatarhjk <hjk121@nokiamail.com>
parent f6e2cfc2
......@@ -105,18 +105,77 @@ bool MemcheckRunner::start()
}
if (startMode() == Analyzer::StartRemote) {
ip = connectionParameters().host;
QList<QHostAddress> possibleHostAddresses;
//NOTE: ::allAddresses does not seem to work for usb interfaces...
foreach (const QNetworkInterface &iface, QNetworkInterface::allInterfaces()) {
foreach (const QNetworkAddressEntry &entry, iface.addressEntries()) {
const QHostAddress addr = entry.ip();
if (addr.toString() != QLatin1String("127.0.0.1")
&& addr.toString() != QLatin1String("0:0:0:0:0:0:0:1"))
{
possibleHostAddresses << addr;
break;
}
}
}
if (possibleHostAddresses.isEmpty()) {
emit processErrorReceived(tr("No network interface found for remote analysis."),
QProcess::FailedToStart);
return false;
} else if (possibleHostAddresses.size() > 1) {
QDialog dlg;
dlg.setWindowTitle(tr("Select Network Interface"));
QVBoxLayout *layout = new QVBoxLayout;
QLabel *description = new QLabel;
description->setWordWrap(true);
description->setText(tr("More than one network interface was found on your machine. Please select which one you want to use for remote analysis."));
layout->addWidget(description);
QListWidget *list = new QListWidget;
foreach (const QHostAddress &address, possibleHostAddresses)
list->addItem(address.toString());
list->setSelectionMode(QAbstractItemView::SingleSelection);
list->setCurrentRow(0);
layout->addWidget(list);
QDialogButtonBox *buttons = new QDialogButtonBox;
buttons->addButton(QDialogButtonBox::Ok);
buttons->addButton(QDialogButtonBox::Cancel);
connect(buttons, SIGNAL(accepted()),
&dlg, SLOT(accept()));
connect(buttons, SIGNAL(rejected()),
&dlg, SLOT(reject()));
layout->addWidget(buttons);
dlg.setLayout(layout);
if (dlg.exec() != QDialog::Accepted) {
emit processErrorReceived(tr("No Network Interface was chosen for remote analysis"), QProcess::FailedToStart);
return false;
}
QTC_ASSERT(list->currentRow() >= 0, return false);
QTC_ASSERT(list->currentRow() < possibleHostAddresses.size(), return false);
hostAddr = possibleHostAddresses.at(list->currentRow());
} else {
hostAddr = possibleHostAddresses.first();
}
ip = hostAddr.toString();
QTC_ASSERT(!ip.isEmpty(), return false);
hostAddr = QHostAddress(ip);
}
bool check = d->xmlServer.listen(hostAddr);
if (!check) emit processErrorReceived( tr("XmlServer on %1: ").arg(ip) + d->xmlServer.errorString(), QProcess::FailedToStart );
QTC_ASSERT(check, return false);
d->xmlServer.setMaxPendingConnections(1);
const quint16 xmlPortNumber = d->xmlServer.serverPort();
connect(&d->xmlServer, SIGNAL(newConnection()), SLOT(xmlSocketConnected()));
check = d->logServer.listen(hostAddr);
if (!check) emit processErrorReceived( tr("LogServer on %1: ").arg(ip) + d->logServer.errorString(), QProcess::FailedToStart );
QTC_ASSERT(check, return false);
d->logServer.setMaxPendingConnections(1);
const quint16 logPortNumber = d->logServer.serverPort();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment