2012-10-02 09:12:39 +02:00
|
|
|
/****************************************************************************
|
2011-03-04 12:15:18 +01:00
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** Copyright (C) 2016 The Qt Company Ltd.
|
2011-03-04 12:15:18 +01:00
|
|
|
** Author: Milian Wolff, KDAB (milian.wolff@kdab.com)
|
2016-01-15 14:57:40 +01:00
|
|
|
** Contact: https://www.qt.io/licensing/
|
2011-03-04 12:15:18 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** This file is part of Qt Creator.
|
2011-03-04 12:15:18 +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:18 +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:18 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
****************************************************************************/
|
2011-03-04 12:15:18 +01:00
|
|
|
|
2016-03-18 07:55:01 +01:00
|
|
|
#pragma once
|
2011-03-04 12:15:18 +01:00
|
|
|
|
2011-07-12 16:47:32 +02:00
|
|
|
#include "callgrindcostdelegate.h"
|
2011-03-04 12:15:18 +01:00
|
|
|
|
2021-02-18 14:18:34 +01:00
|
|
|
#include <projectexplorer/runconfiguration.h>
|
|
|
|
|
#include <projectexplorer/runconfigurationaspects.h>
|
2011-03-04 12:15:18 +01:00
|
|
|
|
2011-04-04 14:39:28 +02:00
|
|
|
namespace Valgrind {
|
2011-03-04 12:15:18 +01:00
|
|
|
namespace Internal {
|
|
|
|
|
|
2013-08-08 17:37:37 +02:00
|
|
|
const char ANALYZER_VALGRIND_SETTINGS[] = "Analyzer.Valgrind.Settings";
|
|
|
|
|
|
2011-03-04 12:15:18 +01:00
|
|
|
/**
|
2011-07-12 16:47:32 +02:00
|
|
|
* Valgrind settings shared for global and per-project.
|
2011-03-04 12:15:18 +01:00
|
|
|
*/
|
2013-08-12 17:04:10 +02:00
|
|
|
class ValgrindBaseSettings : public ProjectExplorer::ISettingsAspect
|
2011-03-04 12:15:18 +01:00
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
2011-07-12 16:47:32 +02:00
|
|
|
|
2011-03-04 12:15:18 +01:00
|
|
|
public:
|
2021-02-18 14:18:34 +01:00
|
|
|
ValgrindBaseSettings();
|
|
|
|
|
|
2013-09-06 16:33:48 +02:00
|
|
|
enum SelfModifyingCodeDetection {
|
|
|
|
|
DetectSmcNo,
|
|
|
|
|
DetectSmcStackOnly,
|
|
|
|
|
DetectSmcEverywhere,
|
|
|
|
|
DetectSmcEverywhereButFile
|
|
|
|
|
};
|
|
|
|
|
|
2013-09-09 11:43:39 +02:00
|
|
|
enum LeakCheckOnFinish {
|
|
|
|
|
LeakCheckOnFinishNo,
|
|
|
|
|
LeakCheckOnFinishSummaryOnly,
|
|
|
|
|
LeakCheckOnFinishYes
|
|
|
|
|
};
|
|
|
|
|
|
2018-05-07 15:06:00 +02:00
|
|
|
void toMap(QVariantMap &map) const override;
|
|
|
|
|
void fromMap(const QVariantMap &map) override;
|
2011-07-12 16:47:32 +02:00
|
|
|
|
2011-07-25 20:16:29 +02:00
|
|
|
signals:
|
|
|
|
|
void changed(); // sent when multiple values have changed simulatenously (e.g. fromMap)
|
|
|
|
|
|
2011-07-12 16:47:32 +02:00
|
|
|
/**
|
|
|
|
|
* Base valgrind settings
|
|
|
|
|
*/
|
|
|
|
|
public:
|
2021-02-18 14:18:34 +01:00
|
|
|
Utils::StringAspect valgrindExecutable;
|
|
|
|
|
Utils::StringAspect valgrindArguments;
|
|
|
|
|
Utils::SelectionAspect selfModifyingCodeDetection;
|
2011-07-12 16:47:32 +02:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Base memcheck settings
|
|
|
|
|
*/
|
|
|
|
|
public:
|
2021-02-18 14:18:34 +01:00
|
|
|
Utils::StringAspect memcheckArguments;
|
|
|
|
|
Utils::IntegerAspect numCallers;
|
|
|
|
|
Utils::SelectionAspect leakCheckOnFinish;
|
|
|
|
|
Utils::BoolAspect showReachable;
|
|
|
|
|
Utils::BoolAspect trackOrigins;
|
|
|
|
|
Utils::BoolAspect filterExternalIssues;
|
|
|
|
|
Utils::IntegersAspect visibleErrorKinds;
|
2011-07-12 16:47:32 +02:00
|
|
|
|
|
|
|
|
virtual QStringList suppressionFiles() const = 0;
|
|
|
|
|
virtual void addSuppressionFiles(const QStringList &) = 0;
|
|
|
|
|
virtual void removeSuppressionFiles(const QStringList &) = 0;
|
|
|
|
|
|
|
|
|
|
void setVisibleErrorKinds(const QList<int> &);
|
|
|
|
|
|
|
|
|
|
signals:
|
|
|
|
|
void suppressionFilesRemoved(const QStringList &);
|
|
|
|
|
void suppressionFilesAdded(const QStringList &);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Base callgrind settings
|
|
|
|
|
*/
|
|
|
|
|
public:
|
2021-02-18 14:18:34 +01:00
|
|
|
Utils::StringAspect callgrindArguments;
|
|
|
|
|
Utils::StringAspect kcachegrindExecutable;
|
|
|
|
|
|
|
|
|
|
Utils::BoolAspect enableCacheSim;
|
|
|
|
|
Utils::BoolAspect enableBranchSim;
|
|
|
|
|
Utils::BoolAspect collectSystime;
|
|
|
|
|
Utils::BoolAspect collectBusEvents;
|
|
|
|
|
Utils::BoolAspect enableEventToolTips;
|
|
|
|
|
Utils::DoubleAspect minimumInclusiveCostRatio;
|
|
|
|
|
Utils::DoubleAspect visualizationMinimumInclusiveCostRatio;
|
|
|
|
|
|
|
|
|
|
Utils::AspectContainer group;
|
|
|
|
|
QVariantMap defaultSettings() const;
|
2011-07-12 16:47:32 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Global valgrind settings
|
|
|
|
|
*/
|
|
|
|
|
class ValgrindGlobalSettings : public ValgrindBaseSettings
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
2013-08-08 17:37:37 +02:00
|
|
|
ValgrindGlobalSettings();
|
2011-07-12 16:47:32 +02:00
|
|
|
|
2019-03-20 17:49:26 +01:00
|
|
|
static ValgrindGlobalSettings *instance();
|
|
|
|
|
|
2021-02-18 14:18:34 +01:00
|
|
|
/**
|
2011-07-12 16:47:32 +02:00
|
|
|
* Global memcheck settings
|
|
|
|
|
*/
|
2018-05-07 15:06:00 +02:00
|
|
|
QStringList suppressionFiles() const override;
|
2011-07-12 16:47:32 +02:00
|
|
|
// in the global settings we change the internal list directly
|
2018-05-07 15:06:00 +02:00
|
|
|
void addSuppressionFiles(const QStringList &) override;
|
|
|
|
|
void removeSuppressionFiles(const QStringList &) override;
|
2011-07-12 16:47:32 +02:00
|
|
|
|
2013-08-08 17:37:37 +02:00
|
|
|
void writeSettings() const;
|
|
|
|
|
void readSettings();
|
|
|
|
|
|
2021-02-18 14:18:34 +01:00
|
|
|
Utils::StringListAspect suppressionFiles_;
|
|
|
|
|
Utils::StringAspect lastSuppressionDirectory;
|
|
|
|
|
Utils::StringAspect lastSuppressionHistory;
|
2011-07-12 16:47:32 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Global callgrind settings
|
|
|
|
|
*/
|
2021-02-18 14:18:34 +01:00
|
|
|
Utils::SelectionAspect costFormat;
|
|
|
|
|
Utils::BoolAspect detectCycles;
|
|
|
|
|
Utils::BoolAspect shortenTemplates;
|
2011-07-12 16:47:32 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Per-project valgrind settings.
|
|
|
|
|
*/
|
|
|
|
|
class ValgrindProjectSettings : public ValgrindBaseSettings
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
2018-09-10 15:39:27 +02:00
|
|
|
ValgrindProjectSettings();
|
2011-07-12 16:47:32 +02:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Per-project memcheck settings, saves a diff to the global suppression files list
|
|
|
|
|
*/
|
2018-05-07 15:06:00 +02:00
|
|
|
QStringList suppressionFiles() const override;
|
2011-07-12 16:47:32 +02:00
|
|
|
// in the project-specific settings we store a diff to the global list
|
2018-05-07 15:06:00 +02:00
|
|
|
void addSuppressionFiles(const QStringList &suppressions) override;
|
|
|
|
|
void removeSuppressionFiles(const QStringList &suppressions) override;
|
2011-07-12 16:47:32 +02:00
|
|
|
|
|
|
|
|
private:
|
2021-02-18 14:18:34 +01:00
|
|
|
Utils::StringListAspect disabledGlobalSuppressionFiles;
|
|
|
|
|
Utils::StringListAspect addedSuppressionFiles;
|
2011-03-04 12:15:18 +01:00
|
|
|
};
|
|
|
|
|
|
2011-05-18 19:35:42 +02:00
|
|
|
} // namespace Internal
|
|
|
|
|
} // namespace Valgrind
|