forked from qt-creator/qt-creator
Update valgrind plugin namespace and use new APIs.
Merge-request: 284 Reviewed-by: hjk <qtc-committer@nokia.com>
This commit is contained in:
@@ -41,7 +41,7 @@
|
||||
|
||||
#include <QtCore/QDebug>
|
||||
|
||||
using namespace Analyzer::Internal;
|
||||
using namespace Valgrind::Internal;
|
||||
|
||||
ValgrindConfigWidget::ValgrindConfigWidget(ValgrindSettings *settings, QWidget *parent)
|
||||
: QWidget(parent),
|
||||
|
||||
@@ -39,14 +39,12 @@
|
||||
|
||||
#include <QtGui/QWidget>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
namespace Valgrind {
|
||||
namespace Internal {
|
||||
|
||||
namespace Ui {
|
||||
class ValgrindConfigWidget;
|
||||
}
|
||||
QT_END_NAMESPACE
|
||||
|
||||
namespace Analyzer {
|
||||
namespace Internal {
|
||||
|
||||
class ValgrindSettings;
|
||||
|
||||
@@ -64,7 +62,6 @@ private:
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif // ANALYZER_INTERNAL_VALGRINDCONFIGWIDGET_H
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>ValgrindConfigWidget</class>
|
||||
<widget class="QWidget" name="ValgrindConfigWidget">
|
||||
<class>Valgrind::Internal::ValgrindConfigWidget</class>
|
||||
<widget class="QWidget" name="Valgrind::Internal::ValgrindConfigWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
@@ -20,7 +20,7 @@
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Common Valgrind Options</string>
|
||||
<string>Generic Settings</string>
|
||||
</property>
|
||||
<layout class="QFormLayout" name="formLayout">
|
||||
<property name="fieldGrowthPolicy">
|
||||
|
||||
@@ -46,26 +46,21 @@
|
||||
#define VALGRIND_DEBUG_OUTPUT 0
|
||||
|
||||
using namespace Analyzer;
|
||||
using namespace Analyzer::Internal;
|
||||
using namespace Valgrind::Internal;
|
||||
using namespace Utils;
|
||||
|
||||
ValgrindEngine::ValgrindEngine(ProjectExplorer::RunConfiguration *runConfiguration)
|
||||
: IAnalyzerEngine(runConfiguration),
|
||||
ValgrindEngine::ValgrindEngine(const AnalyzerStartParameters &sp,
|
||||
ProjectExplorer::RunConfiguration *runConfiguration)
|
||||
: IAnalyzerEngine(sp, runConfiguration),
|
||||
m_settings(0),
|
||||
m_progress(new QFutureInterface<void>()) ,
|
||||
m_isStopping(false)
|
||||
{
|
||||
ProjectExplorer::LocalApplicationRunConfiguration *localAppConfig =
|
||||
qobject_cast<ProjectExplorer::LocalApplicationRunConfiguration *>(runConfiguration);
|
||||
if (runConfiguration)
|
||||
m_settings = runConfiguration->extraAspect<AnalyzerProjectSettings>();
|
||||
|
||||
m_settings = runConfiguration->extraAspect<AnalyzerProjectSettings>();
|
||||
if (!localAppConfig || !m_settings)
|
||||
return;
|
||||
|
||||
m_workingDirectory = localAppConfig->workingDirectory();
|
||||
m_executable = localAppConfig->executable();
|
||||
m_commandLineArguments = localAppConfig->commandLineArguments();
|
||||
m_environment = localAppConfig->environment();
|
||||
if (!m_settings)
|
||||
m_settings = AnalyzerGlobalSettings::instance();
|
||||
}
|
||||
|
||||
ValgrindEngine::~ValgrindEngine()
|
||||
@@ -77,7 +72,7 @@ void ValgrindEngine::start()
|
||||
{
|
||||
emit starting(this);
|
||||
|
||||
Core::FutureProgress* fp = Core::ICore::instance()->progressManager()->addTask(m_progress->future(),
|
||||
Core::FutureProgress *fp = Core::ICore::instance()->progressManager()->addTask(m_progress->future(),
|
||||
progressTitle(), "valgrind");
|
||||
fp->setKeepOnFinish(Core::FutureProgress::DontKeepOnFinish);
|
||||
m_progress->reportStarted();
|
||||
@@ -88,13 +83,16 @@ void ValgrindEngine::start()
|
||||
emit standardOutputReceived(tr("Command-line arguments: %1").arg(m_commandLineArguments));
|
||||
#endif
|
||||
|
||||
runner()->setWorkingDirectory(m_workingDirectory);
|
||||
runner()->setValgrindExecutable(m_settings->subConfig<ValgrindSettings>()->valgrindExecutable());
|
||||
const AnalyzerStartParameters &sp = startParameters();
|
||||
runner()->setWorkingDirectory(sp.workingDirectory);
|
||||
QString valgrindExe = m_settings->subConfig<ValgrindSettings>()->valgrindExecutable();
|
||||
if (!sp.analyzerCmdPrefix.isEmpty())
|
||||
valgrindExe = sp.analyzerCmdPrefix + ' ' + valgrindExe;
|
||||
runner()->setValgrindExecutable(valgrindExe);
|
||||
runner()->setValgrindArguments(toolArguments());
|
||||
runner()->setDebuggeeExecutable(m_executable);
|
||||
// note that m_commandLineArguments may contain several arguments in one string
|
||||
runner()->setDebuggeeArguments(m_commandLineArguments);
|
||||
runner()->setEnvironment(m_environment);
|
||||
runner()->setDebuggeeExecutable(sp.debuggee);
|
||||
runner()->setDebuggeeArguments(sp.debuggeeArgs);
|
||||
runner()->setEnvironment(sp.environment);
|
||||
|
||||
connect(runner(), SIGNAL(standardOutputReceived(QByteArray)),
|
||||
SLOT(receiveStandardOutput(QByteArray)));
|
||||
@@ -105,7 +103,10 @@ void ValgrindEngine::start()
|
||||
connect(runner(), SIGNAL(finished()),
|
||||
SLOT(runnerFinished()));
|
||||
|
||||
runner()->start();
|
||||
if (sp.startMode == StartRemote)
|
||||
runner()->startRemotely(sp.connParams);
|
||||
else
|
||||
runner()->start();
|
||||
}
|
||||
|
||||
void ValgrindEngine::stop()
|
||||
@@ -116,12 +117,12 @@ void ValgrindEngine::stop()
|
||||
|
||||
QString ValgrindEngine::executable() const
|
||||
{
|
||||
return m_executable;
|
||||
return startParameters().debuggee;
|
||||
}
|
||||
|
||||
void ValgrindEngine::runnerFinished()
|
||||
{
|
||||
emit standardOutputReceived(tr("** Analysing finished **"));
|
||||
emit standardOutputReceived(tr("** Analyzing finished **"));
|
||||
emit finished();
|
||||
|
||||
m_progress->reportFinished();
|
||||
|
||||
@@ -36,6 +36,8 @@
|
||||
#ifndef VALGRINDENGINE_H
|
||||
#define VALGRINDENGINE_H
|
||||
|
||||
#include <analyzerbase/ianalyzerengine.h>
|
||||
|
||||
#include "valgrindtoolbase_global.h"
|
||||
|
||||
#include <analyzerbase/ianalyzerengine.h>
|
||||
@@ -49,16 +51,18 @@
|
||||
#include <QtCore/QFutureInterface>
|
||||
|
||||
namespace Analyzer {
|
||||
|
||||
class AnalyzerSettings;
|
||||
}
|
||||
|
||||
namespace Valgrind {
|
||||
namespace Internal {
|
||||
|
||||
class VALGRINDTOOLBASE_EXPORT ValgrindEngine : public IAnalyzerEngine
|
||||
class VALGRINDTOOLBASE_EXPORT ValgrindEngine : public Analyzer::IAnalyzerEngine
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit ValgrindEngine(ProjectExplorer::RunConfiguration *runConfiguration);
|
||||
explicit ValgrindEngine(const Analyzer::AnalyzerStartParameters &sp,
|
||||
ProjectExplorer::RunConfiguration *runConfiguration);
|
||||
virtual ~ValgrindEngine();
|
||||
|
||||
void start();
|
||||
@@ -71,7 +75,7 @@ protected:
|
||||
virtual QStringList toolArguments() const = 0;
|
||||
virtual Valgrind::ValgrindRunner *runner() = 0;
|
||||
|
||||
AnalyzerSettings *m_settings;
|
||||
Analyzer::AnalyzerSettings *m_settings;
|
||||
QFutureInterface<void> *m_progress;
|
||||
|
||||
private slots:
|
||||
@@ -82,14 +86,10 @@ private slots:
|
||||
void receiveProcessError(const QString &, QProcess::ProcessError);
|
||||
|
||||
private:
|
||||
QString m_workingDirectory;
|
||||
QString m_executable;
|
||||
QString m_commandLineArguments;
|
||||
Utils::Environment m_environment;
|
||||
bool m_isStopping;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace Analyzer
|
||||
} // namespace Valgrind
|
||||
|
||||
#endif // VALGRINDENGINE_H
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
|
||||
#include <QtCore/QSettings>
|
||||
|
||||
using namespace Analyzer::Internal;
|
||||
using namespace Valgrind::Internal;
|
||||
using namespace Analyzer;
|
||||
|
||||
static const QLatin1String groupC("Analyzer");
|
||||
|
||||
@@ -43,13 +43,13 @@
|
||||
#include <QtCore/QObject>
|
||||
#include <QtCore/QVariant>
|
||||
|
||||
namespace Analyzer {
|
||||
namespace Valgrind {
|
||||
namespace Internal {
|
||||
|
||||
/**
|
||||
* Generic Valgrind settings shared by all tools.
|
||||
*/
|
||||
class VALGRINDTOOLBASE_EXPORT ValgrindSettings : public AbstractAnalyzerSubConfig
|
||||
class VALGRINDTOOLBASE_EXPORT ValgrindSettings : public Analyzer::AbstractAnalyzerSubConfig
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
#include <QtCore/QtPlugin>
|
||||
|
||||
using namespace Analyzer;
|
||||
using namespace Analyzer::Internal;
|
||||
using namespace Valgrind::Internal;
|
||||
|
||||
ValgrindToolbasePlugin::ValgrindToolbasePlugin()
|
||||
{
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
|
||||
#include <extensionsystem/iplugin.h>
|
||||
|
||||
namespace Analyzer {
|
||||
namespace Valgrind {
|
||||
namespace Internal {
|
||||
|
||||
class ValgrindToolbasePlugin : public ExtensionSystem::IPlugin
|
||||
|
||||
Reference in New Issue
Block a user