2012-10-02 09:12:39 +02:00
|
|
|
/****************************************************************************
|
2011-03-04 12:15:19 +01:00
|
|
|
**
|
2015-01-14 18:07:15 +01:00
|
|
|
** Copyright (C) 2015 The Qt Company Ltd.
|
|
|
|
|
** Contact: http://www.qt.io/licensing
|
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
|
2015-01-14 18:07:15 +01:00
|
|
|
** a written agreement between you and The Qt Company. For licensing terms and
|
|
|
|
|
** conditions see http://www.qt.io/terms-conditions. For further information
|
2014-10-01 13:21:18 +02:00
|
|
|
** use the contact form at http://www.qt.io/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
|
2014-10-01 13:21:18 +02:00
|
|
|
** General Public License version 2.1 or version 3 as published by the Free
|
|
|
|
|
** Software Foundation and appearing in the file LICENSE.LGPLv21 and
|
|
|
|
|
** LICENSE.LGPLv3 included in the packaging of this file. Please review the
|
|
|
|
|
** following information to ensure the GNU Lesser General Public License
|
|
|
|
|
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
|
|
|
|
|
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
2011-03-04 12:15:19 +01:00
|
|
|
**
|
2015-01-14 18:07:15 +01:00
|
|
|
** In addition, as a special exception, The Qt Company gives you certain additional
|
|
|
|
|
** rights. These rights are described in The Qt Company 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
|
|
|
|
|
|
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,
|
|
|
|
|
ProjectExplorer::RunConfiguration *runConfiguration);
|
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
|
|
|
|
2015-02-06 15:31:08 +02:00
|
|
|
protected:
|
|
|
|
|
virtual MemcheckRunControl *createMemcheckRunControl(
|
|
|
|
|
const Analyzer::AnalyzerStartParameters &sp,
|
|
|
|
|
ProjectExplorer::RunConfiguration *runConfiguration);
|
|
|
|
|
|
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
|
|
|
};
|
|
|
|
|
|
2015-02-06 15:31:08 +02:00
|
|
|
class MemcheckWithGdbTool : public MemcheckTool
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
MemcheckWithGdbTool(QObject *parent);
|
|
|
|
|
|
|
|
|
|
MemcheckRunControl *createMemcheckRunControl(
|
|
|
|
|
const Analyzer::AnalyzerStartParameters &sp,
|
2015-06-03 15:31:32 +02:00
|
|
|
ProjectExplorer::RunConfiguration *runConfiguration) override;
|
2015-02-06 15:31:08 +02:00
|
|
|
};
|
|
|
|
|
|
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
|