Add valgrind base tool plugin.

Merge-request: 260
Reviewed-by: hjk <qtc-committer@nokia.com>
This commit is contained in:
Mike McQuaid
2011-03-04 12:15:18 +01:00
committed by hjk
parent 0cc448f778
commit a34719d432
15 changed files with 905 additions and 0 deletions

View File

@@ -42,6 +42,10 @@ SUBDIRS = plugin_coreplugin \
plugin_macros \ plugin_macros \
debugger/dumper.pro debugger/dumper.pro
!win32 {
SUBDIRS += plugin_valgrindtoolbase
}
linux-* { linux-* {
SUBDIRS += debugger/ptracepreload.pro SUBDIRS += debugger/ptracepreload.pro
} }
@@ -247,6 +251,12 @@ plugin_analyzerbase.subdir = analyzerbase
plugin_analyzerbase.depends = plugin_coreplugin plugin_analyzerbase.depends = plugin_coreplugin
plugin_analyzerbase.depends += plugin_projectexplorer plugin_analyzerbase.depends += plugin_projectexplorer
!win32 {
plugin_valgrindtoolbase.subdir = valgrindtoolbase
plugin_valgrindtoolbase.depends = plugin_coreplugin
plugin_valgrindtoolbase.depends += plugin_analyzerbase
}
plugin_qmljstools.subdir = qmljstools plugin_qmljstools.subdir = qmljstools
plugin_qmljstools.depends = plugin_projectexplorer plugin_qmljstools.depends = plugin_projectexplorer
plugin_qmljstools.depends += plugin_coreplugin plugin_qmljstools.depends += plugin_coreplugin

View File

@@ -0,0 +1,20 @@
<plugin name=\"ValgrindToolBase\" version=\"$$QTCREATOR_VERSION\" compatVersion=\"$$QTCREATOR_VERSION\">
<vendor>Nokia Corporation</vendor>
<copyright>(C) 2011 Nokia Corporation</copyright>
<license>
Commercial Usage
Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and Nokia.
GNU Lesser General Public License Usage
Alternatively, this plugin may be used under the terms of the GNU Lesser General Public License version 2.1 as published by the Free Software Foundation. Please review the following information to ensure the GNU Lesser General Public License version 2.1 requirements will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
</license>
<category>Code Analyzer</category>
<description>Valgrind Tool Base Plugin</description>
<url>http://qt.nokia.com</url>
<dependencyList>
<dependency name=\"Core\" version=\"$$QTCREATOR_VERSION\"/>
<dependency name=\"AnalyzerBase\" version=\"$$QTCREATOR_VERSION\"/>
</dependencyList>
</plugin>

View File

@@ -0,0 +1,75 @@
/**************************************************************************
**
** This file is part of Qt Creator Instrumentation Tools
**
** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
**
** Author: Milian Wolff, KDAB (milian.wolff@kdab.com)
**
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** No Commercial Usage
**
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** GNU Lesser General Public License Usage
**
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**************************************************************************/
#include "valgrindconfigwidget.h"
#include "ui_valgrindconfigwidget.h"
#include "valgrindsettings.h"
#include <QDebug>
using namespace Analyzer::Internal;
ValgrindConfigWidget::ValgrindConfigWidget(ValgrindSettings *settings, QWidget *parent)
: QWidget(parent),
m_settings(settings),
m_ui(new Ui::ValgrindConfigWidget)
{
m_ui->setupUi(this);
m_ui->valgrindExeChooser->setExpectedKind(Utils::PathChooser::ExistingCommand);
m_ui->valgrindExeChooser->setPromptDialogTitle(tr("Valgrind Command"));
m_ui->valgrindExeChooser->setPath(m_settings->valgrindExecutable());
connect(m_ui->valgrindExeChooser, SIGNAL(changed(QString)), SLOT(setValgrindExe(QString)));
connect(m_settings, SIGNAL(valgrindExecutableChanged(QString)), SLOT(setValgrindExe(QString)));
}
ValgrindConfigWidget::~ValgrindConfigWidget()
{
delete m_ui;
}
void ValgrindConfigWidget::setValgrindExe(const QString &exe)
{
m_ui->valgrindExeChooser->setPath(exe);
m_settings->setValgrindExecutable(exe);
}
QString ValgrindConfigWidget::valgrindExe() const
{
return m_ui->valgrindExeChooser->path();
}

View File

@@ -0,0 +1,76 @@
/**************************************************************************
**
** This file is part of Qt Creator Instrumentation Tools
**
** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
**
** Author: Milian Wolff, KDAB (milian.wolff@kdab.com)
**
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** No Commercial Usage
**
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** GNU Lesser General Public License Usage
**
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**************************************************************************/
#ifndef ANALYZER_INTERNAL_VALGRINDCONFIGWIDGET_H
#define ANALYZER_INTERNAL_VALGRINDCONFIGWIDGET_H
#include <QWidget>
QT_BEGIN_NAMESPACE
namespace Ui {
class ValgrindConfigWidget;
}
QT_END_NAMESPACE
namespace Analyzer {
namespace Internal {
class ValgrindSettings;
class ValgrindConfigWidget : public QWidget
{
Q_OBJECT
public:
ValgrindConfigWidget(ValgrindSettings *settings, QWidget *parent);
virtual ~ValgrindConfigWidget();
// ### remove the following?
QString valgrindExe() const;
public slots:
void setValgrindExe(const QString &exe);
private:
ValgrindSettings *m_settings;
Ui::ValgrindConfigWidget *m_ui;
};
}
}
#endif // ANALYZER_INTERNAL_VALGRINDCONFIGWIDGET_H

View File

@@ -0,0 +1,54 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>ValgrindConfigWidget</class>
<widget class="QWidget" name="ValgrindConfigWidget">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>445</width>
<height>543</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QGroupBox" name="commonValgrindOptions">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>1</verstretch>
</sizepolicy>
</property>
<property name="title">
<string>Common Valgrind Options</string>
</property>
<layout class="QFormLayout" name="formLayout">
<property name="fieldGrowthPolicy">
<enum>QFormLayout::ExpandingFieldsGrow</enum>
</property>
<item row="0" column="0">
<widget class="QLabel" name="valgrindExeLabel">
<property name="text">
<string>Valgrind executable:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="Utils::PathChooser" name="valgrindExeChooser" native="true"/>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>Utils::PathChooser</class>
<extends>QWidget</extends>
<header location="global">utils/pathchooser.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>

View File

@@ -0,0 +1,174 @@
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
**
** Author: Nicolas Arnaud-Cormos, KDAB (nicolas.arnaud-cormos@kdab.com)
**
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** No Commercial Usage
**
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** GNU Lesser General Public License Usage
**
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**************************************************************************/
#include "valgrindengine.h"
#include "valgrindsettings.h"
#include <coreplugin/icore.h>
#include <coreplugin/ioutputpane.h>
#include <coreplugin/progressmanager/progressmanager.h>
#include <extensionsystem/pluginmanager.h>
#include <projectexplorer/applicationrunconfiguration.h>
#define VALGRIND_DEBUG_OUTPUT 0
using namespace Analyzer;
using namespace Analyzer::Internal;
using namespace Utils;
ValgrindEngine::ValgrindEngine(ProjectExplorer::RunConfiguration *runConfiguration)
: IAnalyzerEngine(runConfiguration),
m_settings(0),
m_progress(new QFutureInterface<void>()) ,
m_isStopping(false)
{
ProjectExplorer::LocalApplicationRunConfiguration *localAppConfig =
qobject_cast<ProjectExplorer::LocalApplicationRunConfiguration *>(runConfiguration);
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();
}
ValgrindEngine::~ValgrindEngine()
{
delete m_progress;
}
void ValgrindEngine::start()
{
emit starting(this);
Core::ICore::instance()->progressManager()->addTask(m_progress->future(),
progressTitle(), "valgrind");
m_progress->reportStarted();
#if VALGRIND_DEBUG_OUTPUT
emit standardOutputReceived(tr("Valgrind options: %1").arg(toolArguments().join(" ")));
emit standardOutputReceived(tr("Working directory: %1").arg(m_workingDirectory));
emit standardOutputReceived(tr("Command-line arguments: %1").arg(m_commandLineArguments));
#endif
runner()->setWorkingDirectory(m_workingDirectory);
runner()->setValgrindExecutable(m_settings->subConfig<ValgrindSettings>()->valgrindExecutable());
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);
connect(runner(), SIGNAL(standardOutputReceived(QByteArray)),
SLOT(receiveStandardOutput(QByteArray)));
connect(runner(), SIGNAL(standardErrorReceived(QByteArray)),
SLOT(receiveStandardError(QByteArray)));
connect(runner(), SIGNAL(processErrorReceived(QString, QProcess::ProcessError)),
SLOT(receiveProcessError(QString, QProcess::ProcessError)));
connect(runner(), SIGNAL(finished()),
SLOT(runnerFinished()));
runner()->start();
}
void ValgrindEngine::stop()
{
m_isStopping = true;
runner()->stop();
}
QString ValgrindEngine::executable() const
{
return m_executable;
}
void ValgrindEngine::runnerFinished()
{
emit standardOutputReceived(tr("** Analysing finished **"));
emit finished();
m_progress->reportFinished();
disconnect(runner(), SIGNAL(standardOutputReceived(QByteArray)),
this, SLOT(receiveStandardOutput(QByteArray)));
disconnect(runner(), SIGNAL(standardErrorReceived(QByteArray)),
this, SLOT(receiveStandardError(QByteArray)));
disconnect(runner(), SIGNAL(processErrorReceived(QString, QProcess::ProcessError)),
this, SLOT(receiveProcessError(QString, QProcess::ProcessError)));
disconnect(runner(), SIGNAL(finished()),
this, SLOT(runnerFinished()));
}
void ValgrindEngine::receiveStandardOutput(const QByteArray &b)
{
emit standardOutputReceived(QString::fromLocal8Bit(b));
}
void ValgrindEngine::receiveStandardError(const QByteArray &b)
{
emit standardErrorReceived(QString::fromLocal8Bit(b));
}
void ValgrindEngine::receiveProcessError(const QString &error, QProcess::ProcessError e)
{
if (e == QProcess::FailedToStart) {
const QString &valgrind = m_settings->subConfig<ValgrindSettings>()->valgrindExecutable();
if (!valgrind.isEmpty()) {
emit standardErrorReceived(tr("** Error: \"%1\" could not be started: %2 **").arg(valgrind).arg(error));
} else {
emit standardErrorReceived(tr("** Error: no valgrind executable set **"));
}
} else if (m_isStopping && e == QProcess::Crashed) { // process gets killed on stop
emit standardErrorReceived(tr("** Process Terminated **"));
} else {
emit standardErrorReceived(QString("** %1 **").arg(error));
}
if (m_isStopping)
return;
///FIXME: get a better API for this into Qt Creator
ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance();
QList< Core::IOutputPane *> panes = pm->getObjects<Core::IOutputPane>();
foreach(Core::IOutputPane *pane, panes) {
if (pane->displayName() == tr("Application Output")) {
pane->popup(false);
break;
}
}
}

View File

@@ -0,0 +1,94 @@
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
**
** Author: Nicolas Arnaud-Cormos, KDAB (nicolas.arnaud-cormos@kdab.com)
**
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** No Commercial Usage
**
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** GNU Lesser General Public License Usage
**
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**************************************************************************/
#ifndef VALGRINDENGINE_H
#define VALGRINDENGINE_H
#include "valgrindtoolbase_global.h"
#include "ianalyzerengine.h"
#include <utils/environment.h>
#include <valgrind/valgrindrunner.h>
#include <QString>
#include <QByteArray>
#include <QFutureInterface>
namespace Analyzer {
class AnalyzerSettings;
namespace Internal {
class VALGRINDTOOLBASE_EXPORT ValgrindEngine : public IAnalyzerEngine
{
Q_OBJECT
public:
explicit ValgrindEngine(ProjectExplorer::RunConfiguration *runConfiguration);
virtual ~ValgrindEngine();
void start();
void stop();
QString executable() const;
protected:
virtual QString progressTitle() const = 0;
virtual QStringList toolArguments() const = 0;
virtual Valgrind::ValgrindRunner* runner() = 0;
AnalyzerSettings *m_settings;
QFutureInterface<void> *m_progress;
private slots:
void runnerFinished();
void receiveStandardOutput(const QByteArray &);
void receiveStandardError(const QByteArray &);
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
#endif // VALGRINDENGINE_H

View File

@@ -0,0 +1,106 @@
/**************************************************************************
**
** This file is part of Qt Creator Instrumentation Tools
**
** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
**
** Author: Milian Wolff, KDAB (milian.wolff@kdab.com)
**
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** No Commercial Usage
**
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** GNU Lesser General Public License Usage
**
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**************************************************************************/
#include "valgrindsettings.h"
#include "valgrindconfigwidget.h"
#include <coreplugin/icore.h>
#include <utils/qtcassert.h>
#include <QSettings>
using namespace Analyzer::Internal;
using namespace Analyzer;
static const QLatin1String groupC("Analyzer");
static const QLatin1String valgrindExeC("Analyzer.Valgrind.ValgrindExecutable");
ValgrindSettings::ValgrindSettings()
{
}
ValgrindSettings::~ValgrindSettings()
{}
QVariantMap ValgrindSettings::defaults() const
{
QVariantMap map;
map.insert(valgrindExeC, QLatin1String("valgrind"));
return map;
}
bool ValgrindSettings::fromMap(const QVariantMap &map)
{
setIfPresent(map, valgrindExeC, &m_valgrindExecutable);
return true;
}
QVariantMap ValgrindSettings::toMap() const
{
QVariantMap map;
map.insert(valgrindExeC, m_valgrindExecutable);
return map;
}
void ValgrindSettings::setValgrindExecutable(const QString &valgrindExecutable)
{
if (m_valgrindExecutable != valgrindExecutable) {
m_valgrindExecutable = valgrindExecutable;
emit valgrindExecutableChanged(valgrindExecutable);
}
}
QString ValgrindSettings::valgrindExecutable() const
{
return m_valgrindExecutable;
}
QString ValgrindSettings::id() const
{
return "Analyzer.Valgrind.Settings.Generic";
}
QString ValgrindSettings::displayName() const
{
return tr("Generic Settings");
}
QWidget *ValgrindSettings::createConfigWidget(QWidget *parent)
{
return new ValgrindConfigWidget(this, parent);
}

View File

@@ -0,0 +1,84 @@
/**************************************************************************
**
** This file is part of Qt Creator Instrumentation Tools
**
** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
**
** Author: Milian Wolff, KDAB (milian.wolff@kdab.com)
**
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** No Commercial Usage
**
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** GNU Lesser General Public License Usage
**
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**************************************************************************/
#ifndef ANALYZER_INTERNAL_VALGRINDSETTINGS_H
#define ANALYZER_INTERNAL_VALGRINDSETTINGS_H
#include <analyzerbase/analyzersettings.h>
#include "valgrindtoolbase_global.h"
#include <QObject>
#include <QVariant>
namespace Analyzer {
namespace Internal {
/**
* Generic Valgrind settings shared by all tools.
*/
class VALGRINDTOOLBASE_EXPORT ValgrindSettings : public AbstractAnalyzerSubConfig
{
Q_OBJECT
public:
ValgrindSettings();
virtual ~ValgrindSettings();
virtual QVariantMap toMap() const;
virtual QVariantMap defaults() const;
QString valgrindExecutable() const;
virtual QString id() const;
virtual QString displayName() const;
virtual QWidget *createConfigWidget(QWidget *parent);
public slots:
void setValgrindExecutable(const QString &);
signals:
void valgrindExecutableChanged(const QString &);
protected:
virtual bool fromMap(const QVariantMap &map);
private:
QString m_valgrindExecutable;
};
}
}
#endif // VALGRIND_INTERNAL_ANALZYZERSETTINGS_H

View File

@@ -0,0 +1,5 @@
include(valgrindtoolbase_dependencies.pri)
INCLUDEPATH += $$PWD
DEPENDPATH += $$PWD
LIBS *= -l$$qtLibraryName(ValgrindToolBase)

View File

@@ -0,0 +1,27 @@
TEMPLATE = lib
TARGET = ValgrindToolBase
DEFINES += VALGRINDTOOLBASE_LIBRARY
include(../../qtcreatorplugin.pri)
include(valgrindtoolbase_dependencies.pri)
QT += network
# Valgrind Tool Base files
HEADERS += \
valgrindtoolbaseplugin.h \
valgrindtoolbase_global.h \
valgrindengine.h \
valgrindconfigwidget.h \
valgrindsettings.h
SOURCES += \
valgrindtoolbaseplugin.cpp \
valgrindengine.cpp \
valgrindconfigwidget.cpp \
valgrindsettings.cpp
FORMS += \
valgrindconfigwidget.ui

View File

@@ -0,0 +1,3 @@
include(../../plugins/coreplugin/coreplugin.pri)
include(../../plugins/analyzerbase/analyzerbase.pri)
include(../../libs/valgrind/valgrind.pri)

View File

@@ -0,0 +1,47 @@
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
**
** Author: Nicolas Arnaud-Cormos, KDAB (nicolas.arnaud-cormos@kdab.com)
**
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** No Commercial Usage
**
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** GNU Lesser General Public License Usage
**
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**************************************************************************/
#ifndef VALGRINDTOOLBASE_GLOBAL_H
#define VALGRINDTOOLBASE_GLOBAL_H
#include <QtCore/qglobal.h>
#if defined(VALGRINDTOOLBASE_LIBRARY)
# define VALGRINDTOOLBASE_EXPORT Q_DECL_EXPORT
#else
# define VALGRINDTOOLBASE_EXPORT Q_DECL_IMPORT
#endif
#endif // VALGRINDTOOLBASE_GLOBAL_H

View File

@@ -0,0 +1,71 @@
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
**
** Author: Milian Wolff, KDAB (milian.wolff@kdab.com)
**
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** No Commercial Usage
**
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** GNU Lesser General Public License Usage
**
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**************************************************************************/
#include "valgrindtoolbaseplugin.h"
#include "valgrindsettings.h"
#include <analyzerbase/analyzersettings.h>
#include <QStringList>
#include <QtPlugin>
using namespace Analyzer;
using namespace Analyzer::Internal;
ValgrindToolbasePlugin::ValgrindToolbasePlugin()
{
}
ValgrindToolbasePlugin::~ValgrindToolbasePlugin()
{
}
bool ValgrindToolbasePlugin::initialize(const QStringList &/*arguments*/, QString */*errorString*/)
{
typedef AnalyzerSubConfigFactory<ValgrindSettings, ValgrindSettings> ValgrindConfigFactory;
AnalyzerGlobalSettings::instance()->registerSubConfigFactory(new ValgrindConfigFactory);
return true;
}
void ValgrindToolbasePlugin::extensionsInitialized()
{
}
Q_EXPORT_PLUGIN(ValgrindToolbasePlugin)

View File

@@ -0,0 +1,59 @@
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
**
** Author: Milian Wolff, KDAB (milian.wolff@kdab.com)
**
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** No Commercial Usage
**
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** GNU Lesser General Public License Usage
**
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**************************************************************************/
#ifndef VALGRINDTOOLBASEPLUGIN_H
#define VALGRINDTOOLBASEPLUGIN_H
#include <extensionsystem/iplugin.h>
namespace Analyzer {
namespace Internal {
class ValgrindToolbasePlugin : public ExtensionSystem::IPlugin
{
Q_OBJECT
public:
ValgrindToolbasePlugin();
~ValgrindToolbasePlugin();
virtual bool initialize(const QStringList &arguments, QString *errorString);
virtual void extensionsInitialized();
};
} // namespace Internal
}
#endif // VALGRINDTOOLBASEPLUGIN_H