2012-10-02 09:12:39 +02:00
|
|
|
/****************************************************************************
|
2011-02-22 12:58:32 +01:00
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
|
** Contact: https://www.qt.io/licensing/
|
2011-02-22 12:58:32 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** This file is part of Qt Creator.
|
2011-02-22 12:58:32 +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-02-22 12:58:32 +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-02-22 12:58:32 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
****************************************************************************/
|
2011-02-22 12:58:32 +01:00
|
|
|
|
|
|
|
|
#include "commonoptionspage.h"
|
|
|
|
|
|
|
|
|
|
#include "debuggeractions.h"
|
2011-04-21 15:52:51 +02:00
|
|
|
#include "debuggerinternalconstants.h"
|
2011-02-22 12:58:32 +01:00
|
|
|
#include "debuggercore.h"
|
|
|
|
|
|
|
|
|
|
#include <coreplugin/icore.h>
|
2017-05-12 17:03:34 +03:00
|
|
|
#include <coreplugin/variablechooser.h>
|
|
|
|
|
|
2017-08-29 11:48:48 +02:00
|
|
|
#include <app/app_version.h>
|
2012-08-23 15:53:58 +02:00
|
|
|
#include <utils/hostosinfo.h>
|
2017-05-12 17:03:34 +03:00
|
|
|
#include <utils/pathchooser.h>
|
2011-03-04 16:21:57 +01:00
|
|
|
#include <utils/qtcassert.h>
|
2017-05-12 17:03:34 +03:00
|
|
|
#include <utils/savedaction.h>
|
2011-02-22 12:58:32 +01:00
|
|
|
|
2014-05-16 17:32:07 +02:00
|
|
|
#include <QCheckBox>
|
|
|
|
|
#include <QCoreApplication>
|
2014-07-08 14:11:48 +02:00
|
|
|
#include <QFormLayout>
|
2014-05-16 17:32:07 +02:00
|
|
|
#include <QHBoxLayout>
|
|
|
|
|
#include <QLabel>
|
2013-03-21 17:10:19 +01:00
|
|
|
#include <QSpinBox>
|
2017-05-12 17:03:34 +03:00
|
|
|
#include <QTextEdit>
|
2012-02-15 10:42:41 +01:00
|
|
|
#include <QTextStream>
|
2011-02-22 12:58:32 +01:00
|
|
|
|
|
|
|
|
using namespace Core;
|
|
|
|
|
using namespace Debugger::Constants;
|
|
|
|
|
using namespace ProjectExplorer;
|
2016-11-04 10:12:09 +01:00
|
|
|
using namespace Utils;
|
2011-02-22 12:58:32 +01:00
|
|
|
|
|
|
|
|
namespace Debugger {
|
|
|
|
|
namespace Internal {
|
|
|
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////
|
|
|
|
|
//
|
|
|
|
|
// CommonOptionsPage
|
|
|
|
|
//
|
|
|
|
|
///////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
2011-03-04 16:21:57 +01:00
|
|
|
CommonOptionsPage::CommonOptionsPage(const QSharedPointer<GlobalDebuggerOptions> &go) :
|
|
|
|
|
m_options(go)
|
|
|
|
|
{
|
2013-01-16 15:22:58 +01:00
|
|
|
setId(DEBUGGER_COMMON_SETTINGS_ID);
|
2012-05-22 11:17:13 +02:00
|
|
|
setDisplayName(QCoreApplication::translate("Debugger", "General"));
|
2012-12-29 03:37:27 +01:00
|
|
|
setCategory(DEBUGGER_SETTINGS_CATEGORY);
|
2018-04-20 15:45:11 +02:00
|
|
|
setDisplayCategory(QCoreApplication::translate("Debugger", "Debugger"));
|
2018-04-23 19:06:13 +02:00
|
|
|
setCategoryIcon(Utils::Icon({{":/debugger/images/settingscategory_debugger.png",
|
|
|
|
|
Utils::Theme::PanelTextColorDark}}, Utils::Icon::Tint));
|
2011-07-28 15:26:43 +02:00
|
|
|
}
|
|
|
|
|
|
2011-02-22 12:58:32 +01:00
|
|
|
void CommonOptionsPage::apply()
|
|
|
|
|
{
|
2016-11-04 10:12:09 +01:00
|
|
|
m_group.apply(ICore::settings());
|
2011-03-04 16:21:57 +01:00
|
|
|
|
2016-11-04 10:12:09 +01:00
|
|
|
GlobalDebuggerOptions newOptions;
|
|
|
|
|
SourcePathMap allPathMap = m_sourceMappingWidget->sourcePathMap();
|
|
|
|
|
for (auto it = allPathMap.begin(), end = allPathMap.end(); it != end; ++it) {
|
|
|
|
|
const QString key = it.key();
|
2018-10-07 22:38:47 +03:00
|
|
|
if (key.startsWith('('))
|
2016-11-04 10:12:09 +01:00
|
|
|
newOptions.sourcePathRegExpMap.append(qMakePair(QRegExp(key), it.value()));
|
|
|
|
|
else
|
|
|
|
|
newOptions.sourcePathMap.insert(key, it.value());
|
|
|
|
|
}
|
2011-03-04 16:21:57 +01:00
|
|
|
|
2016-11-04 10:12:09 +01:00
|
|
|
if (newOptions.sourcePathMap != m_options->sourcePathMap
|
|
|
|
|
|| newOptions.sourcePathRegExpMap != m_options->sourcePathRegExpMap) {
|
|
|
|
|
*m_options = newOptions;
|
2013-09-04 18:39:43 +02:00
|
|
|
m_options->toSettings();
|
2011-03-04 16:21:57 +01:00
|
|
|
}
|
2011-02-22 12:58:32 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CommonOptionsPage::finish()
|
|
|
|
|
{
|
2016-11-04 10:12:09 +01:00
|
|
|
m_group.finish();
|
2013-12-03 14:17:03 +01:00
|
|
|
delete m_widget;
|
2011-02-22 12:58:32 +01:00
|
|
|
}
|
|
|
|
|
|
2013-12-03 14:17:03 +01:00
|
|
|
QWidget *CommonOptionsPage::widget()
|
2011-02-22 12:58:32 +01:00
|
|
|
{
|
2013-12-03 14:17:03 +01:00
|
|
|
if (!m_widget) {
|
2016-11-04 10:12:09 +01:00
|
|
|
m_widget = new QWidget;
|
|
|
|
|
|
|
|
|
|
auto behaviorBox = new QGroupBox(m_widget);
|
|
|
|
|
behaviorBox->setTitle(tr("Behavior"));
|
|
|
|
|
|
|
|
|
|
auto checkBoxUseAlternatingRowColors = new QCheckBox(behaviorBox);
|
|
|
|
|
checkBoxUseAlternatingRowColors->setText(tr("Use alternating row colors in debug views"));
|
|
|
|
|
|
|
|
|
|
auto checkBoxFontSizeFollowsEditor = new QCheckBox(behaviorBox);
|
|
|
|
|
checkBoxFontSizeFollowsEditor->setToolTip(tr("Changes the font size in the debugger views when the font size in the main editor changes."));
|
|
|
|
|
checkBoxFontSizeFollowsEditor->setText(tr("Debugger font size follows main editor"));
|
|
|
|
|
|
|
|
|
|
auto checkBoxUseToolTipsInMainEditor = new QCheckBox(behaviorBox);
|
|
|
|
|
checkBoxUseToolTipsInMainEditor->setText(tr("Use tooltips in main editor while debugging"));
|
|
|
|
|
|
|
|
|
|
QString t = tr("Stopping and stepping in the debugger "
|
2018-10-07 22:38:47 +03:00
|
|
|
"will automatically open views associated with the current location.") + '\n';
|
2016-11-04 10:12:09 +01:00
|
|
|
auto checkBoxCloseSourceBuffersOnExit = new QCheckBox(behaviorBox);
|
|
|
|
|
checkBoxCloseSourceBuffersOnExit->setText(tr("Close temporary source views on debugger exit"));
|
2017-04-05 14:08:44 +02:00
|
|
|
checkBoxCloseSourceBuffersOnExit->setToolTip(t + tr("Closes automatically opened source views when the debugger exits."));
|
2016-11-04 10:12:09 +01:00
|
|
|
|
|
|
|
|
auto checkBoxCloseMemoryBuffersOnExit = new QCheckBox(behaviorBox);
|
|
|
|
|
checkBoxCloseMemoryBuffersOnExit->setText(tr("Close temporary memory views on debugger exit"));
|
2017-04-05 14:08:44 +02:00
|
|
|
checkBoxCloseMemoryBuffersOnExit->setToolTip(t + tr("Closes automatically opened memory views when the debugger exits."));
|
2016-11-04 10:12:09 +01:00
|
|
|
|
|
|
|
|
auto checkBoxSwitchModeOnExit = new QCheckBox(behaviorBox);
|
|
|
|
|
checkBoxSwitchModeOnExit->setText(tr("Switch to previous mode on debugger exit"));
|
|
|
|
|
|
|
|
|
|
auto checkBoxBringToForegroundOnInterrrupt = new QCheckBox(behaviorBox);
|
2017-08-29 11:48:48 +02:00
|
|
|
checkBoxBringToForegroundOnInterrrupt->setText(
|
|
|
|
|
tr("Bring %1 to foreground when application interrupts")
|
|
|
|
|
.arg(Core::Constants::IDE_DISPLAY_NAME));
|
2016-11-04 10:12:09 +01:00
|
|
|
|
|
|
|
|
auto checkBoxShowQmlObjectTree = new QCheckBox(behaviorBox);
|
|
|
|
|
checkBoxShowQmlObjectTree->setToolTip(tr("Shows QML object tree in Locals and Expressions when connected and not stepping."));
|
|
|
|
|
checkBoxShowQmlObjectTree->setText(tr("Show QML object tree"));
|
|
|
|
|
|
|
|
|
|
auto checkBoxBreakpointsFullPath = new QCheckBox(behaviorBox);
|
|
|
|
|
checkBoxBreakpointsFullPath->setToolTip(tr("Enables a full file path in breakpoints by default also for GDB."));
|
|
|
|
|
checkBoxBreakpointsFullPath->setText(tr("Set breakpoints using a full absolute path"));
|
|
|
|
|
|
|
|
|
|
auto checkBoxRegisterForPostMortem = new QCheckBox(behaviorBox);
|
2017-08-29 11:48:48 +02:00
|
|
|
checkBoxRegisterForPostMortem->setToolTip(
|
|
|
|
|
tr("Registers %1 for debugging crashed applications.")
|
|
|
|
|
.arg(Core::Constants::IDE_DISPLAY_NAME));
|
|
|
|
|
checkBoxRegisterForPostMortem->setText(
|
|
|
|
|
tr("Use %1 for post-mortem debugging")
|
|
|
|
|
.arg(Core::Constants::IDE_DISPLAY_NAME));
|
2016-11-04 10:12:09 +01:00
|
|
|
|
|
|
|
|
auto checkBoxWarnOnReleaseBuilds = new QCheckBox(behaviorBox);
|
|
|
|
|
checkBoxWarnOnReleaseBuilds->setText(tr("Warn when debugging \"Release\" builds"));
|
|
|
|
|
checkBoxWarnOnReleaseBuilds->setToolTip(tr("Shows a warning when starting the debugger "
|
|
|
|
|
"on a binary with insufficient debug information."));
|
|
|
|
|
|
|
|
|
|
auto checkBoxKeepEditorStationaryWhileStepping = new QCheckBox(behaviorBox);
|
|
|
|
|
checkBoxKeepEditorStationaryWhileStepping->setText(tr("Keep editor stationary when stepping"));
|
|
|
|
|
checkBoxKeepEditorStationaryWhileStepping->setToolTip(tr("Scrolls the editor only when it is necessary "
|
|
|
|
|
"to keep the current line in view, "
|
|
|
|
|
"instead of keeping the next statement centered at "
|
|
|
|
|
"all times."));
|
|
|
|
|
|
|
|
|
|
auto labelMaximalStackDepth = new QLabel(tr("Maximum stack depth:"), behaviorBox);
|
|
|
|
|
|
|
|
|
|
auto spinBoxMaximalStackDepth = new QSpinBox(behaviorBox);
|
|
|
|
|
spinBoxMaximalStackDepth->setSpecialValueText(tr("<unlimited>"));
|
|
|
|
|
spinBoxMaximalStackDepth->setMaximum(999);
|
|
|
|
|
spinBoxMaximalStackDepth->setSingleStep(5);
|
|
|
|
|
spinBoxMaximalStackDepth->setValue(10);
|
|
|
|
|
|
|
|
|
|
m_sourceMappingWidget = new DebuggerSourcePathMappingWidget(m_widget);
|
|
|
|
|
|
|
|
|
|
auto horizontalLayout = new QHBoxLayout;
|
|
|
|
|
horizontalLayout->addWidget(labelMaximalStackDepth);
|
|
|
|
|
horizontalLayout->addWidget(spinBoxMaximalStackDepth);
|
|
|
|
|
horizontalLayout->addStretch();
|
|
|
|
|
|
|
|
|
|
auto gridLayout = new QGridLayout(behaviorBox);
|
|
|
|
|
gridLayout->addWidget(checkBoxUseAlternatingRowColors, 0, 0, 1, 1);
|
|
|
|
|
gridLayout->addWidget(checkBoxUseToolTipsInMainEditor, 1, 0, 1, 1);
|
|
|
|
|
gridLayout->addWidget(checkBoxCloseSourceBuffersOnExit, 2, 0, 1, 1);
|
|
|
|
|
gridLayout->addWidget(checkBoxCloseMemoryBuffersOnExit, 3, 0, 1, 1);
|
|
|
|
|
gridLayout->addWidget(checkBoxBringToForegroundOnInterrrupt, 4, 0, 1, 1);
|
|
|
|
|
gridLayout->addWidget(checkBoxBreakpointsFullPath, 5, 0, 1, 1);
|
|
|
|
|
gridLayout->addWidget(checkBoxWarnOnReleaseBuilds, 6, 0, 1, 1);
|
|
|
|
|
gridLayout->addLayout(horizontalLayout, 7, 0, 1, 2);
|
|
|
|
|
|
|
|
|
|
gridLayout->addWidget(checkBoxFontSizeFollowsEditor, 0, 1, 1, 1);
|
|
|
|
|
gridLayout->addWidget(checkBoxSwitchModeOnExit, 1, 1, 1, 1);
|
|
|
|
|
gridLayout->addWidget(checkBoxShowQmlObjectTree, 2, 1, 1, 1);
|
|
|
|
|
gridLayout->addWidget(checkBoxKeepEditorStationaryWhileStepping, 3, 1, 1, 1);
|
|
|
|
|
gridLayout->addWidget(checkBoxRegisterForPostMortem, 4, 1, 1, 1);
|
|
|
|
|
|
|
|
|
|
auto verticalLayout = new QVBoxLayout(m_widget);
|
|
|
|
|
verticalLayout->addWidget(behaviorBox);
|
|
|
|
|
verticalLayout->addWidget(m_sourceMappingWidget);
|
|
|
|
|
verticalLayout->addStretch();
|
|
|
|
|
|
|
|
|
|
m_group.clear();
|
|
|
|
|
|
|
|
|
|
m_group.insert(action(UseAlternatingRowColors),
|
|
|
|
|
checkBoxUseAlternatingRowColors);
|
|
|
|
|
m_group.insert(action(UseToolTipsInMainEditor),
|
|
|
|
|
checkBoxUseToolTipsInMainEditor);
|
|
|
|
|
m_group.insert(action(CloseSourceBuffersOnExit),
|
|
|
|
|
checkBoxCloseSourceBuffersOnExit);
|
|
|
|
|
m_group.insert(action(CloseMemoryBuffersOnExit),
|
|
|
|
|
checkBoxCloseMemoryBuffersOnExit);
|
|
|
|
|
m_group.insert(action(SwitchModeOnExit),
|
|
|
|
|
checkBoxSwitchModeOnExit);
|
|
|
|
|
m_group.insert(action(BreakpointsFullPathByDefault),
|
|
|
|
|
checkBoxBreakpointsFullPath);
|
|
|
|
|
m_group.insert(action(RaiseOnInterrupt),
|
|
|
|
|
checkBoxBringToForegroundOnInterrrupt);
|
|
|
|
|
m_group.insert(action(ShowQmlObjectTree),
|
|
|
|
|
checkBoxShowQmlObjectTree);
|
|
|
|
|
m_group.insert(action(WarnOnReleaseBuilds),
|
|
|
|
|
checkBoxWarnOnReleaseBuilds);
|
|
|
|
|
m_group.insert(action(StationaryEditorWhileStepping),
|
|
|
|
|
checkBoxKeepEditorStationaryWhileStepping);
|
|
|
|
|
m_group.insert(action(FontSizeFollowsEditor),
|
|
|
|
|
checkBoxFontSizeFollowsEditor);
|
2018-07-23 22:28:49 +02:00
|
|
|
m_group.insert(action(AutoDerefPointers), nullptr);
|
|
|
|
|
m_group.insert(action(UseToolTipsInLocalsView), nullptr);
|
|
|
|
|
m_group.insert(action(AlwaysAdjustColumnWidths), nullptr);
|
|
|
|
|
m_group.insert(action(UseToolTipsInBreakpointsView), nullptr);
|
|
|
|
|
m_group.insert(action(UseToolTipsInStackView), nullptr);
|
2016-11-04 10:12:09 +01:00
|
|
|
m_group.insert(action(MaximalStackDepth), spinBoxMaximalStackDepth);
|
2018-07-23 22:28:49 +02:00
|
|
|
m_group.insert(action(ShowStdNamespace), nullptr);
|
|
|
|
|
m_group.insert(action(ShowQtNamespace), nullptr);
|
|
|
|
|
m_group.insert(action(ShowQObjectNames), nullptr);
|
|
|
|
|
m_group.insert(action(SortStructMembers), nullptr);
|
|
|
|
|
m_group.insert(action(LogTimeStamps), nullptr);
|
|
|
|
|
m_group.insert(action(BreakOnThrow), nullptr);
|
|
|
|
|
m_group.insert(action(BreakOnCatch), nullptr);
|
2016-11-04 10:12:09 +01:00
|
|
|
if (HostOsInfo::isWindowsHost()) {
|
|
|
|
|
SavedAction *registerAction = action(RegisterForPostMortem);
|
|
|
|
|
m_group.insert(registerAction, checkBoxRegisterForPostMortem);
|
|
|
|
|
connect(registerAction, &QAction::toggled,
|
|
|
|
|
checkBoxRegisterForPostMortem, &QAbstractButton::setChecked);
|
|
|
|
|
} else {
|
|
|
|
|
checkBoxRegisterForPostMortem->setVisible(false);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
SourcePathMap allPathMap = m_options->sourcePathMap;
|
2019-07-25 17:27:58 +02:00
|
|
|
for (auto regExpMap : qAsConst(m_options->sourcePathRegExpMap))
|
2016-11-04 10:12:09 +01:00
|
|
|
allPathMap.insert(regExpMap.first.pattern(), regExpMap.second);
|
|
|
|
|
m_sourceMappingWidget->setSourcePathMap(allPathMap);
|
2013-12-03 14:17:03 +01:00
|
|
|
}
|
|
|
|
|
return m_widget;
|
2011-02-22 12:58:32 +01:00
|
|
|
}
|
|
|
|
|
|
2012-08-28 14:37:18 +02:00
|
|
|
QString CommonOptionsPage::msgSetBreakpointAtFunction(const char *function)
|
|
|
|
|
{
|
|
|
|
|
return tr("Stop when %1() is called").arg(QLatin1String(function));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QString CommonOptionsPage::msgSetBreakpointAtFunctionToolTip(const char *function,
|
|
|
|
|
const QString &hint)
|
|
|
|
|
{
|
2018-10-07 22:38:47 +03:00
|
|
|
QString result = "<html><head/><body>";
|
2013-12-04 12:01:17 +01:00
|
|
|
result += tr("Always adds a breakpoint on the <i>%1()</i> function.").arg(QLatin1String(function));
|
2012-08-28 14:37:18 +02:00
|
|
|
if (!hint.isEmpty()) {
|
2018-10-07 22:38:47 +03:00
|
|
|
result += "<br>";
|
2012-08-28 14:37:18 +02:00
|
|
|
result += hint;
|
|
|
|
|
}
|
2018-10-07 22:38:47 +03:00
|
|
|
result += "</body></html>";
|
2012-08-28 14:37:18 +02:00
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
2014-05-16 17:32:07 +02:00
|
|
|
|
2011-02-22 12:58:32 +01:00
|
|
|
///////////////////////////////////////////////////////////////////////
|
|
|
|
|
//
|
2012-05-22 11:17:13 +02:00
|
|
|
// LocalsAndExpressionsOptionsPage
|
2011-02-22 12:58:32 +01:00
|
|
|
//
|
|
|
|
|
///////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
2017-01-17 18:47:58 +01:00
|
|
|
class LocalsAndExpressionsOptionsPageWidget : public IOptionsPageWidget
|
2011-02-22 12:58:32 +01:00
|
|
|
{
|
2017-01-17 18:47:58 +01:00
|
|
|
Q_DECLARE_TR_FUNCTIONS(Debugger::Internal::LocalsAndExpressionsOptionsPage)
|
2011-02-22 12:58:32 +01:00
|
|
|
|
2017-01-17 18:47:58 +01:00
|
|
|
public:
|
|
|
|
|
LocalsAndExpressionsOptionsPageWidget()
|
|
|
|
|
{
|
|
|
|
|
auto debuggingHelperGroupBox = new QGroupBox(this);
|
2014-05-16 17:32:07 +02:00
|
|
|
debuggingHelperGroupBox->setTitle(tr("Use Debugging Helper"));
|
|
|
|
|
debuggingHelperGroupBox->setCheckable(true);
|
|
|
|
|
|
2014-07-08 14:11:48 +02:00
|
|
|
auto label = new QLabel(debuggingHelperGroupBox);
|
2014-05-16 17:32:07 +02:00
|
|
|
label->setTextFormat(Qt::AutoText);
|
|
|
|
|
label->setWordWrap(true);
|
2018-10-07 22:38:47 +03:00
|
|
|
label->setText("<html><head/><body>\n<p>"
|
2014-07-08 14:11:48 +02:00
|
|
|
+ tr("The debugging helpers are used to produce a nice "
|
2014-05-16 17:32:07 +02:00
|
|
|
"display of objects of certain types like QString or "
|
2017-09-08 14:20:43 +02:00
|
|
|
"std::map in the "Locals and Expressions" view.")
|
2018-10-07 22:38:47 +03:00
|
|
|
+ "</p></body></html>");
|
2014-05-16 17:32:07 +02:00
|
|
|
|
2017-05-12 17:03:34 +03:00
|
|
|
auto groupBoxCustomDumperCommands = new QGroupBox(debuggingHelperGroupBox);
|
|
|
|
|
groupBoxCustomDumperCommands->setTitle(tr("Debugging Helper Customization"));
|
2017-09-13 15:56:47 +02:00
|
|
|
groupBoxCustomDumperCommands->setToolTip("<html><head/><body><p>"
|
|
|
|
|
+ tr("Python commands entered here will be executed after built-in "
|
|
|
|
|
"debugging helpers have been loaded and fully initialized. You can "
|
|
|
|
|
"load additional debugging helpers or modify existing ones here.")
|
|
|
|
|
+ "</p></body></html>");
|
2017-05-12 17:03:34 +03:00
|
|
|
|
|
|
|
|
auto textEditCustomDumperCommands = new QTextEdit(groupBoxCustomDumperCommands);
|
|
|
|
|
textEditCustomDumperCommands->setAcceptRichText(false);
|
|
|
|
|
textEditCustomDumperCommands->setToolTip(groupBoxCustomDumperCommands->toolTip());
|
|
|
|
|
|
|
|
|
|
auto groupBoxExtraDumperFile = new QGroupBox(debuggingHelperGroupBox);
|
|
|
|
|
groupBoxExtraDumperFile->setTitle(tr("Extra Debugging Helpers"));
|
|
|
|
|
groupBoxExtraDumperFile->setToolTip(tr(
|
|
|
|
|
"Path to a Python file containing additional data dumpers."));
|
|
|
|
|
|
|
|
|
|
auto pathChooserExtraDumperFile = new Utils::PathChooser(groupBoxExtraDumperFile);
|
|
|
|
|
pathChooserExtraDumperFile->setExpectedKind(Utils::PathChooser::File);
|
|
|
|
|
|
2014-07-08 14:11:48 +02:00
|
|
|
auto checkBoxUseCodeModel = new QCheckBox(debuggingHelperGroupBox);
|
|
|
|
|
auto checkBoxShowThreadNames = new QCheckBox(debuggingHelperGroupBox);
|
2017-01-17 18:47:58 +01:00
|
|
|
auto checkBoxShowStdNamespace = new QCheckBox(this);
|
|
|
|
|
auto checkBoxShowQtNamespace = new QCheckBox(this);
|
|
|
|
|
auto checkBoxShowQObjectNames = new QCheckBox(this);
|
2014-05-16 17:32:07 +02:00
|
|
|
|
2017-01-17 18:47:58 +01:00
|
|
|
auto spinBoxMaximalStringLength = new QSpinBox(this);
|
2014-07-08 14:11:48 +02:00
|
|
|
spinBoxMaximalStringLength->setSpecialValueText(tr("<unlimited>"));
|
|
|
|
|
spinBoxMaximalStringLength->setMaximum(10000000);
|
|
|
|
|
spinBoxMaximalStringLength->setSingleStep(1000);
|
|
|
|
|
spinBoxMaximalStringLength->setValue(10000);
|
|
|
|
|
|
2017-01-17 18:47:58 +01:00
|
|
|
auto spinBoxDisplayStringLimit = new QSpinBox(this);
|
2014-07-08 14:11:48 +02:00
|
|
|
spinBoxDisplayStringLimit->setSpecialValueText(tr("<unlimited>"));
|
|
|
|
|
spinBoxDisplayStringLimit->setMaximum(10000);
|
|
|
|
|
spinBoxDisplayStringLimit->setSingleStep(10);
|
|
|
|
|
spinBoxDisplayStringLimit->setValue(100);
|
|
|
|
|
|
2017-01-17 18:47:58 +01:00
|
|
|
auto chooser = new VariableChooser(this);
|
2017-05-12 17:03:34 +03:00
|
|
|
chooser->addSupportedWidget(textEditCustomDumperCommands);
|
|
|
|
|
chooser->addSupportedWidget(pathChooserExtraDumperFile->lineEdit());
|
|
|
|
|
|
|
|
|
|
auto gridLayout = new QGridLayout(debuggingHelperGroupBox);
|
|
|
|
|
gridLayout->addWidget(label, 0, 0, 1, 1);
|
|
|
|
|
gridLayout->addWidget(checkBoxUseCodeModel, 1, 0, 1, 1);
|
|
|
|
|
gridLayout->addWidget(checkBoxShowThreadNames, 2, 0, 1, 1);
|
|
|
|
|
gridLayout->addWidget(groupBoxExtraDumperFile, 3, 0, 1, 1);
|
|
|
|
|
gridLayout->addWidget(groupBoxCustomDumperCommands, 0, 1, 4, 1);
|
2014-05-16 17:32:07 +02:00
|
|
|
|
2014-07-08 14:11:48 +02:00
|
|
|
auto layout1 = new QFormLayout;
|
|
|
|
|
layout1->addItem(new QSpacerItem(10, 10));
|
|
|
|
|
layout1->addRow(checkBoxShowStdNamespace);
|
|
|
|
|
layout1->addRow(checkBoxShowQtNamespace);
|
2015-12-16 14:13:44 +01:00
|
|
|
layout1->addRow(checkBoxShowQObjectNames);
|
2014-07-08 14:11:48 +02:00
|
|
|
layout1->addItem(new QSpacerItem(10, 10));
|
|
|
|
|
layout1->addRow(tr("Maximum string length:"), spinBoxMaximalStringLength);
|
2014-07-30 09:26:42 +02:00
|
|
|
layout1->addRow(tr("Display string length:"), spinBoxDisplayStringLimit);
|
2014-07-08 14:11:48 +02:00
|
|
|
|
|
|
|
|
auto lowerLayout = new QHBoxLayout;
|
|
|
|
|
lowerLayout->addLayout(layout1);
|
|
|
|
|
lowerLayout->addStretch();
|
|
|
|
|
|
2017-01-17 18:47:58 +01:00
|
|
|
auto layout = new QVBoxLayout(this);
|
2014-05-16 17:32:07 +02:00
|
|
|
layout->addWidget(debuggingHelperGroupBox);
|
2014-07-08 14:11:48 +02:00
|
|
|
layout->addLayout(lowerLayout);
|
2014-05-16 17:32:07 +02:00
|
|
|
layout->addStretch();
|
2011-02-22 12:58:32 +01:00
|
|
|
|
2017-05-12 17:03:34 +03:00
|
|
|
auto customDumperLayout = new QGridLayout(groupBoxCustomDumperCommands);
|
|
|
|
|
customDumperLayout->addWidget(textEditCustomDumperCommands, 0, 0, 1, 1);
|
|
|
|
|
|
|
|
|
|
auto extraDumperLayout = new QGridLayout(groupBoxExtraDumperFile);
|
|
|
|
|
extraDumperLayout->addWidget(pathChooserExtraDumperFile, 0, 0, 1, 1);
|
|
|
|
|
|
2014-05-16 17:32:07 +02:00
|
|
|
m_group.clear();
|
2014-07-28 14:23:52 +02:00
|
|
|
m_group.insert(action(UseDebuggingHelpers), debuggingHelperGroupBox);
|
2017-05-12 17:03:34 +03:00
|
|
|
m_group.insert(action(ExtraDumperFile), pathChooserExtraDumperFile);
|
|
|
|
|
m_group.insert(action(ExtraDumperCommands), textEditCustomDumperCommands);
|
2014-07-28 14:23:52 +02:00
|
|
|
m_group.insert(action(UseCodeModel), checkBoxUseCodeModel);
|
|
|
|
|
m_group.insert(action(ShowThreadNames), checkBoxShowThreadNames);
|
|
|
|
|
m_group.insert(action(ShowStdNamespace), checkBoxShowStdNamespace);
|
|
|
|
|
m_group.insert(action(ShowQtNamespace), checkBoxShowQtNamespace);
|
2015-12-16 14:13:44 +01:00
|
|
|
m_group.insert(action(ShowQObjectNames), checkBoxShowQObjectNames);
|
2014-07-28 14:23:52 +02:00
|
|
|
m_group.insert(action(DisplayStringLimit), spinBoxDisplayStringLimit);
|
|
|
|
|
m_group.insert(action(MaximalStringLength), spinBoxMaximalStringLength);
|
2011-02-22 12:58:32 +01:00
|
|
|
}
|
2017-01-17 18:47:58 +01:00
|
|
|
|
|
|
|
|
void apply() { m_group.apply(ICore::settings()); }
|
|
|
|
|
void finish() { m_group.finish(); }
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
Utils::SavedActionSet m_group;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
LocalsAndExpressionsOptionsPage::LocalsAndExpressionsOptionsPage()
|
|
|
|
|
{
|
|
|
|
|
setId("Z.Debugger.LocalsAndExpressions");
|
|
|
|
|
//: '&&' will appear as one (one is marking keyboard shortcut)
|
|
|
|
|
setDisplayName(QCoreApplication::translate("Debugger", "Locals && Expressions"));
|
|
|
|
|
setCategory(DEBUGGER_SETTINGS_CATEGORY);
|
|
|
|
|
setWidgetCreator([] { return new LocalsAndExpressionsOptionsPageWidget; });
|
2011-02-22 12:58:32 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} // namespace Internal
|
|
|
|
|
} // namespace Debugger
|