Valgrind: Remove CallgrindController's use of ValgrindProcess

It's simply one-shot command execution, using (only some part of) the
ValgrindProcess machinery that just happens to also to wrap a process
is conceptually different from ValgrindProcess that "is" the
valgrind-with-debuggee entity (and an unneeded dependency)

Change-Id: I57a2c3d1cab6b15e59cb41b8e131948c170297b6
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
hjk
2017-06-28 18:45:57 +02:00
parent ef7c633de2
commit 3418070a4f
9 changed files with 158 additions and 129 deletions

View File

@@ -25,18 +25,15 @@
#pragma once
#include <QObject>
#include <qprocess.h>
#include <ssh/sshconnection.h>
#include <ssh/sshremoteprocess.h>
#include <ssh/sftpchannel.h>
#include <ssh/sshconnection.h>
#include <projectexplorer/runnables.h>
#include <QProcess>
namespace Valgrind {
class ValgrindProcess;
namespace Callgrind {
class CallgrindController : public QObject
@@ -49,16 +46,14 @@ public:
Unknown,
Dump,
ResetEventCounters,
Pause, UnPause
Pause,
UnPause
};
explicit CallgrindController(QObject *parent = 0);
virtual ~CallgrindController();
CallgrindController();
~CallgrindController() override;
void run(Valgrind::Callgrind::CallgrindController::Option option);
void setValgrindProcess(ValgrindProcess *process);
ValgrindProcess *valgrindProcess() { return m_valgrindProc; }
void run(Option option);
/**
* Make data file available locally, triggers @c localParseDataAvailable.
@@ -67,32 +62,34 @@ public:
* downloads the data file first and returns a local path.
*/
void getLocalDataFile();
void setValgrindPid(qint64 pid);
void setValgrindRunnable(const ProjectExplorer::Runnable &runnable);
signals:
void finished(Valgrind::Callgrind::CallgrindController::Option option);
void localParseDataAvailable(const QString &file);
void statusMessage(const QString &msg);
private:
void processError(QProcess::ProcessError);
void processFinished(int, QProcess::ExitStatus);
void handleControllerProcessError(QProcess::ProcessError);
void foundRemoteFile();
void sftpInitialized();
void sftpJobFinished(QSsh::SftpJobId job, const QString &error);
void cleanupTempFile();
// callgrind_control process
Valgrind::ValgrindProcess *m_process;
// valgrind process
Valgrind::ValgrindProcess *m_valgrindProc;
void controllerProcessFinished(int, QProcess::ExitStatus);
void controllerProcessError(QProcess::ProcessError);
void controllerProcessClosed(bool success);
Option m_lastOption;
ProjectExplorer::ApplicationLauncher *m_controllerProcess;
ProjectExplorer::StandardRunnable m_valgrindRunnable;
qint64 m_pid = 0;
Option m_lastOption = Unknown;
// remote callgrind support
QSsh::SshConnection *m_ssh;
QSsh::SshConnection *m_ssh = nullptr;
QString m_tempDataFile;
QSsh::SshRemoteProcess::Ptr m_findRemoteFile;
QSsh::SftpChannel::Ptr m_sftp;