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 <coreplugin/icore.h>
|
2017-05-12 17:03:34 +03:00
|
|
|
|
2021-03-01 08:59:44 +01:00
|
|
|
#include <utils/layoutbuilder.h>
|
2011-02-22 12:58:32 +01:00
|
|
|
|
|
|
|
|
using namespace Core;
|
|
|
|
|
using namespace Debugger::Constants;
|
2016-11-04 10:12:09 +01:00
|
|
|
using namespace Utils;
|
2011-02-22 12:58:32 +01:00
|
|
|
|
|
|
|
|
namespace Debugger {
|
|
|
|
|
namespace Internal {
|
|
|
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////
|
|
|
|
|
//
|
|
|
|
|
// CommonOptionsPage
|
|
|
|
|
//
|
|
|
|
|
///////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
2020-01-08 15:54:20 +01:00
|
|
|
class CommonOptionsPageWidget : public Core::IOptionsPageWidget
|
2011-02-22 12:58:32 +01:00
|
|
|
{
|
2020-01-10 13:46:51 +01:00
|
|
|
Q_DECLARE_TR_FUNCTIONS(Debugger::Internal::CommonOptionsPageWidget)
|
|
|
|
|
|
2020-01-08 15:54:20 +01:00
|
|
|
public:
|
|
|
|
|
explicit CommonOptionsPageWidget()
|
|
|
|
|
{
|
2021-03-01 08:59:44 +01:00
|
|
|
DebuggerSettings &s = *debuggerSettings();
|
|
|
|
|
using namespace Layouting;
|
|
|
|
|
|
|
|
|
|
Column col1 {
|
|
|
|
|
s.useAlternatingRowColors,
|
|
|
|
|
s.useAnnotationsInMainEditor,
|
|
|
|
|
s.useToolTipsInMainEditor,
|
|
|
|
|
s.closeSourceBuffersOnExit,
|
|
|
|
|
s.closeMemoryBuffersOnExit,
|
|
|
|
|
s.raiseOnInterrupt,
|
|
|
|
|
s.breakpointsFullPathByDefault,
|
|
|
|
|
s.warnOnReleaseBuilds,
|
|
|
|
|
Row { s.maximalStackDepth, Stretch() }
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
Column col2 {
|
|
|
|
|
s.fontSizeFollowsEditor,
|
|
|
|
|
s.switchModeOnExit,
|
|
|
|
|
s.showQmlObjectTree,
|
|
|
|
|
s.stationaryEditorWhileStepping,
|
2021-03-09 11:53:09 +01:00
|
|
|
s.forceLoggingToConsole,
|
2021-03-01 08:59:44 +01:00
|
|
|
s.registerForPostMortem,
|
|
|
|
|
Stretch()
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
Column {
|
|
|
|
|
Group { Title("Behavior"), Row { col1, col2, Stretch() } },
|
2021-03-05 12:48:26 +01:00
|
|
|
s.sourcePathMap,
|
2021-03-01 08:59:44 +01:00
|
|
|
Stretch()
|
|
|
|
|
}.attachTo(this);
|
2013-12-03 14:17:03 +01:00
|
|
|
}
|
2020-01-08 15:54:20 +01:00
|
|
|
|
2021-03-05 12:48:26 +01:00
|
|
|
void apply() final { m_group.apply(); m_group.writeSettings(ICore::settings()); }
|
2020-01-08 15:54:20 +01:00
|
|
|
void finish() final { m_group.finish(); }
|
|
|
|
|
|
|
|
|
|
private:
|
2021-03-01 08:59:44 +01:00
|
|
|
AspectContainer &m_group = debuggerSettings()->page1;
|
2020-01-08 15:54:20 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
CommonOptionsPage::CommonOptionsPage()
|
|
|
|
|
{
|
|
|
|
|
setId(DEBUGGER_COMMON_SETTINGS_ID);
|
|
|
|
|
setDisplayName(QCoreApplication::translate("Debugger", "General"));
|
|
|
|
|
setCategory(DEBUGGER_SETTINGS_CATEGORY);
|
|
|
|
|
setDisplayCategory(QCoreApplication::translate("Debugger", "Debugger"));
|
2020-01-10 09:33:24 +01:00
|
|
|
setCategoryIconPath(":/debugger/images/settingscategory_debugger.png");
|
2020-01-08 15:54:20 +01:00
|
|
|
setWidgetCreator([] { return new CommonOptionsPageWidget; });
|
2011-02-22 12:58:32 +01:00
|
|
|
}
|
|
|
|
|
|
2012-08-28 14:37:18 +02:00
|
|
|
QString CommonOptionsPage::msgSetBreakpointAtFunction(const char *function)
|
|
|
|
|
{
|
2020-01-10 13:46:51 +01:00
|
|
|
return CommonOptionsPageWidget::tr("Stop when %1() is called").arg(QLatin1String(function));
|
2012-08-28 14:37:18 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QString CommonOptionsPage::msgSetBreakpointAtFunctionToolTip(const char *function,
|
|
|
|
|
const QString &hint)
|
|
|
|
|
{
|
2018-10-07 22:38:47 +03:00
|
|
|
QString result = "<html><head/><body>";
|
2020-01-10 13:46:51 +01:00
|
|
|
result += CommonOptionsPageWidget::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()
|
|
|
|
|
{
|
2021-03-01 08:59:44 +01:00
|
|
|
using namespace Layouting;
|
|
|
|
|
DebuggerSettings &s = *debuggerSettings();
|
2014-05-16 17:32:07 +02:00
|
|
|
|
2021-03-01 08:59:44 +01:00
|
|
|
auto label = new QLabel; //(useHelperGroup);
|
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 "
|
2020-04-08 14:22:24 +02:00
|
|
|
"std::map in the "Locals" and "Expressions" views.")
|
2018-10-07 22:38:47 +03:00
|
|
|
+ "</p></body></html>");
|
2014-05-16 17:32:07 +02:00
|
|
|
|
2021-03-01 08:59:44 +01:00
|
|
|
Column left {
|
|
|
|
|
label,
|
|
|
|
|
s.useCodeModel,
|
|
|
|
|
s.showThreadNames,
|
|
|
|
|
Group { Title(tr("Extra Debugging Helper")), s.extraDumperFile }
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
Group useHelper {
|
|
|
|
|
Row {
|
|
|
|
|
left,
|
|
|
|
|
Group { Title(tr("Debugging Helper Customization")), s.extraDumperCommands }
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
Grid limits {
|
|
|
|
|
s.maximalStringLength,
|
|
|
|
|
Break(),
|
|
|
|
|
s.displayStringLimit
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
Column {
|
|
|
|
|
s.useDebuggingHelpers,
|
|
|
|
|
useHelper,
|
|
|
|
|
Space(10),
|
|
|
|
|
s.showStdNamespace,
|
|
|
|
|
s.showQtNamespace,
|
|
|
|
|
s.showQObjectNames,
|
|
|
|
|
Space(10),
|
|
|
|
|
Row { limits, Stretch() },
|
|
|
|
|
Stretch()
|
|
|
|
|
}.attachTo(this);
|
2011-02-22 12:58:32 +01:00
|
|
|
}
|
2017-01-17 18:47:58 +01:00
|
|
|
|
2021-03-01 08:59:44 +01:00
|
|
|
void apply() final { m_group.apply(); m_group.writeSettings(ICore::settings()); }
|
2020-11-18 15:26:38 +01:00
|
|
|
void finish() final { m_group.finish(); }
|
2017-01-17 18:47:58 +01:00
|
|
|
|
|
|
|
|
private:
|
2021-03-01 08:59:44 +01:00
|
|
|
AspectContainer &m_group = debuggerSettings()->page4;
|
2017-01-17 18:47:58 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
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
|