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
|
|
|
|
|
|
|
|
#include "valgrindconfigwidget.h"
|
2011-07-12 16:47:32 +02:00
|
|
|
#include "valgrindsettings.h"
|
2022-07-08 16:08:27 +02:00
|
|
|
#include "valgrindtr.h"
|
2011-03-04 12:15:18 +01:00
|
|
|
|
2020-01-16 17:51:53 +01:00
|
|
|
#include <debugger/analyzer/analyzericons.h>
|
|
|
|
|
|
2021-03-09 17:40:29 +01:00
|
|
|
#include <coreplugin/icore.h>
|
|
|
|
|
|
2014-06-16 18:25:52 +04:00
|
|
|
#include <utils/algorithm.h>
|
2021-02-18 14:18:34 +01:00
|
|
|
#include <utils/layoutbuilder.h>
|
2011-07-12 16:47:32 +02:00
|
|
|
#include <utils/qtcassert.h>
|
2011-03-04 12:15:18 +01:00
|
|
|
|
2021-02-18 14:18:34 +01:00
|
|
|
using namespace Utils;
|
|
|
|
|
|
2011-07-12 16:47:32 +02:00
|
|
|
namespace Valgrind {
|
|
|
|
|
namespace Internal {
|
|
|
|
|
|
2020-01-16 17:51:53 +01:00
|
|
|
class ValgrindConfigWidget : public Core::IOptionsPageWidget
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
explicit ValgrindConfigWidget(ValgrindBaseSettings *settings);
|
|
|
|
|
|
|
|
|
|
void apply() final
|
|
|
|
|
{
|
2021-04-06 18:35:27 +02:00
|
|
|
ValgrindGlobalSettings::instance()->apply();
|
2020-01-16 17:51:53 +01:00
|
|
|
ValgrindGlobalSettings::instance()->writeSettings();
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-09 17:40:29 +01:00
|
|
|
void finish() final
|
|
|
|
|
{
|
2021-04-06 18:35:27 +02:00
|
|
|
ValgrindGlobalSettings::instance()->finish();
|
2021-03-09 17:40:29 +01:00
|
|
|
}
|
2020-01-16 17:51:53 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
ValgrindConfigWidget::ValgrindConfigWidget(ValgrindBaseSettings *settings)
|
2011-03-04 12:15:18 +01:00
|
|
|
{
|
2021-02-18 14:18:34 +01:00
|
|
|
using namespace Layouting;
|
|
|
|
|
ValgrindBaseSettings &s = *settings;
|
|
|
|
|
|
|
|
|
|
Grid generic {
|
2022-07-22 18:54:04 +02:00
|
|
|
s.valgrindExecutable, br,
|
|
|
|
|
s.valgrindArguments, br,
|
|
|
|
|
s.selfModifyingCodeDetection, br
|
2021-02-18 14:18:34 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
Grid memcheck {
|
2022-07-22 18:54:04 +02:00
|
|
|
s.memcheckArguments, br,
|
|
|
|
|
s.trackOrigins, br,
|
|
|
|
|
s.showReachable, br,
|
|
|
|
|
s.leakCheckOnFinish, br,
|
|
|
|
|
s.numCallers, br,
|
|
|
|
|
s.filterExternalIssues, br,
|
2021-03-09 17:40:29 +01:00
|
|
|
s.suppressions
|
2021-02-18 14:18:34 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
Grid callgrind {
|
2022-07-22 18:54:04 +02:00
|
|
|
s.callgrindArguments, br,
|
|
|
|
|
s.kcachegrindExecutable, br,
|
|
|
|
|
s.minimumInclusiveCostRatio, br,
|
|
|
|
|
s.visualizationMinimumInclusiveCostRatio, br,
|
|
|
|
|
s.enableEventToolTips, br,
|
2021-03-11 19:02:42 +01:00
|
|
|
Span {
|
|
|
|
|
2,
|
2021-02-18 14:18:34 +01:00
|
|
|
Group {
|
2022-07-21 11:10:34 +02:00
|
|
|
Column {
|
|
|
|
|
s.enableCacheSim,
|
|
|
|
|
s.enableBranchSim,
|
|
|
|
|
s.collectSystime,
|
|
|
|
|
s.collectBusEvents,
|
|
|
|
|
}
|
2021-03-11 19:02:42 +01:00
|
|
|
}
|
2021-02-18 14:18:34 +01:00
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
Column {
|
2022-07-08 16:08:27 +02:00
|
|
|
Group { Title(Tr::tr("Valgrind Generic Settings")), generic },
|
|
|
|
|
Group { Title(Tr::tr("MemCheck Memory Analysis Options")), memcheck },
|
|
|
|
|
Group { Title(Tr::tr("CallGrind Profiling Options")), callgrind },
|
2022-07-22 18:54:04 +02:00
|
|
|
st,
|
2021-02-18 14:18:34 +01:00
|
|
|
}.attachTo(this);
|
2011-07-12 16:47:32 +02:00
|
|
|
}
|
|
|
|
|
|
2020-01-16 17:51:53 +01:00
|
|
|
// ValgrindOptionsPage
|
|
|
|
|
|
|
|
|
|
ValgrindOptionsPage::ValgrindOptionsPage()
|
|
|
|
|
{
|
|
|
|
|
setId(ANALYZER_VALGRIND_SETTINGS);
|
2022-07-08 16:08:27 +02:00
|
|
|
setDisplayName(Tr::tr("Valgrind"));
|
2020-01-16 17:51:53 +01:00
|
|
|
setCategory("T.Analyzer");
|
2022-07-08 16:08:27 +02:00
|
|
|
setDisplayCategory(Tr::tr("Analyzer"));
|
2020-01-16 17:51:53 +01:00
|
|
|
setCategoryIconPath(Analyzer::Icons::SETTINGSCATEGORY_ANALYZER);
|
|
|
|
|
setWidgetCreator([] { return new ValgrindConfigWidget(ValgrindGlobalSettings::instance()); });
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QWidget *ValgrindOptionsPage::createSettingsWidget(ValgrindBaseSettings *settings)
|
|
|
|
|
{
|
|
|
|
|
return new ValgrindConfigWidget(settings);
|
|
|
|
|
}
|
|
|
|
|
|
2011-07-12 16:47:32 +02:00
|
|
|
} // namespace Internal
|
|
|
|
|
} // namespace Valgrind
|