Revert "Remote Linux: Rework device testing"

This reverts commit 934c067ddf365c6f12b1e4a1e431f27610b32f7d,
because it breaks running remote Linux applications due to 
buggy refactoring of the remote ports gatherer.

Change-Id: I15fd8d4f3e76452a8c5c735316991bd00900444f
Reviewed-by: Christian Kandeler <christian.kandeler@nokia.com>
This commit is contained in:
Christian Kandeler
2011-12-21 20:14:42 +01:00
parent 3b67e5dd37
commit 79db165dcb
22 changed files with 705 additions and 615 deletions

View File

@@ -103,14 +103,14 @@ public:
QPushButton *closeButton;
PathChooser *sysrootPathChooser;
RemoteLinuxUsedPortsGatherer *gatherer;
RemoteLinuxUsedPortsGatherer gatherer;
SshRemoteProcessRunner runner;
QSettings *settings;
QString remoteCommandLine;
};
StartGdbServerDialogPrivate::StartGdbServerDialogPrivate(StartGdbServerDialog *q)
: q(q), processList(0), gatherer(0), settings(0)
: q(q), processList(0)
{
settings = ICore::instance()->settings();
@@ -179,6 +179,8 @@ StartGdbServerDialog::StartGdbServerDialog(QWidget *parent) :
d->deviceComboBox->setModel(devices);
d->deviceComboBox->setCurrentIndex(d->settings->value(LastDevice).toInt());
connect(&d->gatherer, SIGNAL(error(QString)), SLOT(portGathererError(QString)));
connect(&d->gatherer, SIGNAL(portListReady()), SLOT(portListReady()));
if (devices->rowCount() == 0) {
d->tableView->setEnabled(false);
} else {
@@ -213,15 +215,6 @@ StartGdbServerDialog::~StartGdbServerDialog()
void StartGdbServerDialog::attachToDevice(int index)
{
LinuxDeviceConfigurations *devices = LinuxDeviceConfigurations::instance();
if (d->gatherer)
delete d->gatherer;
d->gatherer = new RemoteLinuxUsedPortsGatherer(devices->deviceAt(index));
connect(d->gatherer, SIGNAL(finished(RemoteLinux::LinuxDeviceTester::TestResult)),
this, SLOT(portListReady(RemoteLinux::LinuxDeviceTester::TestResult)));
connect(d->gatherer, SIGNAL(errorMessage(QString)), SLOT(portGathererError(QString)));
delete d->processList;
d->processList = new GenericRemoteLinuxProcessList(devices->deviceAt(index));
d->proxyModel.setSourceModel(d->processList);
@@ -257,8 +250,6 @@ void StartGdbServerDialog::updateProcessList()
void StartGdbServerDialog::attachToProcess()
{
QTC_ASSERT(d->gatherer, return);
const QModelIndexList &indexes =
d->tableView->selectionModel()->selectedIndexes();
if (indexes.empty())
@@ -267,7 +258,7 @@ void StartGdbServerDialog::attachToProcess()
LinuxDeviceConfiguration::ConstPtr device = d->currentDevice();
PortList ports = device->freePorts();
const int port = d->gatherer->getNextFreePort(&ports);
const int port = d->gatherer.getNextFreePort(&ports);
const int row = d->proxyModel.mapToSource(indexes.first()).row();
QTC_ASSERT(row >= 0, return);
const int pid = d->processList->pidAt(row);
@@ -321,11 +312,7 @@ void StartGdbServerDialog::portListReady()
void StartGdbServerDialog::startGdbServer()
{
LinuxDeviceConfiguration::ConstPtr device = d->currentDevice();
if (d->gatherer)
delete d->gatherer;
d->gatherer = new RemoteLinuxUsedPortsGatherer(device);
d->gatherer->run();
d->gatherer.start(SshConnection::create(device->sshParameters()), device);
}
void StartGdbServerDialog::attachToRemoteProcess()