forked from qt-creator/qt-creator
Valgrind: Merge configwidget population to settings aspect container
Change-Id: I021ef0ea9b3ab48c805a8af282a4062ddd701dea Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -26,7 +26,6 @@ add_qtc_plugin(Valgrind
|
|||||||
memchecktool.cpp memchecktool.h
|
memchecktool.cpp memchecktool.h
|
||||||
suppressiondialog.cpp suppressiondialog.h
|
suppressiondialog.cpp suppressiondialog.h
|
||||||
valgrind.qrc
|
valgrind.qrc
|
||||||
valgrindconfigwidget.cpp valgrindconfigwidget.h
|
|
||||||
valgrindengine.cpp valgrindengine.h
|
valgrindengine.cpp valgrindengine.h
|
||||||
valgrindplugin.cpp
|
valgrindplugin.cpp
|
||||||
valgrindrunner.cpp valgrindrunner.h
|
valgrindrunner.cpp valgrindrunner.h
|
||||||
|
@@ -30,7 +30,6 @@ QtcPlugin {
|
|||||||
"memchecktool.cpp", "memchecktool.h",
|
"memchecktool.cpp", "memchecktool.h",
|
||||||
"suppressiondialog.cpp", "suppressiondialog.h",
|
"suppressiondialog.cpp", "suppressiondialog.h",
|
||||||
"valgrind.qrc",
|
"valgrind.qrc",
|
||||||
"valgrindconfigwidget.cpp", "valgrindconfigwidget.h",
|
|
||||||
"valgrindengine.cpp", "valgrindengine.h",
|
"valgrindengine.cpp", "valgrindengine.h",
|
||||||
"valgrindplugin.cpp",
|
"valgrindplugin.cpp",
|
||||||
"valgrindrunner.cpp", "valgrindrunner.h",
|
"valgrindrunner.cpp", "valgrindrunner.h",
|
||||||
|
@@ -1,111 +0,0 @@
|
|||||||
// Copyright (C) 2016 The Qt Company Ltd.
|
|
||||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
|
||||||
|
|
||||||
#include "valgrindconfigwidget.h"
|
|
||||||
#include "valgrindsettings.h"
|
|
||||||
#include "valgrindtr.h"
|
|
||||||
|
|
||||||
#include <debugger/analyzer/analyzericons.h>
|
|
||||||
#include <debugger/debuggertr.h>
|
|
||||||
|
|
||||||
#include <coreplugin/icore.h>
|
|
||||||
|
|
||||||
#include <utils/algorithm.h>
|
|
||||||
#include <utils/layoutbuilder.h>
|
|
||||||
#include <utils/qtcassert.h>
|
|
||||||
|
|
||||||
using namespace Utils;
|
|
||||||
|
|
||||||
namespace Valgrind::Internal {
|
|
||||||
|
|
||||||
class ValgrindConfigWidget : public Core::IOptionsPageWidget
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
explicit ValgrindConfigWidget(ValgrindBaseSettings *settings);
|
|
||||||
|
|
||||||
void apply() final
|
|
||||||
{
|
|
||||||
globalSettings().apply();
|
|
||||||
globalSettings().writeSettings();
|
|
||||||
}
|
|
||||||
|
|
||||||
void finish() final
|
|
||||||
{
|
|
||||||
globalSettings().finish();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
ValgrindConfigWidget::ValgrindConfigWidget(ValgrindBaseSettings *settings)
|
|
||||||
{
|
|
||||||
using namespace Layouting;
|
|
||||||
ValgrindBaseSettings &s = *settings;
|
|
||||||
// clang-format off
|
|
||||||
Grid generic {
|
|
||||||
s.valgrindExecutable, br,
|
|
||||||
s.valgrindArguments, br,
|
|
||||||
s.selfModifyingCodeDetection, br
|
|
||||||
};
|
|
||||||
|
|
||||||
Grid memcheck {
|
|
||||||
s.memcheckArguments, br,
|
|
||||||
s.trackOrigins, br,
|
|
||||||
s.showReachable, br,
|
|
||||||
s.leakCheckOnFinish, br,
|
|
||||||
s.numCallers, br,
|
|
||||||
s.filterExternalIssues, br,
|
|
||||||
s.suppressions
|
|
||||||
};
|
|
||||||
|
|
||||||
Grid callgrind {
|
|
||||||
s.callgrindArguments, br,
|
|
||||||
s.kcachegrindExecutable, br,
|
|
||||||
s.minimumInclusiveCostRatio, br,
|
|
||||||
s.visualizationMinimumInclusiveCostRatio, br,
|
|
||||||
s.enableEventToolTips, br,
|
|
||||||
Span {
|
|
||||||
2,
|
|
||||||
Group {
|
|
||||||
Column {
|
|
||||||
s.enableCacheSim,
|
|
||||||
s.enableBranchSim,
|
|
||||||
s.collectSystime,
|
|
||||||
s.collectBusEvents,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
Column {
|
|
||||||
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 },
|
|
||||||
st,
|
|
||||||
}.attachTo(this);
|
|
||||||
// clang-format on
|
|
||||||
}
|
|
||||||
|
|
||||||
// ValgrindOptionsPage
|
|
||||||
|
|
||||||
class ValgrindOptionsPage final : public Core::IOptionsPage
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
ValgrindOptionsPage()
|
|
||||||
{
|
|
||||||
setId(ANALYZER_VALGRIND_SETTINGS);
|
|
||||||
setDisplayName(Tr::tr("Valgrind"));
|
|
||||||
setCategory("T.Analyzer");
|
|
||||||
setDisplayCategory(::Debugger::Tr::tr("Analyzer"));
|
|
||||||
setCategoryIconPath(Analyzer::Icons::SETTINGSCATEGORY_ANALYZER);
|
|
||||||
setWidgetCreator([] { return new ValgrindConfigWidget(&globalSettings()); });
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const ValgrindOptionsPage settingsPage;
|
|
||||||
|
|
||||||
|
|
||||||
QWidget *createSettingsWidget(ValgrindBaseSettings *settings)
|
|
||||||
{
|
|
||||||
return new ValgrindConfigWidget(settings);
|
|
||||||
}
|
|
||||||
|
|
||||||
} // Valgrind::Internal
|
|
@@ -1,12 +0,0 @@
|
|||||||
// Copyright (C) 2016 The Qt Company Ltd.
|
|
||||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
|
||||||
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include <coreplugin/dialogs/ioptionspage.h>
|
|
||||||
|
|
||||||
namespace Valgrind::Internal {
|
|
||||||
|
|
||||||
QWidget *createSettingsWidget(class ValgrindBaseSettings *settings);
|
|
||||||
|
|
||||||
} // Valgrind::Internal
|
|
@@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
#include "callgrindtool.h"
|
#include "callgrindtool.h"
|
||||||
#include "memchecktool.h"
|
#include "memchecktool.h"
|
||||||
#include "valgrindconfigwidget.h"
|
|
||||||
#include "valgrindsettings.h"
|
#include "valgrindsettings.h"
|
||||||
#include "valgrindtr.h"
|
#include "valgrindtr.h"
|
||||||
|
|
||||||
|
@@ -4,11 +4,14 @@
|
|||||||
#include "valgrindsettings.h"
|
#include "valgrindsettings.h"
|
||||||
|
|
||||||
#include "callgrindcostdelegate.h"
|
#include "callgrindcostdelegate.h"
|
||||||
#include "valgrindconfigwidget.h"
|
|
||||||
#include "valgrindtr.h"
|
#include "valgrindtr.h"
|
||||||
|
|
||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
|
|
||||||
|
#include <coreplugin/dialogs/ioptionspage.h>
|
||||||
|
#include <debugger/analyzer/analyzericons.h>
|
||||||
|
#include <debugger/debuggertr.h>
|
||||||
|
|
||||||
#include <utils/algorithm.h>
|
#include <utils/algorithm.h>
|
||||||
#include <utils/layoutbuilder.h>
|
#include <utils/layoutbuilder.h>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
@@ -173,6 +176,14 @@ void SuppressionAspect::bufferToGui()
|
|||||||
d->m_model.appendRow(new QStandardItem(file.toUserOutput()));
|
d->m_model.appendRow(new QStandardItem(file.toUserOutput()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ValgrindConfigWidget
|
||||||
|
|
||||||
|
|
||||||
|
QWidget *createSettingsWidget(ValgrindBaseSettings *settings)
|
||||||
|
{
|
||||||
|
return settings->layouter()().emerge();
|
||||||
|
}
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// ValgrindBaseSettings
|
// ValgrindBaseSettings
|
||||||
@@ -316,6 +327,54 @@ ValgrindBaseSettings::ValgrindBaseSettings(bool global)
|
|||||||
for (int i = 0; i < Valgrind::XmlProtocol::MemcheckErrorKindCount; ++i)
|
for (int i = 0; i < Valgrind::XmlProtocol::MemcheckErrorKindCount; ++i)
|
||||||
defaultErrorKinds << i;
|
defaultErrorKinds << i;
|
||||||
visibleErrorKinds.setDefaultValue(defaultErrorKinds);
|
visibleErrorKinds.setDefaultValue(defaultErrorKinds);
|
||||||
|
|
||||||
|
setLayouter([this] {
|
||||||
|
using namespace Layouting;
|
||||||
|
|
||||||
|
// clang-format off
|
||||||
|
Grid generic {
|
||||||
|
valgrindExecutable, br,
|
||||||
|
valgrindArguments, br,
|
||||||
|
selfModifyingCodeDetection, br
|
||||||
|
};
|
||||||
|
|
||||||
|
Grid memcheck {
|
||||||
|
memcheckArguments, br,
|
||||||
|
trackOrigins, br,
|
||||||
|
showReachable, br,
|
||||||
|
leakCheckOnFinish, br,
|
||||||
|
numCallers, br,
|
||||||
|
filterExternalIssues, br,
|
||||||
|
suppressions
|
||||||
|
};
|
||||||
|
|
||||||
|
Grid callgrind {
|
||||||
|
callgrindArguments, br,
|
||||||
|
kcachegrindExecutable, br,
|
||||||
|
minimumInclusiveCostRatio, br,
|
||||||
|
visualizationMinimumInclusiveCostRatio, br,
|
||||||
|
enableEventToolTips, br,
|
||||||
|
Span {
|
||||||
|
2,
|
||||||
|
Group {
|
||||||
|
Column {
|
||||||
|
enableCacheSim,
|
||||||
|
enableBranchSim,
|
||||||
|
collectSystime,
|
||||||
|
collectBusEvents,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
return Column {
|
||||||
|
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 },
|
||||||
|
st,
|
||||||
|
};
|
||||||
|
// clang-format on
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -356,8 +415,8 @@ ValgrindGlobalSettings::ValgrindGlobalSettings()
|
|||||||
shortenTemplates.setToolTip(Tr::tr("Remove template parameter lists when displaying function names."));
|
shortenTemplates.setToolTip(Tr::tr("Remove template parameter lists when displaying function names."));
|
||||||
|
|
||||||
setConfigWidgetCreator([this] { return createSettingsWidget(this); });
|
setConfigWidgetCreator([this] { return createSettingsWidget(this); });
|
||||||
readSettings();
|
|
||||||
|
|
||||||
|
readSettings();
|
||||||
setAutoApply(false);
|
setAutoApply(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -424,4 +483,25 @@ ValgrindProjectSettings::ValgrindProjectSettings()
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// ValgrindOptionsPage
|
||||||
|
//
|
||||||
|
|
||||||
|
class ValgrindOptionsPage final : public Core::IOptionsPage
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
ValgrindOptionsPage()
|
||||||
|
{
|
||||||
|
setId(ANALYZER_VALGRIND_SETTINGS);
|
||||||
|
setDisplayName(Tr::tr("Valgrind"));
|
||||||
|
setCategory("T.Analyzer");
|
||||||
|
setDisplayCategory(::Debugger::Tr::tr("Analyzer"));
|
||||||
|
setCategoryIconPath(Analyzer::Icons::SETTINGSCATEGORY_ANALYZER);
|
||||||
|
setSettingsProvider([] { return &globalSettings(); });
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const ValgrindOptionsPage settingsPage;
|
||||||
|
|
||||||
|
|
||||||
} // Valgrind::Internal
|
} // Valgrind::Internal
|
||||||
|
@@ -100,7 +100,6 @@ public:
|
|||||||
QVariantMap defaultSettings() const;
|
QVariantMap defaultSettings() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Global valgrind settings
|
* Global valgrind settings
|
||||||
*/
|
*/
|
||||||
|
Reference in New Issue
Block a user