2012-10-02 09:12:39 +02:00
|
|
|
/****************************************************************************
|
2011-03-04 12:15:19 +01:00
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** Copyright (C) 2016 The Qt Company Ltd.
|
2011-03-04 12:15:19 +01:00
|
|
|
** Author: Nicolas Arnaud-Cormos, KDAB (nicolas.arnaud-cormos@kdab.com)
|
2016-01-15 14:57:40 +01:00
|
|
|
** Contact: https://www.qt.io/licensing/
|
2011-03-04 12:15:19 +01:00
|
|
|
**
|
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
|
2016-01-15 14:57:40 +01:00
|
|
|
** a written agreement between you and The Qt Company. For licensing terms
|
|
|
|
|
** and conditions see https://www.qt.io/terms-conditions. For further
|
|
|
|
|
** information use the contact form at https://www.qt.io/contact-us.
|
2011-03-04 12:15:19 +01:00
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** GNU General Public License Usage
|
|
|
|
|
** Alternatively, this file may be used under the terms of the GNU
|
|
|
|
|
** General Public License version 3 as published by the Free Software
|
|
|
|
|
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
|
|
|
|
** included in the packaging of this file. Please review the following
|
|
|
|
|
** information to ensure the GNU General Public License requirements will
|
|
|
|
|
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
2011-03-04 12:15:19 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
****************************************************************************/
|
2011-03-04 12:15:19 +01:00
|
|
|
|
|
|
|
|
#ifndef MEMCHECKTOOL_H
|
|
|
|
|
#define MEMCHECKTOOL_H
|
|
|
|
|
|
2015-02-18 10:36:00 +01:00
|
|
|
#include <analyzerbase/ianalyzertool.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 {
|
2015-06-29 10:36:29 +03:00
|
|
|
|
|
|
|
|
const char MEMCHECK_RUN_MODE[] = "MemcheckTool.MemcheckRunMode";
|
|
|
|
|
const char MEMCHECK_WITH_GDB_RUN_MODE[] = "MemcheckTool.MemcheckWithGdbRunMode";
|
|
|
|
|
|
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;
|
2015-02-06 15:31:08 +02:00
|
|
|
class MemcheckRunControl;
|
2013-08-08 17:37:37 +02:00
|
|
|
class ValgrindBaseSettings;
|
2011-03-04 12:15:19 +01:00
|
|
|
|
2015-06-29 10:36:29 +03:00
|
|
|
|
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;
|
|
|
|
|
};
|
|
|
|
|
|
2015-02-18 14:35:20 +01:00
|
|
|
class MemcheckTool : public QObject
|
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
|
|
|
|
2015-02-18 14:35:20 +01:00
|
|
|
QWidget *createWidgets();
|
|
|
|
|
|
2015-06-19 08:34:46 +02:00
|
|
|
MemcheckRunControl *createRunControl(const Analyzer::AnalyzerStartParameters &sp,
|
2016-01-06 11:40:52 +01:00
|
|
|
ProjectExplorer::RunConfiguration *runConfiguration,
|
|
|
|
|
Core::Id runMode);
|
2015-02-18 14:35:20 +01:00
|
|
|
|
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);
|
2013-09-09 14:34:19 +02:00
|
|
|
void engineFinished();
|
|
|
|
|
void loadingExternalXmlLogFileFinished();
|
2011-04-04 14:39:29 +02:00
|
|
|
|
2011-03-04 12:15:19 +01:00
|
|
|
void parserError(const Valgrind::XmlProtocol::Error &error);
|
|
|
|
|
void internalParserError(const QString &errorString);
|
|
|
|
|
void updateErrorFilter();
|
|
|
|
|
void suppressionActionTriggered();
|
|
|
|
|
|
2013-09-09 14:34:19 +02:00
|
|
|
void loadExternalXmlLogFile();
|
|
|
|
|
|
2011-03-04 12:15:19 +01:00
|
|
|
private:
|
2011-12-13 14:01:52 +01:00
|
|
|
void setBusyCursor(bool busy);
|
2011-06-27 15:43:15 +02:00
|
|
|
|
|
|
|
|
void clearErrorView();
|
2013-09-09 14:34:19 +02:00
|
|
|
void updateFromSettings();
|
|
|
|
|
int updateUiAfterFinishedHelper();
|
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;
|
2013-09-09 14:34:19 +02:00
|
|
|
QAction *m_loadExternalLogFile;
|
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
|