2012-10-02 09:12:39 +02:00
|
|
|
/****************************************************************************
|
2010-01-04 11:36:55 +01:00
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
|
** Contact: https://www.qt.io/licensing/
|
2010-01-04 11:36:55 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** This file is part of Qt Creator.
|
2010-01-04 11:36:55 +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.
|
2010-01-04 11:36:55 +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.
|
2010-12-17 16:01:08 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
****************************************************************************/
|
2010-01-04 11:36:55 +01:00
|
|
|
|
2013-08-29 16:36:42 +02:00
|
|
|
#include <debugger/debuggeractions.h>
|
|
|
|
|
#include <debugger/debuggercore.h>
|
|
|
|
|
#include <debugger/debuggerinternalconstants.h>
|
2017-01-17 18:47:58 +01:00
|
|
|
#include <debugger/debuggerconstants.h>
|
2009-04-17 09:03:32 +02:00
|
|
|
|
2015-06-10 14:52:38 +02:00
|
|
|
#include <coreplugin/dialogs/ioptionspage.h>
|
2009-04-17 09:03:32 +02:00
|
|
|
#include <coreplugin/icore.h>
|
2010-11-10 16:33:11 +01:00
|
|
|
|
2021-03-01 08:59:44 +01:00
|
|
|
#include <utils/layoutbuilder.h>
|
2011-02-22 11:35:03 +01:00
|
|
|
|
2014-06-05 17:49:51 +02:00
|
|
|
using namespace Core;
|
2017-01-17 18:47:58 +01:00
|
|
|
using namespace Utils;
|
2014-06-05 17:49:51 +02:00
|
|
|
|
2009-04-17 09:03:32 +02:00
|
|
|
namespace Debugger {
|
|
|
|
|
namespace Internal {
|
|
|
|
|
|
2013-03-21 17:10:47 +01:00
|
|
|
/////////////////////////////////////////////////////////////////////////
|
|
|
|
|
//
|
|
|
|
|
// GdbOptionsPageWidget - harmless options
|
|
|
|
|
//
|
|
|
|
|
/////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
2017-01-17 18:47:58 +01:00
|
|
|
class GdbOptionsPage : public Core::IOptionsPage
|
2011-11-29 13:30:09 +01:00
|
|
|
{
|
2020-01-10 13:46:51 +01:00
|
|
|
Q_DECLARE_TR_FUNCTIONS(Debugger::Internal::GdbOptionsPage)
|
|
|
|
|
|
2011-11-29 13:30:09 +01:00
|
|
|
public:
|
2017-01-17 18:47:58 +01:00
|
|
|
GdbOptionsPage();
|
2011-11-29 13:30:09 +01:00
|
|
|
};
|
|
|
|
|
|
2017-01-17 18:47:58 +01:00
|
|
|
class GdbOptionsPageWidget : public IOptionsPageWidget
|
2015-06-10 14:52:38 +02:00
|
|
|
{
|
2021-03-01 08:59:44 +01:00
|
|
|
Q_DECLARE_TR_FUNCTIONS(Debugger::Internal::GdbOptionsPage)
|
|
|
|
|
|
2015-06-10 14:52:38 +02:00
|
|
|
public:
|
2017-01-17 18:47:58 +01:00
|
|
|
GdbOptionsPageWidget();
|
2015-06-10 14:52:38 +02:00
|
|
|
|
2021-03-01 08:59:44 +01:00
|
|
|
void apply() final { group.apply(); group.writeSettings(ICore::settings()); }
|
2017-01-17 18:47:58 +01:00
|
|
|
void finish() final { group.finish(); }
|
2015-06-10 14:52:38 +02:00
|
|
|
|
2021-03-01 08:59:44 +01:00
|
|
|
AspectContainer &group = debuggerSettings()->page2;
|
2015-06-10 14:52:38 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
GdbOptionsPageWidget::GdbOptionsPageWidget()
|
2012-08-13 17:39:29 +02:00
|
|
|
{
|
2021-03-01 08:59:44 +01:00
|
|
|
using namespace Layouting;
|
|
|
|
|
DebuggerSettings &s = *debuggerSettings();
|
|
|
|
|
|
|
|
|
|
Group general {
|
|
|
|
|
Title { tr("General") },
|
|
|
|
|
Row { s.gdbWatchdogTimeout, Stretch() },
|
|
|
|
|
s.skipKnownFrames,
|
|
|
|
|
s.useMessageBoxForSignals,
|
|
|
|
|
s.adjustBreakpointLocations,
|
|
|
|
|
s.useDynamicType,
|
|
|
|
|
s.loadGdbInit,
|
|
|
|
|
s.loadGdbDumpers,
|
|
|
|
|
s.intelFlavor,
|
|
|
|
|
s.usePseudoTracepoints,
|
|
|
|
|
Stretch()
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
Column commands {
|
|
|
|
|
Group { Title { tr("Additional Startup Commands") }, s.gdbStartupCommands },
|
|
|
|
|
Group { Title { tr("Additional Attach Commands") }, s.gdbPostAttachCommands }
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
Row { general, commands }.attachTo(this);
|
2012-08-13 17:39:29 +02:00
|
|
|
}
|
|
|
|
|
|
2010-06-16 11:08:54 +02:00
|
|
|
GdbOptionsPage::GdbOptionsPage()
|
2010-03-26 17:34:10 +01:00
|
|
|
{
|
2013-01-16 15:22:58 +01:00
|
|
|
setId("M.Gdb");
|
2012-05-22 11:17:13 +02:00
|
|
|
setDisplayName(tr("GDB"));
|
2012-12-29 03:37:27 +01:00
|
|
|
setCategory(Constants::DEBUGGER_SETTINGS_CATEGORY);
|
2017-01-17 18:47:58 +01:00
|
|
|
setWidgetCreator([] { return new GdbOptionsPageWidget; });
|
2009-11-24 15:05:02 +01:00
|
|
|
}
|
|
|
|
|
|
2013-03-21 17:10:47 +01:00
|
|
|
/////////////////////////////////////////////////////////////////////////
|
|
|
|
|
//
|
|
|
|
|
// GdbOptionsPageWidget2 - dangerous options
|
|
|
|
|
//
|
|
|
|
|
/////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
2017-01-17 18:47:58 +01:00
|
|
|
class GdbOptionsPageWidget2 : public IOptionsPageWidget
|
2013-03-21 17:10:47 +01:00
|
|
|
{
|
|
|
|
|
public:
|
2015-06-10 14:52:38 +02:00
|
|
|
GdbOptionsPageWidget2();
|
2013-03-21 17:10:47 +01:00
|
|
|
|
2021-03-01 08:59:44 +01:00
|
|
|
void apply() final { group.apply(); group.writeSettings(ICore::settings()); }
|
2017-01-17 18:47:58 +01:00
|
|
|
void finish() final { group.finish(); }
|
|
|
|
|
|
2021-03-01 08:59:44 +01:00
|
|
|
AspectContainer &group = debuggerSettings()->page3;
|
2013-03-21 17:10:47 +01:00
|
|
|
};
|
|
|
|
|
|
2015-06-10 14:52:38 +02:00
|
|
|
GdbOptionsPageWidget2::GdbOptionsPageWidget2()
|
2013-03-21 17:10:47 +01:00
|
|
|
{
|
2021-03-01 08:59:44 +01:00
|
|
|
auto labelDangerous = new QLabel("<html><head/><body><i>" +
|
|
|
|
|
GdbOptionsPage::tr("The options below give access to advanced "
|
|
|
|
|
"or experimental functions of GDB.<br>Enabling them may negatively "
|
|
|
|
|
"impact your debugging experience.") + "</i></body></html>");
|
|
|
|
|
|
|
|
|
|
using namespace Layouting;
|
|
|
|
|
DebuggerSettings &s = *debuggerSettings();
|
|
|
|
|
|
|
|
|
|
Group {
|
|
|
|
|
Title(GdbOptionsPage::tr("Extended")),
|
|
|
|
|
labelDangerous,
|
|
|
|
|
s.targetAsync,
|
|
|
|
|
s.autoEnrichParameters,
|
|
|
|
|
s.breakOnWarning,
|
|
|
|
|
s.breakOnFatal,
|
|
|
|
|
s.breakOnAbort,
|
|
|
|
|
s.enableReverseDebugging,
|
|
|
|
|
s.multiInferior,
|
|
|
|
|
}.attachTo(this);
|
2013-03-21 17:10:47 +01:00
|
|
|
}
|
|
|
|
|
|
2015-06-10 14:52:38 +02:00
|
|
|
// The "Dangerous" options.
|
|
|
|
|
class GdbOptionsPage2 : public Core::IOptionsPage
|
|
|
|
|
{
|
|
|
|
|
public:
|
2017-01-17 18:47:58 +01:00
|
|
|
GdbOptionsPage2()
|
|
|
|
|
{
|
|
|
|
|
setId("M.Gdb2");
|
|
|
|
|
setDisplayName(GdbOptionsPage::tr("GDB Extended"));
|
|
|
|
|
setCategory(Constants::DEBUGGER_SETTINGS_CATEGORY);
|
|
|
|
|
setWidgetCreator([] { return new GdbOptionsPageWidget2; });
|
2013-12-03 14:17:03 +01:00
|
|
|
}
|
2017-01-17 18:47:58 +01:00
|
|
|
};
|
2013-03-21 17:10:47 +01:00
|
|
|
|
2015-06-10 14:52:38 +02:00
|
|
|
// Registration
|
|
|
|
|
|
|
|
|
|
void addGdbOptionPages(QList<IOptionsPage *> *opts)
|
|
|
|
|
{
|
|
|
|
|
opts->push_back(new GdbOptionsPage);
|
|
|
|
|
opts->push_back(new GdbOptionsPage2);
|
|
|
|
|
}
|
|
|
|
|
|
2009-04-17 09:03:32 +02:00
|
|
|
} // namespace Internal
|
|
|
|
|
} // namespace Debugger
|