2012-10-02 09:12:39 +02:00
|
|
|
/****************************************************************************
|
2011-03-04 12:15:19 +01:00
|
|
|
**
|
2013-01-28 17:12:19 +01:00
|
|
|
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
|
2012-10-02 09:12:39 +02:00
|
|
|
** Contact: http://www.qt-project.org/legal
|
2011-03-04 12:15:19 +01:00
|
|
|
** Author: Nicolas Arnaud-Cormos, KDAB (nicolas.arnaud-cormos@kdab.com)
|
|
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** This file is part of Qt Creator.
|
2011-03-04 12:15:19 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** Commercial License Usage
|
|
|
|
|
** Licensees holding valid commercial Qt licenses may use this file in
|
|
|
|
|
** accordance with the commercial license agreement provided with the
|
|
|
|
|
** Software or, alternatively, in accordance with the terms contained in
|
|
|
|
|
** a written agreement between you and Digia. For licensing terms and
|
|
|
|
|
** conditions see http://qt.digia.com/licensing. For further information
|
|
|
|
|
** use the contact form at http://qt.digia.com/contact-us.
|
2011-03-04 12:15:19 +01:00
|
|
|
**
|
|
|
|
|
** GNU Lesser General Public License Usage
|
2012-10-02 09:12:39 +02:00
|
|
|
** 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.
|
2011-03-04 12:15:19 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** In addition, as a special exception, Digia gives you certain additional
|
|
|
|
|
** rights. These rights are described in the Digia Qt LGPL Exception
|
2011-03-04 12:15:19 +01:00
|
|
|
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
|
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
****************************************************************************/
|
2011-03-04 12:15:19 +01:00
|
|
|
|
|
|
|
|
#ifndef MEMCHECKTOOL_H
|
|
|
|
|
#define MEMCHECKTOOL_H
|
|
|
|
|
|
2013-08-07 17:54:35 +02:00
|
|
|
#include "valgrindtool.h"
|
2011-03-04 12:15:19 +01:00
|
|
|
|
2012-02-15 10:42:41 +01:00
|
|
|
#include <QSortFilterProxyModel>
|
2011-03-04 12:15:19 +01:00
|
|
|
|
|
|
|
|
QT_BEGIN_NAMESPACE
|
|
|
|
|
class QModelIndex;
|
|
|
|
|
class QAction;
|
2011-03-10 16:11:20 +01:00
|
|
|
class QMenu;
|
2011-03-04 12:15:19 +01:00
|
|
|
QT_END_NAMESPACE
|
|
|
|
|
|
|
|
|
|
namespace Valgrind {
|
|
|
|
|
namespace XmlProtocol {
|
|
|
|
|
class ErrorListModel;
|
|
|
|
|
class Error;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2011-05-23 13:50:28 +02:00
|
|
|
namespace Valgrind {
|
2011-03-04 12:15:19 +01:00
|
|
|
namespace Internal {
|
2011-05-20 09:12:34 +02:00
|
|
|
|
2011-03-04 12:15:19 +01:00
|
|
|
class FrameFinder;
|
2013-08-08 17:37:37 +02:00
|
|
|
class MemcheckErrorView;
|
|
|
|
|
class ValgrindBaseSettings;
|
2011-03-04 12:15:19 +01:00
|
|
|
|
|
|
|
|
class MemcheckErrorFilterProxyModel : public QSortFilterProxyModel
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
2011-05-20 09:12:34 +02:00
|
|
|
|
2011-03-04 12:15:19 +01:00
|
|
|
public:
|
|
|
|
|
MemcheckErrorFilterProxyModel(QObject *parent = 0);
|
|
|
|
|
|
|
|
|
|
public slots:
|
|
|
|
|
void setAcceptedKinds(const QList<int> &acceptedKinds);
|
|
|
|
|
void setFilterExternalIssues(bool filter);
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const;
|
2011-05-20 09:12:34 +02:00
|
|
|
|
2011-03-04 12:15:19 +01:00
|
|
|
private:
|
|
|
|
|
QList<int> m_acceptedKinds;
|
|
|
|
|
bool m_filterExternalIssues;
|
|
|
|
|
};
|
|
|
|
|
|
2013-08-07 17:54:35 +02:00
|
|
|
class MemcheckTool : public ValgrindTool
|
2011-03-04 12:15:19 +01:00
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
2011-05-20 09:12:34 +02:00
|
|
|
|
2011-03-04 12:15:19 +01:00
|
|
|
public:
|
2011-06-30 18:55:48 +02:00
|
|
|
MemcheckTool(QObject *parent);
|
2011-03-04 12:15:19 +01:00
|
|
|
|
2012-01-10 19:17:24 +01:00
|
|
|
ProjectExplorer::RunMode runMode() const;
|
2011-03-04 12:15:19 +01:00
|
|
|
|
|
|
|
|
private slots:
|
|
|
|
|
void settingsDestroyed(QObject *settings);
|
|
|
|
|
void maybeActiveRunConfigurationChanged();
|
|
|
|
|
|
2013-07-30 14:08:01 +02:00
|
|
|
void engineStarting(const Analyzer::AnalyzerRunControl *engine);
|
2011-04-04 14:39:29 +02:00
|
|
|
void finished();
|
|
|
|
|
|
2011-03-04 12:15:19 +01:00
|
|
|
void parserError(const Valgrind::XmlProtocol::Error &error);
|
|
|
|
|
void internalParserError(const QString &errorString);
|
|
|
|
|
void updateErrorFilter();
|
|
|
|
|
void suppressionActionTriggered();
|
|
|
|
|
|
|
|
|
|
private:
|
2011-07-01 14:19:12 +02:00
|
|
|
ToolMode toolMode() const;
|
2011-07-06 16:52:14 +02:00
|
|
|
QWidget *createWidgets();
|
2011-12-13 14:01:52 +01:00
|
|
|
void setBusyCursor(bool busy);
|
2011-06-27 15:43:15 +02:00
|
|
|
|
2013-07-30 14:08:01 +02:00
|
|
|
Analyzer::AnalyzerRunControl *createRunControl(const Analyzer::AnalyzerStartParameters &sp,
|
2011-06-27 15:43:15 +02:00
|
|
|
ProjectExplorer::RunConfiguration *runConfiguration = 0);
|
|
|
|
|
|
|
|
|
|
void clearErrorView();
|
2011-04-04 14:39:29 +02:00
|
|
|
|
2011-06-30 13:44:22 +02:00
|
|
|
private:
|
2013-08-08 17:37:37 +02:00
|
|
|
ValgrindBaseSettings *m_settings;
|
2011-06-27 15:43:15 +02:00
|
|
|
QMenu *m_filterMenu;
|
2011-03-04 12:15:19 +01:00
|
|
|
|
|
|
|
|
FrameFinder *m_frameFinder;
|
|
|
|
|
Valgrind::XmlProtocol::ErrorListModel *m_errorModel;
|
|
|
|
|
MemcheckErrorFilterProxyModel *m_errorProxyModel;
|
|
|
|
|
MemcheckErrorView *m_errorView;
|
|
|
|
|
|
|
|
|
|
QList<QAction *> m_errorFilterActions;
|
|
|
|
|
QAction *m_filterProjectAction;
|
|
|
|
|
QList<QAction *> m_suppressionActions;
|
|
|
|
|
QAction *m_suppressionSeparator;
|
2011-06-27 15:43:15 +02:00
|
|
|
QAction *m_goBack;
|
|
|
|
|
QAction *m_goNext;
|
2011-03-04 12:15:19 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace Internal
|
2011-05-23 13:50:28 +02:00
|
|
|
} // namespace Valgrind
|
2011-03-04 12:15:19 +01:00
|
|
|
|
|
|
|
|
#endif // MEMCHECKTOOL_H
|