forked from qt-creator/qt-creator
ProjectExplorer: Use Utils::FileName for Runnable::executable
Change-Id: I584bc18aa19a4c9886af7b13e95052dfd4350b34 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -125,7 +125,7 @@ void CallgrindController::run(Option option)
|
||||
this, &CallgrindController::controllerProcessClosed);
|
||||
|
||||
Runnable controller = m_valgrindRunnable;
|
||||
controller.executable = CALLGRIND_CONTROL_BINARY;
|
||||
controller.executable = FilePath::fromString(CALLGRIND_CONTROL_BINARY);
|
||||
controller.commandLineArguments = QString("%1 %2").arg(toOptionString(option)).arg(m_pid);
|
||||
|
||||
if (!m_valgrindRunnable.device
|
||||
|
||||
@@ -108,7 +108,7 @@ QString CallgrindToolRunner::progressTitle() const
|
||||
|
||||
void CallgrindToolRunner::start()
|
||||
{
|
||||
appendMessage(tr("Profiling %1").arg(executable()), Utils::NormalMessageFormat);
|
||||
appendMessage(tr("Profiling %1").arg(executable().toUserOutput()), Utils::NormalMessageFormat);
|
||||
return ValgrindToolRunner::start();
|
||||
}
|
||||
|
||||
|
||||
@@ -285,7 +285,7 @@ CallgrindToolPrivate::CallgrindToolPrivate()
|
||||
runControl->createMainWorker();
|
||||
const auto runnable = dlg.runnable();
|
||||
runControl->setRunnable(runnable);
|
||||
runControl->setDisplayName(runnable.executable);
|
||||
runControl->setDisplayName(runnable.executable.toUserOutput());
|
||||
ProjectExplorerPlugin::startRunControl(runControl);
|
||||
});
|
||||
|
||||
|
||||
@@ -679,7 +679,7 @@ MemcheckToolPrivate::MemcheckToolPrivate()
|
||||
rc->createMainWorker();
|
||||
const auto runnable = dlg.runnable();
|
||||
rc->setRunnable(runnable);
|
||||
rc->setDisplayName(runnable.executable);
|
||||
rc->setDisplayName(runnable.executable.toUserOutput());
|
||||
ProjectExplorerPlugin::startRunControl(rc);
|
||||
});
|
||||
|
||||
@@ -739,7 +739,7 @@ void MemcheckToolPrivate::heobAction()
|
||||
return;
|
||||
}
|
||||
|
||||
QString executable = sr.executable;
|
||||
QString executable = sr.executable.toString();
|
||||
const QString workingDirectory = Utils::FileUtils::normalizePathName(sr.workingDirectory);
|
||||
const QString commandLineArguments = sr.commandLineArguments;
|
||||
const QStringList envStrings = sr.environment.toStringList();
|
||||
@@ -966,7 +966,7 @@ void MemcheckToolPrivate::setupRunner(MemcheckToolRunner *runTool)
|
||||
m_loadExternalLogFile->setDisabled(true);
|
||||
|
||||
QString dir = runControl->project()->projectDirectory().toString() + '/';
|
||||
const QString name = FilePath::fromString(runTool->executable()).fileName();
|
||||
const QString name = runTool->executable().fileName();
|
||||
|
||||
m_errorView->setDefaultSuppressionFile(dir + name + ".supp");
|
||||
|
||||
|
||||
@@ -115,7 +115,7 @@ void ValgrindToolRunner::stop()
|
||||
m_runner.stop();
|
||||
}
|
||||
|
||||
QString ValgrindToolRunner::executable() const
|
||||
FilePath ValgrindToolRunner::executable() const
|
||||
{
|
||||
return runnable().executable;
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ public:
|
||||
void start() override;
|
||||
void stop() override;
|
||||
|
||||
QString executable() const;
|
||||
Utils::FilePath executable() const;
|
||||
|
||||
protected:
|
||||
virtual QString progressTitle() const = 0;
|
||||
|
||||
@@ -44,6 +44,7 @@
|
||||
#include <QTcpSocket>
|
||||
#include <QSignalSpy>
|
||||
|
||||
using namespace Utils;
|
||||
using namespace Valgrind::XmlProtocol;
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
@@ -498,7 +499,7 @@ void ValgrindMemcheckParserTest::testRealValgrind()
|
||||
qDebug() << "running exe:" << executable << " HINT: set VALGRIND_TEST_BIN to change this";
|
||||
|
||||
ProjectExplorer::Runnable debuggee;
|
||||
debuggee.executable = executable;
|
||||
debuggee.executable = FilePath::fromString(executable);
|
||||
debuggee.environment = sysEnv;
|
||||
ValgrindRunner runner;
|
||||
runner.setValgrindExecutable("valgrind");
|
||||
@@ -535,7 +536,7 @@ void ValgrindMemcheckParserTest::testValgrindStartError()
|
||||
QFETCH(QString, debuggeeArgs);
|
||||
|
||||
ProjectExplorer::Runnable debuggeeExecutable;
|
||||
debuggeeExecutable.executable = debuggee;
|
||||
debuggeeExecutable.executable = FilePath::fromString(debuggee);
|
||||
debuggeeExecutable.environment = Utils::Environment::systemEnvironment();
|
||||
debuggeeExecutable.commandLineArguments = debuggeeArgs;
|
||||
|
||||
|
||||
@@ -139,7 +139,7 @@ bool ValgrindRunner::Private::run()
|
||||
if (HostOsInfo::isMacHost())
|
||||
// May be slower to start but without it we get no filenames for symbols.
|
||||
cmd.addArg("--dsymutil=yes");
|
||||
cmd.addArg(m_debuggee.executable);
|
||||
cmd.addArg(m_debuggee.executable.toString());
|
||||
cmd.addArgs(m_debuggee.commandLineArguments, CommandLine::Raw);
|
||||
|
||||
emit q->valgrindExecuted(cmd.toUserOutput());
|
||||
@@ -190,7 +190,7 @@ void ValgrindRunner::Private::remoteProcessStarted()
|
||||
const QString proc = m_valgrindExecutable.split(' ').last();
|
||||
|
||||
Runnable findPid;
|
||||
findPid.executable = "/bin/sh";
|
||||
findPid.executable = FileName::fromString("/bin/sh");
|
||||
// sleep required since otherwise we might only match "bash -c..."
|
||||
// and not the actual valgrind run
|
||||
findPid.commandLineArguments = QString("-c \""
|
||||
@@ -200,7 +200,7 @@ void ValgrindRunner::Private::remoteProcessStarted()
|
||||
// we pick the last one, first would be "bash -c ..."
|
||||
" | awk '{print $1;}'" // get pid
|
||||
"\""
|
||||
).arg(proc, Utils::FilePath::fromString(m_debuggee.executable).fileName());
|
||||
).arg(proc, m_debuggee.executable.fileName());
|
||||
|
||||
// m_remote.m_findPID = m_remote.m_connection->createRemoteProcess(cmd.toUtf8());
|
||||
connect(&m_findPID, &ApplicationLauncher::remoteStderr,
|
||||
|
||||
@@ -79,7 +79,7 @@ QString ValgrindTestRunnerTest::runTestBinary(const QString &binary, const QStri
|
||||
return QString();
|
||||
ProjectExplorer::Runnable debuggee;
|
||||
const QString &binPath = binPathFileInfo.canonicalFilePath();
|
||||
debuggee.executable = binPath;
|
||||
debuggee.executable = Utils::FilePath::fromString(binPath);
|
||||
debuggee.environment = Utils::Environment::systemEnvironment();
|
||||
m_runner->setLocalServerAddress(QHostAddress::LocalHost);
|
||||
m_runner->setValgrindArguments(QStringList() << "--num-callers=50" << "--track-origins=yes" << vArgs);
|
||||
|
||||
Reference in New Issue
Block a user