forked from qt-creator/qt-creator
Analyzer: Slim down AnalyzerStartParameters
* SysRoot can always be determined from kit. * Pass around RunMode as extra parameter not as part of AnalyzerStartParameters. That's closer to the pattern used elsewhere. * Environment was always initialized from the runconfig's EnvironmentAspect. The tools can do that directly. * Provide setter for display name for cases where it is not equal to RunConfiguration::displayName Change-Id: I811a0d7cdeb55cc37a16a593b3942abb567a2150 Reviewed-by: BogDan Vatra <bogdan@kdab.com> Reviewed-by: Ulf Hermann <ulf.hermann@theqtcompany.com>
This commit is contained in:
@@ -715,12 +715,11 @@ void AnalyzerManager::handleToolFinished()
|
||||
d->handleToolFinished();
|
||||
}
|
||||
|
||||
AnalyzerRunControl *AnalyzerManager::createRunControl(
|
||||
const AnalyzerStartParameters &sp, RunConfiguration *runConfiguration)
|
||||
AnalyzerRunControl *AnalyzerManager::createRunControl(const AnalyzerStartParameters &sp, RunConfiguration *runConfiguration, Id runMode)
|
||||
{
|
||||
foreach (AnalyzerAction *action, d->m_actions) {
|
||||
if (action->runMode() == sp.runMode)
|
||||
return action->runControlCreator()(sp, runConfiguration);
|
||||
if (action->runMode() == runMode)
|
||||
return action->runControlCreator()(sp, runConfiguration, runMode);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
@@ -34,9 +34,7 @@
|
||||
|
||||
#include "analyzerbase_global.h"
|
||||
|
||||
#include <coreplugin/id.h>
|
||||
|
||||
#include <QObject>
|
||||
#include <projectexplorer/runconfiguration.h>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
class QDockWidget;
|
||||
@@ -44,7 +42,6 @@ class QAction;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
namespace Utils { class FancyMainWindow; }
|
||||
namespace ProjectExplorer { class RunConfiguration; }
|
||||
|
||||
namespace Analyzer {
|
||||
|
||||
@@ -86,7 +83,7 @@ public:
|
||||
static QAction *stopAction();
|
||||
|
||||
static AnalyzerRunControl *createRunControl(const AnalyzerStartParameters &sp,
|
||||
ProjectExplorer::RunConfiguration *runConfiguration);
|
||||
ProjectExplorer::RunConfiguration *runConfiguration, Core::Id runMode);
|
||||
};
|
||||
|
||||
} // namespace Analyzer
|
||||
|
@@ -35,6 +35,10 @@
|
||||
#include "analyzermanager.h"
|
||||
#include "analyzerstartparameters.h"
|
||||
|
||||
#include <projectexplorer/project.h>
|
||||
#include <projectexplorer/runconfigurationaspects.h>
|
||||
#include <projectexplorer/target.h>
|
||||
|
||||
#include <QDebug>
|
||||
#include <QAction>
|
||||
|
||||
@@ -49,11 +53,18 @@ using namespace ProjectExplorer;
|
||||
namespace Analyzer {
|
||||
|
||||
AnalyzerRunControl::AnalyzerRunControl(const AnalyzerStartParameters &sp,
|
||||
RunConfiguration *runConfiguration)
|
||||
: RunControl(runConfiguration, sp.runMode)
|
||||
RunConfiguration *runConfiguration, Core::Id runMode)
|
||||
: RunControl(runConfiguration, runMode)
|
||||
{
|
||||
setIcon(Icons::ANALYZER_CONTROL_START);
|
||||
|
||||
if (runConfiguration) {
|
||||
m_displayName = runConfiguration->displayName();
|
||||
if (auto aspect = runConfiguration->extraAspect<WorkingDirectoryAspect>())
|
||||
m_workingDirectory = aspect->workingDirectory().toString();
|
||||
if (m_workingDirectory.isEmpty())
|
||||
m_workingDirectory = runConfiguration->target()->project()->projectDirectory().toString();
|
||||
}
|
||||
m_sp = sp;
|
||||
|
||||
connect(this, &AnalyzerRunControl::finished,
|
||||
@@ -74,6 +85,11 @@ void AnalyzerRunControl::runControlFinished()
|
||||
AnalyzerManager::handleToolFinished();
|
||||
}
|
||||
|
||||
QString AnalyzerRunControl::workingDirectory() const
|
||||
{
|
||||
return m_workingDirectory;
|
||||
}
|
||||
|
||||
void AnalyzerRunControl::start()
|
||||
{
|
||||
AnalyzerManager::handleToolStarted();
|
||||
@@ -101,7 +117,17 @@ bool AnalyzerRunControl::isRunning() const
|
||||
|
||||
QString AnalyzerRunControl::displayName() const
|
||||
{
|
||||
return m_sp.displayName;
|
||||
return m_displayName;
|
||||
}
|
||||
|
||||
void AnalyzerRunControl::setDisplayName(const QString &displayName)
|
||||
{
|
||||
m_displayName = displayName;
|
||||
}
|
||||
|
||||
void AnalyzerRunControl::setWorkingDirectory(const QString &workingDirectory)
|
||||
{
|
||||
m_workingDirectory = workingDirectory;
|
||||
}
|
||||
|
||||
} // namespace Analyzer
|
||||
|
@@ -32,16 +32,12 @@
|
||||
#ifndef ANALYZERRUNCONTROL_H
|
||||
#define ANALYZERRUNCONTROL_H
|
||||
|
||||
#include "analyzerbase_global.h"
|
||||
|
||||
#include <projectexplorer/runconfiguration.h>
|
||||
|
||||
#include "analyzerstartparameters.h"
|
||||
|
||||
#include <utils/outputformat.h>
|
||||
#include <projectexplorer/applicationlauncher.h>
|
||||
#include <projectexplorer/runconfiguration.h>
|
||||
|
||||
#include <QObject>
|
||||
#include <QString>
|
||||
#include <utils/outputformat.h>
|
||||
|
||||
namespace Analyzer {
|
||||
|
||||
@@ -56,7 +52,8 @@ class ANALYZER_EXPORT AnalyzerRunControl : public ProjectExplorer::RunControl
|
||||
|
||||
public:
|
||||
AnalyzerRunControl(const AnalyzerStartParameters &sp,
|
||||
ProjectExplorer::RunConfiguration *runConfiguration);
|
||||
ProjectExplorer::RunConfiguration *runConfiguration,
|
||||
Core::Id runMode);
|
||||
|
||||
/// Start analyzation process.
|
||||
virtual bool startEngine() = 0;
|
||||
@@ -74,14 +71,16 @@ public:
|
||||
virtual void notifyRemoteSetupDone(quint16) {}
|
||||
virtual void notifyRemoteFinished() {}
|
||||
|
||||
bool m_isRunning;
|
||||
|
||||
// ProjectExplorer::RunControl
|
||||
void start();
|
||||
StopResult stop();
|
||||
bool isRunning() const;
|
||||
QString displayName() const;
|
||||
|
||||
void setDisplayName(const QString &displayName);
|
||||
QString workingDirectory() const;
|
||||
void setWorkingDirectory(const QString &workingDirectory);
|
||||
|
||||
public slots:
|
||||
virtual void logApplicationMessage(const QString &, Utils::OutputFormat) {}
|
||||
|
||||
@@ -95,6 +94,13 @@ signals:
|
||||
|
||||
private:
|
||||
bool supportsReRunning() const { return false; }
|
||||
|
||||
protected:
|
||||
bool m_isRunning;
|
||||
|
||||
private:
|
||||
QString m_displayName; // Default to runConfig->displayName, unless overridden by setDisplayName
|
||||
QString m_workingDirectory;
|
||||
AnalyzerStartParameters m_sp;
|
||||
};
|
||||
} // namespace Analyzer
|
||||
|
@@ -34,33 +34,21 @@
|
||||
#include "analyzerbase_global.h"
|
||||
#include "analyzerconstants.h"
|
||||
|
||||
#include <QMetaType>
|
||||
|
||||
#include <coreplugin/id.h>
|
||||
#include <projectexplorer/projectexplorerconstants.h>
|
||||
#include <ssh/sshconnection.h>
|
||||
#include <utils/environment.h>
|
||||
#include <projectexplorer/applicationlauncher.h>
|
||||
#include <projectexplorer/projectexplorerconstants.h>
|
||||
|
||||
#include <QMetaType>
|
||||
|
||||
namespace Analyzer {
|
||||
|
||||
// Note: This is part of the "soft interface" of the analyzer plugin.
|
||||
// Do not add anything that needs implementation in a .cpp file.
|
||||
|
||||
class ANALYZER_EXPORT AnalyzerStartParameters
|
||||
{
|
||||
public:
|
||||
Core::Id runMode = ProjectExplorer::Constants::NO_RUN_MODE;
|
||||
QSsh::SshConnectionParameters connParams;
|
||||
ProjectExplorer::ApplicationLauncher::Mode localRunMode
|
||||
= ProjectExplorer::ApplicationLauncher::Gui;
|
||||
|
||||
QString debuggee;
|
||||
QString debuggeeArgs;
|
||||
QString displayName;
|
||||
Utils::Environment environment;
|
||||
QString workingDirectory;
|
||||
QString sysroot;
|
||||
QString analyzerHost;
|
||||
QString analyzerSocket;
|
||||
quint16 analyzerPort = 0;
|
||||
@@ -68,6 +56,4 @@ public:
|
||||
|
||||
} // namespace Analyzer
|
||||
|
||||
Q_DECLARE_METATYPE(Analyzer::AnalyzerStartParameters)
|
||||
|
||||
#endif // ANALYZERSTARTPARAMETERS_H
|
||||
|
@@ -104,8 +104,8 @@ public:
|
||||
|
||||
/// Returns a new engine for the given start parameters.
|
||||
/// Called each time the tool is launched.
|
||||
typedef std::function<AnalyzerRunControl *(const AnalyzerStartParameters &sp,
|
||||
ProjectExplorer::RunConfiguration *runConfiguration)> RunControlCreator;
|
||||
typedef std::function<AnalyzerRunControl *(const AnalyzerStartParameters &,
|
||||
ProjectExplorer::RunConfiguration *runConfiguration, Core::Id runMode)> RunControlCreator;
|
||||
RunControlCreator runControlCreator() const { return m_runControlCreator; }
|
||||
void setRunControlCreator(const RunControlCreator &creator) { m_runControlCreator = creator; }
|
||||
|
||||
|
@@ -56,11 +56,6 @@ RunControl *AndroidAnalyzeSupport::createAnalyzeRunControl(AndroidRunConfigurati
|
||||
{
|
||||
Target *target = runConfig->target();
|
||||
AnalyzerStartParameters params;
|
||||
params.runMode = runMode;
|
||||
params.displayName = AndroidManager::packageName(target);
|
||||
params.sysroot = SysRootKitInformation::sysRoot(target->kit()).toString();
|
||||
// TODO: Not sure if these are the right paths.
|
||||
params.workingDirectory = target->project()->projectDirectory().toString();
|
||||
if (runMode == ProjectExplorer::Constants::QML_PROFILER_RUN_MODE) {
|
||||
QTcpServer server;
|
||||
QTC_ASSERT(server.listen(QHostAddress::LocalHost)
|
||||
@@ -68,8 +63,11 @@ RunControl *AndroidAnalyzeSupport::createAnalyzeRunControl(AndroidRunConfigurati
|
||||
params.analyzerHost = server.serverAddress().toString();
|
||||
}
|
||||
|
||||
AnalyzerRunControl *analyzerRunControl = AnalyzerManager::createRunControl(params, runConfig);
|
||||
(void) new AndroidAnalyzeSupport(runConfig, analyzerRunControl);
|
||||
AnalyzerRunControl *analyzerRunControl = AnalyzerManager::createRunControl(params, runConfig, runMode);
|
||||
if (analyzerRunControl) {
|
||||
analyzerRunControl->setDisplayName(AndroidManager::packageName(target));
|
||||
(void) new AndroidAnalyzeSupport(runConfig, analyzerRunControl);
|
||||
}
|
||||
return analyzerRunControl;
|
||||
}
|
||||
|
||||
|
@@ -41,8 +41,8 @@
|
||||
#include <projectexplorer/runconfigurationaspects.h>
|
||||
#include <projectexplorer/target.h>
|
||||
|
||||
#include <utils/pathchooser.h>
|
||||
#include <utils/detailswidget.h>
|
||||
#include <utils/pathchooser.h>
|
||||
#include <utils/qtcassert.h>
|
||||
#include <utils/qtcprocess.h>
|
||||
#include <utils/stringutils.h>
|
||||
|
@@ -80,8 +80,6 @@ RunControl *IosAnalyzeSupport::createAnalyzeRunControl(IosRunConfiguration *runC
|
||||
if (device.isNull())
|
||||
return 0;
|
||||
AnalyzerStartParameters params;
|
||||
params.runMode = ProjectExplorer::Constants::QML_PROFILER_RUN_MODE;
|
||||
params.sysroot = SysRootKitInformation::sysRoot(target->kit()).toString();
|
||||
params.debuggee = runConfig->localExecutable().toUserOutput();
|
||||
params.debuggeeArgs = Utils::QtcProcess::joinArgs(runConfig->commandLineArguments());
|
||||
params.analyzerHost = QLatin1String("localhost");
|
||||
@@ -90,9 +88,10 @@ RunControl *IosAnalyzeSupport::createAnalyzeRunControl(IosRunConfiguration *runC
|
||||
if (iosDevice.isNull())
|
||||
return 0;
|
||||
}
|
||||
params.displayName = runConfig->applicationName();
|
||||
|
||||
AnalyzerRunControl *analyzerRunControl = AnalyzerManager::createRunControl(params, runConfig);
|
||||
AnalyzerRunControl *analyzerRunControl =
|
||||
AnalyzerManager::createRunControl(params, runConfig, ProjectExplorer::Constants::QML_PROFILER_RUN_MODE);
|
||||
if (analyzerRunControl)
|
||||
analyzerRunControl->setDisplayName(runConfig->applicationName());
|
||||
(void) new IosAnalyzeSupport(runConfig, analyzerRunControl, false, true);
|
||||
return analyzerRunControl;
|
||||
}
|
||||
|
@@ -60,7 +60,7 @@ Analyzer::AnalyzerRunControl *LocalQmlProfilerRunner::createLocalRunControl(
|
||||
QTC_ASSERT(device->type() == ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE, return 0);
|
||||
|
||||
Analyzer::AnalyzerRunControl *rc = Analyzer::AnalyzerManager::createRunControl(
|
||||
sp, runConfiguration);
|
||||
sp, runConfiguration, ProjectExplorer::Constants::QML_PROFILER_RUN_MODE);
|
||||
QmlProfilerRunControl *engine = qobject_cast<QmlProfilerRunControl *>(rc);
|
||||
if (!engine) {
|
||||
delete rc;
|
||||
@@ -70,9 +70,10 @@ Analyzer::AnalyzerRunControl *LocalQmlProfilerRunner::createLocalRunControl(
|
||||
Configuration conf;
|
||||
conf.executable = sp.debuggee;
|
||||
conf.executableArguments = sp.debuggeeArgs;
|
||||
conf.workingDirectory = sp.workingDirectory;
|
||||
conf.environment = sp.environment;
|
||||
conf.workingDirectory = rc->workingDirectory();
|
||||
conf.socket = sp.analyzerSocket;
|
||||
if (EnvironmentAspect *environment = runConfiguration->extraAspect<EnvironmentAspect>())
|
||||
conf.environment = environment->environment();
|
||||
conf.port = sp.analyzerPort;
|
||||
|
||||
if (conf.executable.isEmpty()) {
|
||||
|
@@ -60,7 +60,7 @@ bool QmlProfilerPlugin::initialize(const QStringList &arguments, QString *errorS
|
||||
auto tool = new QmlProfilerTool(this);
|
||||
auto widgetCreator = [tool] { return tool->createWidgets(); };
|
||||
auto runControlCreator = [tool](const AnalyzerStartParameters &sp,
|
||||
ProjectExplorer::RunConfiguration *runConfiguration) {
|
||||
ProjectExplorer::RunConfiguration *runConfiguration, Core::Id) {
|
||||
return tool->createRunControl(sp, runConfiguration);
|
||||
};
|
||||
|
||||
|
@@ -66,12 +66,10 @@ namespace QmlProfiler {
|
||||
class QmlProfilerRunControl::QmlProfilerRunControlPrivate
|
||||
{
|
||||
public:
|
||||
QmlProfilerRunControlPrivate() : m_running(false) {}
|
||||
|
||||
QmlProfilerStateManager *m_profilerState;
|
||||
QmlProfilerStateManager *m_profilerState = 0;
|
||||
QTimer m_noDebugOutputTimer;
|
||||
QmlDebug::QmlOutputParser m_outputParser;
|
||||
bool m_running;
|
||||
bool m_running = false;
|
||||
};
|
||||
|
||||
//
|
||||
@@ -79,11 +77,10 @@ public:
|
||||
//
|
||||
|
||||
QmlProfilerRunControl::QmlProfilerRunControl(const AnalyzerStartParameters &sp,
|
||||
RunConfiguration *runConfiguration) :
|
||||
AnalyzerRunControl(sp, runConfiguration), d(new QmlProfilerRunControlPrivate)
|
||||
RunConfiguration *runConfiguration)
|
||||
: AnalyzerRunControl(sp, runConfiguration, ProjectExplorer::Constants::QML_PROFILER_RUN_MODE)
|
||||
, d(new QmlProfilerRunControlPrivate)
|
||||
{
|
||||
d->m_profilerState = 0;
|
||||
|
||||
// Only wait 4 seconds for the 'Waiting for connection' on application output, then just try to connect
|
||||
// (application output might be redirected / blocked)
|
||||
d->m_noDebugOutputTimer.setSingleShot(true);
|
||||
|
@@ -69,18 +69,12 @@ bool QmlProfilerRunControlFactory::canRun(RunConfiguration *runConfiguration, Co
|
||||
static AnalyzerStartParameters createQmlProfilerStartParameters(RunConfiguration *runConfiguration)
|
||||
{
|
||||
AnalyzerStartParameters sp;
|
||||
EnvironmentAspect *environment = runConfiguration->extraAspect<EnvironmentAspect>();
|
||||
|
||||
// FIXME: This is only used to communicate the connParams settings.
|
||||
LocalApplicationRunConfiguration *rc =
|
||||
qobject_cast<LocalApplicationRunConfiguration *>(runConfiguration);
|
||||
auto rc = qobject_cast<LocalApplicationRunConfiguration *>(runConfiguration);
|
||||
QTC_ASSERT(rc, return sp);
|
||||
if (environment)
|
||||
sp.environment = environment->environment();
|
||||
sp.workingDirectory = rc->workingDirectory();
|
||||
sp.debuggee = rc->executable();
|
||||
sp.debuggeeArgs = rc->commandLineArguments();
|
||||
sp.displayName = rc->displayName();
|
||||
|
||||
const QtSupport::BaseQtVersion *version =
|
||||
QtSupport::QtKitInformation::qtVersion(runConfiguration->target()->kit());
|
||||
@@ -103,7 +97,6 @@ RunControl *QmlProfilerRunControlFactory::create(RunConfiguration *runConfigurat
|
||||
QTC_ASSERT(canRun(runConfiguration, mode), return 0);
|
||||
|
||||
AnalyzerStartParameters sp = createQmlProfilerStartParameters(runConfiguration);
|
||||
sp.runMode = mode;
|
||||
return LocalQmlProfilerRunner::createLocalRunControl(runConfiguration, sp, errorMessage);
|
||||
}
|
||||
|
||||
|
@@ -197,6 +197,15 @@ QmlProfilerTool::~QmlProfilerTool()
|
||||
delete d;
|
||||
}
|
||||
|
||||
static QString sysroot(RunConfiguration *runConfig)
|
||||
{
|
||||
QTC_ASSERT(runConfig, return QString());
|
||||
Kit *k = runConfig->target()->kit();
|
||||
if (k && SysRootKitInformation::hasSysRoot(k))
|
||||
return SysRootKitInformation::sysRoot(runConfig->target()->kit()).toString();
|
||||
return QString();
|
||||
}
|
||||
|
||||
AnalyzerRunControl *QmlProfilerTool::createRunControl(const AnalyzerStartParameters &sp,
|
||||
RunConfiguration *runConfiguration)
|
||||
{
|
||||
@@ -231,7 +240,7 @@ AnalyzerRunControl *QmlProfilerTool::createRunControl(const AnalyzerStartParamet
|
||||
projectDirectory = project->projectDirectory().toString();
|
||||
}
|
||||
|
||||
populateFileFinder(projectDirectory, sp.sysroot);
|
||||
populateFileFinder(projectDirectory, sysroot(runConfiguration));
|
||||
|
||||
if (sp.analyzerSocket.isEmpty())
|
||||
connect(engine, &QmlProfilerRunControl::processRunning,
|
||||
@@ -242,15 +251,6 @@ AnalyzerRunControl *QmlProfilerTool::createRunControl(const AnalyzerStartParamet
|
||||
return engine;
|
||||
}
|
||||
|
||||
static QString sysroot(RunConfiguration *runConfig)
|
||||
{
|
||||
QTC_ASSERT(runConfig, return QString());
|
||||
Kit *k = runConfig->target()->kit();
|
||||
if (k && SysRootKitInformation::hasSysRoot(k))
|
||||
return SysRootKitInformation::sysRoot(runConfig->target()->kit()).toString();
|
||||
return QString();
|
||||
}
|
||||
|
||||
QWidget *QmlProfilerTool::createWidgets()
|
||||
{
|
||||
QTC_ASSERT(!d->m_viewContainer, return 0);
|
||||
@@ -526,7 +526,6 @@ void QmlProfilerTool::startRemoteTool()
|
||||
sp.connParams = device->sshParameters();
|
||||
sp.analyzerHost = device->qmlProfilerHost();
|
||||
}
|
||||
sp.sysroot = SysRootKitInformation::sysRoot(kit).toString();
|
||||
sp.analyzerPort = port;
|
||||
|
||||
AnalyzerRunControl *rc = createRunControl(sp, 0);
|
||||
|
@@ -95,7 +95,7 @@ static DebuggerStartParameters createDebuggerStartParameters(QnxRunConfiguration
|
||||
return params;
|
||||
}
|
||||
|
||||
static AnalyzerStartParameters createAnalyzerStartParameters(const QnxRunConfiguration *runConfig, Core::Id mode)
|
||||
static AnalyzerStartParameters createAnalyzerStartParameters(const QnxRunConfiguration *runConfig)
|
||||
{
|
||||
AnalyzerStartParameters params;
|
||||
Target *target = runConfig->target();
|
||||
@@ -105,18 +105,12 @@ static AnalyzerStartParameters createAnalyzerStartParameters(const QnxRunConfigu
|
||||
if (device.isNull())
|
||||
return params;
|
||||
|
||||
params.runMode = mode;
|
||||
params.debuggee = runConfig->remoteExecutableFilePath();
|
||||
params.debuggeeArgs = runConfig->arguments().join(QLatin1Char(' '));
|
||||
params.connParams = DeviceKitInformation::device(runConfig->target()->kit())->sshParameters();
|
||||
params.displayName = runConfig->displayName();
|
||||
params.sysroot = SysRootKitInformation::sysRoot(runConfig->target()->kit()).toString();
|
||||
params.analyzerHost = params.connParams.host;
|
||||
params.analyzerPort = params.connParams.port;
|
||||
|
||||
if (EnvironmentAspect *environment = runConfig->extraAspect<EnvironmentAspect>())
|
||||
params.environment = environment->environment();
|
||||
|
||||
return params;
|
||||
}
|
||||
|
||||
@@ -170,10 +164,9 @@ RunControl *QnxRunControlFactory::create(RunConfiguration *runConfig, Core::Id m
|
||||
|
||||
return runControl;
|
||||
}
|
||||
|
||||
if (mode == ProjectExplorer::Constants::QML_PROFILER_RUN_MODE) {
|
||||
const AnalyzerStartParameters params = createAnalyzerStartParameters(rc, mode);
|
||||
AnalyzerRunControl *runControl = AnalyzerManager::createRunControl(params, runConfig);
|
||||
const AnalyzerStartParameters params = createAnalyzerStartParameters(rc);
|
||||
AnalyzerRunControl *runControl = AnalyzerManager::createRunControl(params, runConfig, mode);
|
||||
QnxAnalyzeSupport * const analyzeSupport = new QnxAnalyzeSupport(rc, runControl);
|
||||
connect(runControl, SIGNAL(finished()), analyzeSupport, SLOT(handleProfilingFinished()));
|
||||
return runControl;
|
||||
|
@@ -76,34 +76,13 @@ public:
|
||||
|
||||
using namespace Internal;
|
||||
|
||||
AnalyzerStartParameters RemoteLinuxAnalyzeSupport::startParameters(const RunConfiguration *runConfig,
|
||||
Core::Id runMode)
|
||||
{
|
||||
AnalyzerStartParameters params;
|
||||
params.runMode = runMode;
|
||||
params.connParams = DeviceKitInformation::device(runConfig->target()->kit())->sshParameters();
|
||||
params.displayName = runConfig->displayName();
|
||||
params.sysroot = SysRootKitInformation::sysRoot(runConfig->target()->kit()).toString();
|
||||
params.analyzerHost = params.connParams.host;
|
||||
|
||||
auto rc = qobject_cast<const AbstractRemoteLinuxRunConfiguration *>(runConfig);
|
||||
QTC_ASSERT(rc, return params);
|
||||
|
||||
params.debuggee = rc->remoteExecutableFilePath();
|
||||
params.debuggeeArgs = Utils::QtcProcess::Arguments::createUnixArgs(rc->arguments()).toString();
|
||||
params.workingDirectory = rc->workingDirectory();
|
||||
params.environment = rc->environment();
|
||||
|
||||
return params;
|
||||
}
|
||||
|
||||
RemoteLinuxAnalyzeSupport::RemoteLinuxAnalyzeSupport(AbstractRemoteLinuxRunConfiguration *runConfig,
|
||||
AnalyzerRunControl *engine, Core::Id runMode)
|
||||
: AbstractRemoteLinuxRunSupport(runConfig, engine),
|
||||
d(new RemoteLinuxAnalyzeSupportPrivate(engine, runMode))
|
||||
{
|
||||
connect(d->runControl, SIGNAL(starting(const Analyzer::AnalyzerRunControl*)),
|
||||
SLOT(handleRemoteSetupRequested()));
|
||||
connect(d->runControl.data(), &AnalyzerRunControl::starting,
|
||||
this, &RemoteLinuxAnalyzeSupport::handleRemoteSetupRequested);
|
||||
connect(&d->outputParser, &QmlDebug::QmlOutputParser::waitingForConnectionOnPort,
|
||||
this, &RemoteLinuxAnalyzeSupport::remoteIsRunning);
|
||||
connect(engine, &RunControl::finished,
|
||||
|
@@ -52,9 +52,6 @@ class REMOTELINUX_EXPORT RemoteLinuxAnalyzeSupport : public AbstractRemoteLinuxR
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
static Analyzer::AnalyzerStartParameters startParameters(const ProjectExplorer::RunConfiguration *runConfig,
|
||||
Core::Id runMode);
|
||||
|
||||
RemoteLinuxAnalyzeSupport(AbstractRemoteLinuxRunConfiguration *runConfig,
|
||||
Analyzer::AnalyzerRunControl *engine, Core::Id runMode);
|
||||
~RemoteLinuxAnalyzeSupport();
|
||||
|
@@ -116,10 +116,12 @@ RunControl *RemoteLinuxRunControlFactory::create(RunConfiguration *runConfig, Co
|
||||
}
|
||||
|
||||
if (mode == ProjectExplorer::Constants::QML_PROFILER_RUN_MODE) {
|
||||
AnalyzerStartParameters params = RemoteLinuxAnalyzeSupport::startParameters(runConfig, mode);
|
||||
AnalyzerStartParameters params;
|
||||
params.connParams = DeviceKitInformation::device(runConfig->target()->kit())->sshParameters();
|
||||
params.analyzerHost = params.connParams.host;
|
||||
auto * const rc = qobject_cast<AbstractRemoteLinuxRunConfiguration *>(runConfig);
|
||||
QTC_ASSERT(rc, return 0);
|
||||
AnalyzerRunControl *runControl = AnalyzerManager::createRunControl(params, runConfig);
|
||||
AnalyzerRunControl *runControl = AnalyzerManager::createRunControl(params, runConfig, mode);
|
||||
(void) new RemoteLinuxAnalyzeSupport(rc, runControl, mode);
|
||||
return runControl;
|
||||
}
|
||||
|
@@ -46,7 +46,7 @@ using namespace Valgrind::Internal;
|
||||
|
||||
CallgrindRunControl::CallgrindRunControl(const AnalyzerStartParameters &sp,
|
||||
ProjectExplorer::RunConfiguration *runConfiguration)
|
||||
: ValgrindRunControl(sp, runConfiguration)
|
||||
: ValgrindRunControl(sp, runConfiguration, CALLGRIND_RUN_MODE)
|
||||
, m_markAsPaused(false)
|
||||
{
|
||||
connect(&m_runner, &Callgrind::CallgrindRunner::finished,
|
||||
|
@@ -30,6 +30,7 @@
|
||||
****************************************************************************/
|
||||
|
||||
#include "memcheckengine.h"
|
||||
#include "memchecktool.h"
|
||||
#include "valgrindprocess.h"
|
||||
#include "valgrindsettings.h"
|
||||
#include "xmlprotocol/error.h"
|
||||
@@ -56,8 +57,8 @@ namespace Valgrind {
|
||||
namespace Internal {
|
||||
|
||||
MemcheckRunControl::MemcheckRunControl(const AnalyzerStartParameters &sp,
|
||||
RunConfiguration *runConfiguration)
|
||||
: ValgrindRunControl(sp, runConfiguration)
|
||||
RunConfiguration *runConfiguration, Core::Id runMode)
|
||||
: ValgrindRunControl(sp, runConfiguration, runMode)
|
||||
{
|
||||
connect(&m_parser, &XmlProtocol::ThreadedParser::error,
|
||||
this, &MemcheckRunControl::parserError);
|
||||
@@ -135,7 +136,7 @@ QStringList MemcheckRunControl::suppressionFiles() const
|
||||
|
||||
MemcheckWithGdbRunControl::MemcheckWithGdbRunControl(const AnalyzerStartParameters &sp,
|
||||
RunConfiguration *runConfiguration)
|
||||
: MemcheckRunControl(sp, runConfiguration)
|
||||
: MemcheckRunControl(sp, runConfiguration, MEMCHECK_WITH_GDB_RUN_MODE)
|
||||
{
|
||||
connect(&m_runner, &Memcheck::MemcheckRunner::started,
|
||||
this, &MemcheckWithGdbRunControl::startDebugger);
|
||||
|
@@ -46,7 +46,8 @@ class MemcheckRunControl : public ValgrindRunControl
|
||||
|
||||
public:
|
||||
MemcheckRunControl(const Analyzer::AnalyzerStartParameters &sp,
|
||||
ProjectExplorer::RunConfiguration *runConfiguration);
|
||||
ProjectExplorer::RunConfiguration *runConfiguration,
|
||||
Core::Id runMode);
|
||||
|
||||
bool startEngine() override;
|
||||
void stopEngine() override;
|
||||
|
@@ -429,13 +429,17 @@ QWidget *MemcheckTool::createWidgets()
|
||||
}
|
||||
|
||||
MemcheckRunControl *MemcheckTool::createRunControl(const AnalyzerStartParameters &sp,
|
||||
RunConfiguration *runConfiguration)
|
||||
RunConfiguration *runConfiguration,
|
||||
Core::Id runMode)
|
||||
{
|
||||
m_frameFinder->setFiles(runConfiguration ? runConfiguration->target()
|
||||
->project()->files(Project::AllFiles) : QStringList());
|
||||
|
||||
MemcheckRunControl *engine = createMemcheckRunControl(sp, runConfiguration);
|
||||
|
||||
MemcheckRunControl *engine = 0;
|
||||
if (runMode == MEMCHECK_RUN_MODE)
|
||||
engine = new MemcheckRunControl(sp, runConfiguration, runMode);
|
||||
else
|
||||
engine = new MemcheckWithGdbRunControl(sp, runConfiguration);
|
||||
connect(engine, &MemcheckRunControl::starting, this, &MemcheckTool::engineStarting);
|
||||
connect(engine, &MemcheckRunControl::parserError, this, &MemcheckTool::parserError);
|
||||
connect(engine, &MemcheckRunControl::internalParserError, this, &MemcheckTool::internalParserError);
|
||||
@@ -567,12 +571,6 @@ int MemcheckTool::updateUiAfterFinishedHelper()
|
||||
return issuesFound;
|
||||
}
|
||||
|
||||
MemcheckRunControl *MemcheckTool::createMemcheckRunControl(const AnalyzerStartParameters &sp,
|
||||
RunConfiguration *runConfiguration)
|
||||
{
|
||||
return new MemcheckRunControl(sp, runConfiguration);
|
||||
}
|
||||
|
||||
void MemcheckTool::engineFinished()
|
||||
{
|
||||
const int issuesFound = updateUiAfterFinishedHelper();
|
||||
@@ -595,17 +593,5 @@ void MemcheckTool::setBusyCursor(bool busy)
|
||||
m_errorView->setCursor(cursor);
|
||||
}
|
||||
|
||||
MemcheckWithGdbTool::MemcheckWithGdbTool(QObject *parent) :
|
||||
MemcheckTool(parent)
|
||||
{
|
||||
setObjectName(QLatin1String("MemcheckWithGdbTool"));
|
||||
}
|
||||
|
||||
MemcheckRunControl *MemcheckWithGdbTool::createMemcheckRunControl(const AnalyzerStartParameters &sp,
|
||||
RunConfiguration *runConfiguration)
|
||||
{
|
||||
return new MemcheckWithGdbRunControl(sp, runConfiguration);
|
||||
}
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace Valgrind
|
||||
|
@@ -91,7 +91,8 @@ public:
|
||||
QWidget *createWidgets();
|
||||
|
||||
MemcheckRunControl *createRunControl(const Analyzer::AnalyzerStartParameters &sp,
|
||||
ProjectExplorer::RunConfiguration *runConfiguration);
|
||||
ProjectExplorer::RunConfiguration *runConfiguration,
|
||||
Core::Id runMode);
|
||||
|
||||
private slots:
|
||||
void settingsDestroyed(QObject *settings);
|
||||
@@ -115,11 +116,6 @@ private:
|
||||
void updateFromSettings();
|
||||
int updateUiAfterFinishedHelper();
|
||||
|
||||
protected:
|
||||
virtual MemcheckRunControl *createMemcheckRunControl(
|
||||
const Analyzer::AnalyzerStartParameters &sp,
|
||||
ProjectExplorer::RunConfiguration *runConfiguration);
|
||||
|
||||
private:
|
||||
ValgrindBaseSettings *m_settings;
|
||||
QMenu *m_filterMenu;
|
||||
@@ -138,16 +134,6 @@ private:
|
||||
QAction *m_goNext;
|
||||
};
|
||||
|
||||
class MemcheckWithGdbTool : public MemcheckTool
|
||||
{
|
||||
public:
|
||||
MemcheckWithGdbTool(QObject *parent);
|
||||
|
||||
MemcheckRunControl *createMemcheckRunControl(
|
||||
const Analyzer::AnalyzerStartParameters &sp,
|
||||
ProjectExplorer::RunConfiguration *runConfiguration) override;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace Valgrind
|
||||
|
||||
|
@@ -55,12 +55,13 @@ namespace Valgrind {
|
||||
namespace Internal {
|
||||
|
||||
ValgrindRunControl::ValgrindRunControl(const AnalyzerStartParameters &sp,
|
||||
RunConfiguration *runConfiguration)
|
||||
: AnalyzerRunControl(sp, runConfiguration),
|
||||
RunConfiguration *runConfiguration, Core::Id runMode)
|
||||
: AnalyzerRunControl(sp, runConfiguration, runMode),
|
||||
m_settings(0),
|
||||
m_isStopping(false)
|
||||
{
|
||||
m_isCustomStart = false;
|
||||
m_localRunMode = ApplicationLauncher::Gui;
|
||||
|
||||
if (runConfiguration)
|
||||
if (IRunConfigurationAspect *aspect = runConfiguration->extraAspect(ANALYZER_VALGRIND_SETTINGS))
|
||||
@@ -94,15 +95,15 @@ bool ValgrindRunControl::startEngine()
|
||||
#endif
|
||||
|
||||
ValgrindRunner *run = runner();
|
||||
run->setWorkingDirectory(sp.workingDirectory);
|
||||
run->setWorkingDirectory(workingDirectory());
|
||||
run->setValgrindExecutable(m_settings->valgrindExecutable());
|
||||
run->setValgrindArguments(genericToolArguments() + toolArguments());
|
||||
run->setDebuggeeExecutable(sp.debuggee);
|
||||
run->setDebuggeeArguments(sp.debuggeeArgs);
|
||||
run->setEnvironment(sp.environment);
|
||||
run->setEnvironment(m_environment);
|
||||
run->setConnectionParameters(sp.connParams);
|
||||
run->setUseStartupProject(!m_isCustomStart);
|
||||
run->setLocalRunMode(sp.localRunMode);
|
||||
run->setLocalRunMode(m_localRunMode);
|
||||
|
||||
connect(run, &ValgrindRunner::processOutputReceived,
|
||||
this, &ValgrindRunControl::receiveProcessOutput);
|
||||
@@ -129,6 +130,16 @@ QString ValgrindRunControl::executable() const
|
||||
return startParameters().debuggee;
|
||||
}
|
||||
|
||||
void ValgrindRunControl::setEnvironment(const Utils::Environment &environment)
|
||||
{
|
||||
m_environment = environment;
|
||||
}
|
||||
|
||||
void ValgrindRunControl::setLocalRunMode(ApplicationLauncher::Mode localRunMode)
|
||||
{
|
||||
m_localRunMode = localRunMode;
|
||||
}
|
||||
|
||||
QStringList ValgrindRunControl::genericToolArguments() const
|
||||
{
|
||||
QTC_ASSERT(m_settings, return QStringList());
|
||||
|
@@ -49,14 +49,18 @@ class ValgrindRunControl : public Analyzer::AnalyzerRunControl
|
||||
|
||||
public:
|
||||
ValgrindRunControl(const Analyzer::AnalyzerStartParameters &sp,
|
||||
ProjectExplorer::RunConfiguration *runConfiguration);
|
||||
ProjectExplorer::RunConfiguration *runConfiguration,
|
||||
Core::Id runMode);
|
||||
~ValgrindRunControl();
|
||||
|
||||
bool startEngine();
|
||||
void stopEngine();
|
||||
|
||||
QString executable() const;
|
||||
|
||||
void setCustomStart() { m_isCustomStart = true; }
|
||||
void setEnvironment(const Utils::Environment &environment);
|
||||
void setLocalRunMode(ProjectExplorer::ApplicationLauncher::Mode localRunMode);
|
||||
|
||||
protected:
|
||||
virtual QString progressTitle() const = 0;
|
||||
@@ -66,6 +70,8 @@ protected:
|
||||
ValgrindBaseSettings *m_settings;
|
||||
QFutureInterface<void> m_progress;
|
||||
bool m_isCustomStart;
|
||||
Utils::Environment m_environment;
|
||||
ProjectExplorer::ApplicationLauncher::Mode m_localRunMode;
|
||||
|
||||
private slots:
|
||||
void handleProgressCanceled();
|
||||
|
@@ -110,20 +110,6 @@ ValgrindPlugin::~ValgrindPlugin()
|
||||
theGlobalSettings = 0;
|
||||
}
|
||||
|
||||
static bool fillParameters(AnalyzerStartParameters *sp)
|
||||
{
|
||||
StartRemoteDialog dlg;
|
||||
if (dlg.exec() != QDialog::Accepted)
|
||||
return false;
|
||||
|
||||
sp->connParams = dlg.sshParams();
|
||||
sp->debuggee = dlg.executable();
|
||||
sp->debuggeeArgs = dlg.arguments();
|
||||
sp->displayName = dlg.executable();
|
||||
sp->workingDirectory = dlg.workingDirectory();
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ValgrindPlugin::initialize(const QStringList &, QString *)
|
||||
{
|
||||
theGlobalSettings = new ValgrindGlobalSettings();
|
||||
@@ -137,6 +123,7 @@ bool ValgrindPlugin::initialize(const QStringList &, QString *)
|
||||
|
||||
void ValgrindPlugin::extensionsInitialized()
|
||||
{
|
||||
using namespace std::placeholders;
|
||||
AnalyzerAction *action = 0;
|
||||
|
||||
QString callgrindToolTip = tr("Valgrind Function Profile uses the "
|
||||
@@ -147,15 +134,10 @@ void ValgrindPlugin::extensionsInitialized()
|
||||
|
||||
auto mcTool = new MemcheckTool(this);
|
||||
auto mcWidgetCreator = [mcTool] { return mcTool->createWidgets(); };
|
||||
auto mcRunControlCreator = [mcTool](const AnalyzerStartParameters &sp,
|
||||
ProjectExplorer::RunConfiguration *runConfiguration) -> AnalyzerRunControl * {
|
||||
return mcTool->createRunControl(sp, runConfiguration);
|
||||
};
|
||||
|
||||
auto cgTool = new CallgrindTool(this);
|
||||
auto cgWidgetCreator = [cgTool] { return cgTool->createWidgets(); };
|
||||
auto cgRunControlCreator = [cgTool](const AnalyzerStartParameters &sp,
|
||||
ProjectExplorer::RunConfiguration *runConfiguration) {
|
||||
RunConfiguration *runConfiguration, Core::Id) {
|
||||
return cgTool->createRunControl(sp, runConfiguration);
|
||||
};
|
||||
|
||||
@@ -164,8 +146,9 @@ void ValgrindPlugin::extensionsInitialized()
|
||||
action->setActionId("Memcheck.Local");
|
||||
action->setToolId("Memcheck");
|
||||
action->setWidgetCreator(mcWidgetCreator);
|
||||
action->setRunControlCreator(mcRunControlCreator);
|
||||
action->setToolMode(SymbolsMode);
|
||||
action->setRunControlCreator(std::bind(&MemcheckTool::createRunControl,
|
||||
mcTool, _1, _2, MEMCHECK_RUN_MODE));
|
||||
action->setToolMode(DebugMode);
|
||||
action->setRunMode(MEMCHECK_RUN_MODE);
|
||||
action->setText(tr("Valgrind Memory Analyzer"));
|
||||
action->setToolTip(memcheckToolTip);
|
||||
@@ -173,15 +156,14 @@ void ValgrindPlugin::extensionsInitialized()
|
||||
action->setEnabled(false);
|
||||
AnalyzerManager::addAction(action);
|
||||
|
||||
using namespace std::placeholders;
|
||||
auto mcgTool = new MemcheckWithGdbTool(this);
|
||||
auto mcgTool = new MemcheckTool(this);
|
||||
action = new AnalyzerAction(this);
|
||||
action->setActionId("MemcheckWithGdb.Local");
|
||||
action->setToolId("MemcheckWithGdb");
|
||||
action->setWidgetCreator([mcgTool] { return mcgTool->createWidgets(); });
|
||||
action->setRunControlCreator(std::bind(&MemcheckWithGdbTool::createRunControl,
|
||||
mcgTool, _1, _2));
|
||||
action->setToolMode(SymbolsMode);
|
||||
action->setRunControlCreator(std::bind(&MemcheckTool::createRunControl,
|
||||
mcgTool, _1, _2, MEMCHECK_WITH_GDB_RUN_MODE));
|
||||
action->setToolMode(DebugMode);
|
||||
action->setRunMode(MEMCHECK_WITH_GDB_RUN_MODE);
|
||||
action->setText(tr("Valgrind Memory Analyzer with GDB"));
|
||||
action->setToolTip(tr("Valgrind Analyze Memory with GDB uses the "
|
||||
@@ -210,11 +192,17 @@ void ValgrindPlugin::extensionsInitialized()
|
||||
action->setToolId("Memcheck");
|
||||
action->setWidgetCreator(mcWidgetCreator);
|
||||
action->setCustomToolStarter([mcTool] {
|
||||
AnalyzerStartParameters sp;
|
||||
if (!fillParameters(&sp))
|
||||
StartRemoteDialog dlg;
|
||||
if (dlg.exec() != QDialog::Accepted)
|
||||
return;
|
||||
ValgrindRunControl *rc = mcTool->createRunControl(sp, 0);
|
||||
AnalyzerStartParameters sp;
|
||||
sp.connParams = dlg.sshParams();
|
||||
sp.debuggee = dlg.executable();
|
||||
sp.debuggeeArgs = dlg.arguments();
|
||||
ValgrindRunControl *rc = mcTool->createRunControl(sp, 0, MEMCHECK_RUN_MODE);
|
||||
QTC_ASSERT(rc, return);
|
||||
rc->setDisplayName(dlg.executable());
|
||||
rc->setWorkingDirectory(dlg.workingDirectory());
|
||||
rc->setCustomStart();
|
||||
ProjectExplorerPlugin::startRunControl(rc, MEMCHECK_RUN_MODE);
|
||||
});
|
||||
@@ -228,11 +216,17 @@ void ValgrindPlugin::extensionsInitialized()
|
||||
action->setToolId(CallgrindToolId);
|
||||
action->setWidgetCreator(cgWidgetCreator);
|
||||
action->setCustomToolStarter([cgTool] {
|
||||
AnalyzerStartParameters sp;
|
||||
if (!fillParameters(&sp))
|
||||
StartRemoteDialog dlg;
|
||||
if (dlg.exec() != QDialog::Accepted)
|
||||
return;
|
||||
AnalyzerStartParameters sp;
|
||||
sp.connParams = dlg.sshParams();
|
||||
sp.debuggee = dlg.executable();
|
||||
sp.debuggeeArgs = dlg.arguments();
|
||||
ValgrindRunControl *rc = cgTool->createRunControl(sp, 0);
|
||||
QTC_ASSERT(rc, return);
|
||||
rc->setDisplayName(dlg.executable());
|
||||
rc->setWorkingDirectory(dlg.workingDirectory());
|
||||
rc->setCustomStart();
|
||||
ProjectExplorerPlugin::startRunControl(rc, CALLGRIND_RUN_MODE);
|
||||
});
|
||||
|
@@ -29,6 +29,8 @@
|
||||
****************************************************************************/
|
||||
|
||||
#include "valgrindruncontrolfactory.h"
|
||||
|
||||
#include "valgrindengine.h"
|
||||
#include "valgrindsettings.h"
|
||||
#include "valgrindplugin.h"
|
||||
#include "callgrindtool.h"
|
||||
@@ -55,6 +57,7 @@
|
||||
|
||||
using namespace Analyzer;
|
||||
using namespace ProjectExplorer;
|
||||
using namespace Utils;
|
||||
|
||||
namespace Valgrind {
|
||||
namespace Internal {
|
||||
@@ -74,15 +77,15 @@ RunControl *ValgrindRunControlFactory::create(RunConfiguration *runConfiguration
|
||||
{
|
||||
Q_UNUSED(errorMessage);
|
||||
|
||||
ApplicationLauncher::Mode localRunMode = ApplicationLauncher::Gui;
|
||||
Utils::Environment environment;
|
||||
AnalyzerStartParameters sp;
|
||||
sp.displayName = runConfiguration->displayName();
|
||||
sp.runMode = mode;
|
||||
if (LocalApplicationRunConfiguration *rc1 =
|
||||
qobject_cast<LocalApplicationRunConfiguration *>(runConfiguration)) {
|
||||
QString workingDirectory;
|
||||
if (auto rc1 = qobject_cast<LocalApplicationRunConfiguration *>(runConfiguration)) {
|
||||
EnvironmentAspect *aspect = runConfiguration->extraAspect<EnvironmentAspect>();
|
||||
if (aspect)
|
||||
sp.environment = aspect->environment();
|
||||
sp.workingDirectory = rc1->workingDirectory();
|
||||
environment = aspect->environment();
|
||||
workingDirectory = rc1->workingDirectory();
|
||||
sp.debuggee = rc1->executable();
|
||||
sp.debuggeeArgs = rc1->commandLineArguments();
|
||||
const IDevice::ConstPtr device =
|
||||
@@ -96,19 +99,23 @@ RunControl *ValgrindRunControlFactory::create(RunConfiguration *runConfiguration
|
||||
}
|
||||
sp.connParams.host = server.serverAddress().toString();
|
||||
sp.connParams.port = server.serverPort();
|
||||
sp.localRunMode = static_cast<ApplicationLauncher::Mode>(rc1->runMode());
|
||||
localRunMode = rc1->runMode();
|
||||
} else if (RemoteLinux::AbstractRemoteLinuxRunConfiguration *rc2 =
|
||||
qobject_cast<RemoteLinux::AbstractRemoteLinuxRunConfiguration *>(runConfiguration)) {
|
||||
sp.debuggee = rc2->remoteExecutableFilePath();
|
||||
sp.connParams = DeviceKitInformation::device(rc2->target()->kit())->sshParameters();
|
||||
sp.debuggeeArgs = rc2->arguments().join(QLatin1Char(' '));
|
||||
sp.workingDirectory = rc2->workingDirectory();
|
||||
sp.environment = rc2->environment();
|
||||
} else {
|
||||
QTC_ASSERT(false, return 0);
|
||||
}
|
||||
|
||||
return AnalyzerManager::createRunControl(sp, runConfiguration);
|
||||
auto analyzerRunControl = AnalyzerManager::createRunControl(sp, runConfiguration, mode);
|
||||
if (auto valgrindRunControl = qobject_cast<ValgrindRunControl *>(analyzerRunControl)) {
|
||||
valgrindRunControl->setLocalRunMode(localRunMode);
|
||||
valgrindRunControl->setEnvironment(environment);
|
||||
valgrindRunControl->setWorkingDirectory(workingDirectory);
|
||||
}
|
||||
return analyzerRunControl;
|
||||
}
|
||||
|
||||
|
||||
|
@@ -183,11 +183,6 @@ void ValgrindRunner::setLocalRunMode(ProjectExplorer::ApplicationLauncher::Mode
|
||||
d->localRunMode = localRunMode;
|
||||
}
|
||||
|
||||
ProjectExplorer::ApplicationLauncher::Mode ValgrindRunner::localRunMode() const
|
||||
{
|
||||
return d->localRunMode;
|
||||
}
|
||||
|
||||
const QSsh::SshConnectionParameters &ValgrindRunner::connectionParameters() const
|
||||
{
|
||||
return d->connParams;
|
||||
|
@@ -76,7 +76,6 @@ public:
|
||||
bool useStartupProject() const;
|
||||
|
||||
void setLocalRunMode(ProjectExplorer::ApplicationLauncher::Mode localRunMode);
|
||||
ProjectExplorer::ApplicationLauncher::Mode localRunMode() const;
|
||||
|
||||
void setConnectionParameters(const QSsh::SshConnectionParameters &connParams);
|
||||
const QSsh::SshConnectionParameters &connectionParameters() const;
|
||||
|
Reference in New Issue
Block a user