Valgrind: Simplify device setup and handling

Make isLocal() less intrusively used and correct.  Use the stored device
more often, also handle errors more quickly.

Change-Id: I146d1f5788ea79d0a9d7b058c81908d451cf00d0
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
This commit is contained in:
hjk
2016-01-30 01:38:58 +01:00
parent d14257736e
commit dcfb622126
13 changed files with 41 additions and 96 deletions

View File

@@ -28,6 +28,7 @@
#define VALGRINDPROCESS_H
#include <projectexplorer/applicationlauncher.h>
#include <projectexplorer/devicesupport/idevice.h>
#include <projectexplorer/runnables.h>
#include <ssh/sshremoteprocess.h>
@@ -45,8 +46,7 @@ class ValgrindProcess : public QObject
Q_OBJECT
public:
ValgrindProcess(const QSsh::SshConnectionParameters &sshParams,
QSsh::SshConnection *connection, QObject *parent);
ValgrindProcess(const ProjectExplorer::IDevice::ConstPtr &device, QObject *parent);
bool isRunning() const;
@@ -63,6 +63,8 @@ public:
void setProcessChannelMode(QProcess::ProcessChannelMode mode);
QString workingDirectory() const;
ProjectExplorer::IDevice::ConstPtr device() const { return m_device; }
qint64 pid() const;
QSsh::SshConnection *connection() const;
bool isLocal() const;
@@ -90,6 +92,7 @@ private:
ProjectExplorer::StandardRunnable m_debuggee;
ProjectExplorer::ApplicationLauncher m_localProcess;
qint64 m_pid;
ProjectExplorer::IDevice::ConstPtr m_device;
struct Remote {
QSsh::SshConnection *m_connection;