Commit 8bb99e4c authored by hjk's avatar hjk Committed by Friedemann Kleint

analyzer: merge valgrind based tool plugins

It is hard to imagine there is a real use case that someone wants one but
absolutely not the other.

Change-Id: I58bb57912f2edeacf2d5a24e3b2eb5a81262eabd
Reviewed-on: http://codereview.qt.nokia.com/66Reviewed-by: default avatarQt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: default avatarFriedemann Kleint <Friedemann.Kleint@nokia.com>
parent 84f60e5f
<plugin name=\"Callgrind\" 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 Callgrind Tool Plugin</description>
<url>http://qt.nokia.com</url>
<dependencyList>
<dependency name=\"Core\" version=\"$$QTCREATOR_VERSION\"/>
<dependency name=\"TextEditor\" version=\"$$QTCREATOR_VERSION\"/>
<dependency name=\"AnalyzerBase\" version=\"$$QTCREATOR_VERSION\"/>
<dependency name=\"ValgrindToolBase\" version=\"$$QTCREATOR_VERSION\"/>
</dependencyList>
</plugin>
include(callgrind_dependencies.pri)
INCLUDEPATH += $$PWD
DEPENDPATH += $$PWD
LIBS *= -l$$qtLibraryName(Callgrind)
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation (info@qt.nokia.com)
**
**
** GNU Lesser General Public License Usage
**
** 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.
**
** Other Usage
**
** Alternatively, this file may be used in accordance with the terms and
** conditions contained in a signed written agreement between you and Nokia.
**
** If you have questions regarding the use of this file, please contact
** Nokia at info@qt.nokia.com.
**
**************************************************************************/
#ifndef CALLGRIND_GLOBAL_H
#define CALLGRIND_GLOBAL_H
#include <QtCore/qglobal.h>
#if defined(CALLGRIND_LIBRARY)
# define CALLGRINDSHARED_EXPORT Q_DECL_EXPORT
#else
# define CALLGRINDSHARED_EXPORT Q_DECL_IMPORT
#endif
#endif // CALLGRIND_GLOBAL_H
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation (info@qt.nokia.com)
**
**
** GNU Lesser General Public License Usage
**
** 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.
**
** Other Usage
**
** Alternatively, this file may be used in accordance with the terms and
** conditions contained in a signed written agreement between you and Nokia.
**
** If you have questions regarding the use of this file, please contact
** Nokia at info@qt.nokia.com.
**
**************************************************************************/
#ifndef CALLGRINDCONSTANTS_H
#define CALLGRINDCONSTANTS_H
#endif // CALLGRINDCONSTANTS_H
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation (info@qt.nokia.com)
**
**
** GNU Lesser General Public License Usage
**
** 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.
**
** Other Usage
**
** Alternatively, this file may be used in accordance with the terms and
** conditions contained in a signed written agreement between you and Nokia.
**
** If you have questions regarding the use of this file, please contact
** Nokia at info@qt.nokia.com.
**
**************************************************************************/
#include "callgrindplugin.h"
#include "callgrindtool.h"
#include "callgrindsettings.h"
#include <analyzerbase/analyzermanager.h>
#include <QtCore/QStringList>
#include <QtCore/QtPlugin>
using namespace Analyzer;
namespace Callgrind {
namespace Internal {
static Analyzer::AbstractAnalyzerSubConfig *globalFactory()
{
return new CallgrindGlobalSettings();
}
static Analyzer::AbstractAnalyzerSubConfig *projectFactory()
{
return new CallgrindProjectSettings();
}
bool CallgrindPlugin::initialize(const QStringList &/*arguments*/, QString */*errorString*/)
{
AnalyzerGlobalSettings::instance()->registerSubConfigs(&globalFactory, &projectFactory);
AnalyzerManager::instance()->addTool(new CallgrindTool(this));
return true;
}
void CallgrindPlugin::extensionsInitialized()
{
}
} // namespace Internal
} // namespace Callgrind
Q_EXPORT_PLUGIN(Callgrind::Internal::CallgrindPlugin)
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation (info@qt.nokia.com)
**
**
** GNU Lesser General Public License Usage
**
** 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.
**
** Other Usage
**
** Alternatively, this file may be used in accordance with the terms and
** conditions contained in a signed written agreement between you and Nokia.
**
** If you have questions regarding the use of this file, please contact
** Nokia at info@qt.nokia.com.
**
**************************************************************************/
#ifndef CALLGRINDTOOL_H
#define CALLGRINDTOOL_H
#include <analyzerbase/ianalyzertool.h>
#include <QtCore/QVector>
QT_BEGIN_NAMESPACE
class QAction;
class QMenu;
QT_END_NAMESPACE
namespace Valgrind {
namespace Callgrind {
class Function;
class ParseData;
}
}
namespace TextEditor {
class ITextEditor;
}
namespace Core {
class IEditor;
}
namespace Callgrind {
namespace Internal {
class CallgrindEngine;
class CallgrindWidgetHandler;
class CallgrindTextMark;
class CallgrindTool : public Analyzer::IAnalyzerTool
{
Q_OBJECT
public:
explicit CallgrindTool(QObject *parent = 0);
virtual ~CallgrindTool();
virtual QString id() const;
virtual QString displayName() const;
virtual ToolMode mode() const;
virtual void initialize();
virtual void extensionsInitialized();
virtual void initializeDockWidgets();
virtual Analyzer::IAnalyzerEngine *createEngine(const Analyzer::AnalyzerStartParameters &sp,
ProjectExplorer::RunConfiguration *runConfiguration = 0);
virtual QWidget *createControlWidget();
// For the output pane adapter.
void clearErrorView();
virtual bool canRunRemotely() const;
bool needsOutputPane() const { return false; }
signals:
void dumpRequested();
void resetRequested();
void pauseToggled(bool checked);
void profilingStartRequested(const QString &toggleCollectFunction);
private slots:
void showParserResults(const Valgrind::Callgrind::ParseData *data);
void slotRequestDump();
void slotFunctionSelected(const Valgrind::Callgrind::Function *);
void editorOpened(Core::IEditor *);
void requestContextMenu(TextEditor::ITextEditor *editor, int line, QMenu *menu);
void handleShowCostsAction();
void handleShowCostsOfFunction();
void takeParserData(CallgrindEngine *engine);
void engineStarting(const Analyzer::IAnalyzerEngine *);
void engineFinished();
private:
/// This function will add custom text marks to the editor
/// \note Call this after the data model has been populated
void createTextMarks();
/// This function will clear all text marks from the editor
void clearTextMarks();
CallgrindWidgetHandler *m_callgrindWidgetHandler;
QVector<CallgrindTextMark *> m_textMarks;
QAction *m_dumpAction;
QAction *m_resetAction;
QAction *m_pauseAction;
QAction *m_showCostsOfFunctionAction;
QWidget *m_toolbarWidget;
QString m_toggleCollectFunction;
};
} // namespace Internal
} // namespace Callgrind
#endif // CALLGRINDTOOL_H
<plugin name=\"Memcheck\" 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 Memcheck Tool Plugin</description>
<url>http://qt.nokia.com</url>
<dependencyList>
<dependency name=\"Core\" version=\"$$QTCREATOR_VERSION\"/>
<dependency name=\"AnalyzerBase\" version=\"$$QTCREATOR_VERSION\"/>
<dependency name=\"ValgrindToolBase\" version=\"$$QTCREATOR_VERSION\"/>
</dependencyList>
</plugin>
include(memcheck_dependencies.pri)
INCLUDEPATH += $$PWD
LIBS *= -l$$qtLibraryName(Memcheck)
include(../../plugins/coreplugin/coreplugin.pri)
include(../../plugins/analyzerbase/analyzerbase.pri)
include(../../plugins/valgrindtoolbase/valgrindtoolbase.pri)
/**************************************************************************
**
** 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 (info@qt.nokia.com)
**
**
** GNU Lesser General Public License Usage
**
** 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.
**
** Other Usage
**
** Alternatively, this file may be used in accordance with the terms and
** conditions contained in a signed written agreement between you and Nokia.
**
** If you have questions regarding the use of this file, please contact
** Nokia at info@qt.nokia.com.
**
**************************************************************************/
#ifndef MEMCHECK_GLOBAL_H
#define MEMCHECK_GLOBAL_H
#include <QtCore/qglobal.h>
#if defined(MEMCHECK_LIBRARY)
# define MEMCHECKSHARED_EXPORT Q_DECL_EXPORT
#else
# define MEMCHECKSHARED_EXPORT Q_DECL_IMPORT
#endif
#endif // MEMCHECK_GLOBAL_H
/**************************************************************************
**
** 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 (info@qt.nokia.com)
**
**
** GNU Lesser General Public License Usage
**
** 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.
**
** Other Usage
**
** Alternatively, this file may be used in accordance with the terms and
** conditions contained in a signed written agreement between you and Nokia.
**
** If you have questions regarding the use of this file, please contact
** Nokia at info@qt.nokia.com.
**
**************************************************************************/
#ifndef MEMCHECKPLUGIN_H
#define MEMCHECKPLUGIN_H
#include <extensionsystem/iplugin.h>
namespace Memcheck {
namespace Internal {
class MemcheckPlugin : public ExtensionSystem::IPlugin
{
Q_OBJECT
public:
MemcheckPlugin() {}
virtual bool initialize(const QStringList &arguments, QString *errorString);
virtual void extensionsInitialized();
};
} // namespace Internal
} // namespace Memcheck
#endif // MEMCHECKPLUGIN_H
......@@ -44,9 +44,7 @@ SUBDIRS = plugin_coreplugin \
plugin_qmlprofiler
!win32 {
SUBDIRS += plugin_valgrindtoolbase \
plugin_memcheck \
plugin_callgrind
SUBDIRS += plugin_valgrind
}
linux-* {
......@@ -256,19 +254,9 @@ plugin_analyzerbase.depends = plugin_coreplugin
plugin_analyzerbase.depends += plugin_projectexplorer
!win32 {
plugin_valgrindtoolbase.subdir = valgrindtoolbase
plugin_valgrindtoolbase.depends = plugin_coreplugin
plugin_valgrindtoolbase.depends += plugin_analyzerbase
plugin_memcheck.subdir = memcheck
plugin_memcheck.depends = plugin_coreplugin
plugin_memcheck.depends += plugin_analyzerbase
plugin_memcheck.depends += plugin_valgrindtoolbase
plugin_callgrind.subdir = callgrind
plugin_callgrind.depends = plugin_coreplugin
plugin_callgrind.depends += plugin_analyzerbase
plugin_callgrind.depends += plugin_valgrindtoolbase
plugin_valgrind.subdir = valgrind
plugin_valgrind.depends = plugin_coreplugin
plugin_valgrind.depends += plugin_analyzerbase
}
plugin_qmlprofiler.subdir = qmlprofiler
......
<plugin name=\"ValgrindToolBase\" version=\"$$QTCREATOR_VERSION\" compatVersion=\"$$QTCREATOR_VERSION\">
<plugin name=\"Valgrind\" version=\"$$QTCREATOR_VERSION\" compatVersion=\"$$QTCREATOR_VERSION\">
<vendor>Nokia Corporation</vendor>
<copyright>(C) 2011 Nokia Corporation</copyright>
<license>
......@@ -11,7 +11,7 @@ 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>
<description>Valgrind Plugin</description>
<url>http://qt.nokia.com</url>
<dependencyList>
<dependency name=\"Core\" version=\"$$QTCREATOR_VERSION\"/>
......
......@@ -36,7 +36,7 @@
#include "callgrindsettings.h"
using namespace Callgrind::Internal;
using namespace Valgrind::Internal;
CallgrindConfigWidget::CallgrindConfigWidget(AbstractCallgrindSettings *settings, QWidget *parent)
: QWidget(parent)
......
......@@ -35,7 +35,7 @@
#include <QtGui/QWidget>
namespace Callgrind {
namespace Valgrind {
namespace Internal {
namespace Ui {
......@@ -56,6 +56,6 @@ private:
};
} // namespace Internal
} // namespace Callgrind
} // namespace Valgrind
#endif // ANALYZER_INTERNAL_CALLGRINDCONFIGWIDGET_H
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>Callgrind::Internal::CallgrindConfigWidget</class>
<widget class="QWidget" name="Callgrind::Internal::CallgrindConfigWidget">
<class>Valgrind::Internal::CallgrindConfigWidget</class>
<widget class="QWidget" name="Valgrind::Internal::CallgrindConfigWidget">
<property name="geometry">
<rect>
<x>0</x>
......
......@@ -45,7 +45,7 @@
using namespace Valgrind::Callgrind;
namespace Callgrind {
namespace Valgrind {
namespace Internal {
class CostDelegate::Private
......@@ -177,5 +177,5 @@ QSize CostDelegate::sizeHint(const QStyleOptionViewItem &option, const QModelInd
return size;
}
} // Internal
} // Callgrind
} // namespace Internal
} // namespace Valgrind
......@@ -35,7 +35,7 @@
#include <QtGui/QStyledItemDelegate>
namespace Callgrind {
namespace Valgrind {
namespace Internal {
class CostDelegate : public QStyledItemDelegate
......@@ -67,9 +67,9 @@ private:
Private *d;
};
} // Internal
} // Callgrind
} // namespace Internal
} // namespace Valgrind
Q_DECLARE_METATYPE(Callgrind::Internal::CostDelegate::CostFormat)
Q_DECLARE_METATYPE(Valgrind::Internal::CostDelegate::CostFormat)
#endif // CALLGRINDCOSTDELEGATE_H