Commit f8f5263b authored by hjk's avatar hjk

debugger: split options page

parent b81eb94f
......@@ -77,6 +77,7 @@ FORMS += attachexternaldialog.ui \
attachcoredialog.ui \
breakbyfunction.ui \
breakcondition.ui \
dumperoptionpage.ui \
gdboptionpage.ui \
startexternaldialog.ui \
......
......@@ -422,6 +422,20 @@ DebuggerSettings *theDebuggerSettings()
item->setText(QObject::tr("Use custom dumpers"));
item->setCheckable(true);
item = new DebuggerAction(instance);
instance->insertItem(BuildDumpersOnTheFly, item);
item->setSettingsKey("DebugMode", "BuildDumpersOnTheFly");
item->setCheckable(true);
item = new DebuggerAction(instance);
instance->insertItem(UsePrebuiltDumpers, item);
item->setSettingsKey("DebugMode", "UsePrebuiltDumpers");
item->setCheckable(true);
item = new DebuggerAction(instance);
instance->insertItem(PrebuiltDumpersLocation, item);
item->setSettingsKey("DebugMode", "PrebuiltDumpersLocation");
item = new DebuggerAction(instance);
instance->insertItem(Terminal, item);
item->setDefaultValue("xterm");
......
......@@ -148,11 +148,15 @@ enum DebuggerActionCode
WatchExpressionInWindow,
RemoveWatchExpression,
WatchModelUpdate,
UseToolTips,
AssignValue,
RecheckDumpers,
UsePrebuiltDumpers,
PrebuiltDumpersLocation,
BuildDumpersOnTheFly,
UseDumpers,
DebugDumpers,
UseToolTips,
AssignValue,
// Source List
ListSourceFiles,
......
......@@ -36,6 +36,7 @@
#include "gdbengine.h"
#include "ui_gdboptionpage.h"
#include "ui_dumperoptionpage.h"
#include <coreplugin/actionmanager/actionmanager.h>
#include <coreplugin/basemode.h>
......@@ -244,8 +245,8 @@ public:
GdbOptionPage(DebuggerPlugin *plugin) : m_plugin(plugin) {}
// IOptionsPage
QString id() const { return QLatin1String("Gdb"); }
QString trName() const { return tr("Gdb"); }
QString id() const { return QLatin1String("General"); }
QString trName() const { return tr("General"); }
QString category() const { return QLatin1String("Debugger"); }
QString trCategory() const { return tr("Debugger"); }
......@@ -289,14 +290,10 @@ QWidget *GdbOptionPage::createPage(QWidget *parent)
theDebuggerAction(SelectedPluginBreakpointsPattern)
->connectWidget(m_ui.lineEditSelectedPluginBreakpointsPattern);
theDebuggerAction(UseDumpers)
->connectWidget(m_ui.checkBoxUseDumpers);
theDebuggerAction(SkipKnownFrames)
->connectWidget(m_ui.checkBoxSkipKnownFrames);
theDebuggerAction(UseToolTips)
->connectWidget(m_ui.checkBoxUseToolTips);
theDebuggerAction(DebugDumpers)
->connectWidget(m_ui.checkBoxDebugDumpers);
theDebuggerAction(SelectedPluginBreakpointsPattern)
->connectWidget(m_ui.lineEditSelectedPluginBreakpointsPattern);
......@@ -305,16 +302,6 @@ QWidget *GdbOptionPage::createPage(QWidget *parent)
connect(m_ui.radioButtonSelectedPluginBreakpoints, SIGNAL(toggled(bool)),
m_ui.lineEditSelectedPluginBreakpointsPattern, SLOT(setEnabled(bool)));
#ifndef QT_DEBUG
#if 0
cmd = am->registerAction(m_manager->m_dumpLogAction,
Constants::DUMP_LOG, globalcontext);
//cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+D,Ctrl+L")));
cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+Shift+F11")));
mdebug->addAction(cmd);
#endif
#endif
// FIXME
m_ui.environmentEdit->hide();
m_ui.labelEnvironment->hide();
......@@ -339,10 +326,8 @@ void GdbOptionPage::apply()
theDebuggerAction(NoPluginBreakpoints)->apply(s);
theDebuggerAction(SelectedPluginBreakpointsPattern)->apply(s);
theDebuggerAction(UseDumpers)->apply(s);
theDebuggerAction(SkipKnownFrames)->apply(s);
theDebuggerAction(UseToolTips)->apply(s);
theDebuggerAction(DebugDumpers)->apply(s);
theDebuggerAction(SelectedPluginBreakpointsPattern)->apply(s);
}
......@@ -350,6 +335,89 @@ void GdbOptionPage::apply()
} // namespace Debugger
///////////////////////////////////////////////////////////////////////
//
// DumperOptionPage
//
///////////////////////////////////////////////////////////////////////
namespace Debugger {
namespace Internal {
class DumperOptionPage : public Core::IOptionsPage
{
Q_OBJECT
public:
DumperOptionPage(DebuggerPlugin *plugin) : m_plugin(plugin) {}
// IOptionsPage
QString id() const { return QLatin1String("DataDumper"); }
QString trName() const { return tr("Data Dumper"); }
QString category() const { return QLatin1String("Debugger"); }
QString trCategory() const { return tr("Debugger"); }
QWidget *createPage(QWidget *parent);
void apply();
void finish() {} // automatically calls "apply"
private:
friend class DebuggerPlugin;
Ui::DumperOptionPage m_ui;
DebuggerPlugin *m_plugin;
};
QWidget *DumperOptionPage::createPage(QWidget *parent)
{
QWidget *w = new QWidget(parent);
m_ui.setupUi(w);
m_ui.dumperLocationChooser->setExpectedKind(Core::Utils::PathChooser::Command);
m_ui.dumperLocationChooser->setPromptDialogTitle(tr("Choose Dumper Location"));
theDebuggerAction(UsePrebuiltDumpers)
->connectWidget(m_ui.radioButtonUsePrebuiltDumpers);
theDebuggerAction(PrebuiltDumpersLocation)
->connectWidget(m_ui.dumperLocationChooser);
theDebuggerAction(UseDumpers)
->connectWidget(m_ui.checkBoxUseDumpers);
theDebuggerAction(DebugDumpers)
->connectWidget(m_ui.checkBoxDebugDumpers);
m_ui.dumperLocationChooser->
setEnabled(theDebuggerAction(UsePrebuiltDumpers)->value().toBool());
connect(m_ui.radioButtonUsePrebuiltDumpers, SIGNAL(toggled(bool)),
m_ui.dumperLocationChooser, SLOT(setEnabled(bool)));
#ifndef QT_DEBUG
#if 0
cmd = am->registerAction(m_manager->m_dumpLogAction,
Constants::DUMP_LOG, globalcontext);
//cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+D,Ctrl+L")));
cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+Shift+F11")));
mdebug->addAction(cmd);
#endif
#endif
return w;
}
void DumperOptionPage::apply()
{
QSettings *s = ICore::instance()->settings();
theDebuggerAction(UseDumpers)->apply(s);
theDebuggerAction(UsePrebuiltDumpers)->apply(s);
theDebuggerAction(PrebuiltDumpersLocation)->apply(s);
theDebuggerAction(DebugDumpers)->apply(s);
}
} // namespace Internal
} // namespace Debugger
///////////////////////////////////////////////////////////////////////
//
// DebuggerPlugin
......@@ -359,6 +427,7 @@ void GdbOptionPage::apply()
DebuggerPlugin::DebuggerPlugin()
{
m_generalOptionPage = 0;
m_dumperOptionPage = 0;
m_locationMark = 0;
m_manager = 0;
m_debugMode = 0;
......@@ -385,6 +454,7 @@ void DebuggerPlugin::shutdown()
//qDebug() << "DebuggerPlugin::~DebuggerPlugin";
removeObject(m_debugMode);
removeObject(m_generalOptionPage);
removeObject(m_dumperOptionPage);
// FIXME: when using the line below, BreakWindow etc gets deleted twice.
// so better leak for now...
......@@ -394,6 +464,9 @@ void DebuggerPlugin::shutdown()
delete m_generalOptionPage;
m_generalOptionPage = 0;
delete m_dumperOptionPage;
m_dumperOptionPage = 0;
delete m_locationMark;
m_locationMark = 0;
......@@ -588,6 +661,8 @@ bool DebuggerPlugin::initialize(const QStringList &arguments, QString *errorMess
// FIXME:
m_generalOptionPage = new GdbOptionPage(this);
addObject(m_generalOptionPage);
m_dumperOptionPage = new DumperOptionPage(this);
addObject(m_dumperOptionPage);
m_locationMark = 0;
......
......@@ -57,6 +57,7 @@ namespace Internal {
class DebuggerManager;
class DebugMode;
class GdbOptionPage;
class DumperOptionPage;
class LocationMark;
class DebuggerPlugin : public ExtensionSystem::IPlugin
......@@ -101,12 +102,14 @@ private:
friend class DebuggerManager;
friend class GdbOptionPage;
friend class DumperOptionPage;
friend class DebugMode; // FIXME: Just a hack now so that it can access the views
DebuggerManager *m_manager;
DebugMode *m_debugMode;
GdbOptionPage *m_generalOptionPage;
DumperOptionPage *m_dumperOptionPage;
QString m_previousMode;
LocationMark *m_locationMark;
......
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>DumperOptionPage</class>
<widget class="QWidget" name="DumperOptionPage">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>398</width>
<height>426</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<widget class="QGroupBox" name="groupBoxDataDumpers">
<property name="title">
<string>Location of data dumper helper library</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QRadioButton" name="radioButtonDumpersOnTheFly">
<property name="toolTip">
<string>This is the slowest but safest option.</string>
</property>
<property name="text">
<string>Build and load data dumpers on-the-fly</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QRadioButton" name="radioButtonUsePrebuiltDumpers">
<property name="text">
<string>Load pre-built data dumpers</string>
</property>
</widget>
</item>
<item row="2" column="0">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Preferred</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>10</width>
<height>10</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="labelDumperLocation">
<property name="text">
<string>Location: </string>
</property>
</widget>
</item>
<item>
<widget class="Core::Utils::PathChooser" name="dumperLocationChooser" native="true"/>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item row="3" column="0">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>10</width>
<height>1</height>
</size>
</property>
</spacer>
</item>
<item row="2" column="0">
<widget class="QCheckBox" name="checkBoxDebugDumpers">
<property name="toolTip">
<string notr="true">This is an internal tool to make debugging the Custom Data Dumper code easier. Using this action is in general not needed unless you want do debug Qt Creator itself.</string>
</property>
<property name="text">
<string>Debug custom dumpers</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QCheckBox" name="checkBoxUseDumpers">
<property name="text">
<string>Use data dumpers</string>
</property>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>Core::Utils::PathChooser</class>
<extends>QWidget</extends>
<header location="global">utils/pathchooser.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>
......@@ -6,18 +6,18 @@
<rect>
<x>0</x>
<y>0</y>
<width>398</width>
<height>385</height>
<width>410</width>
<height>435</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QGroupBox" name="groupBoxLocations">
<property name="title">
<string>Locations</string>
<string>Gdb interaction</string>
</property>
<layout class="QGridLayout" name="gridLayout_3">
<property name="margin">
......@@ -82,7 +82,7 @@ you indent to use or the name of a terminal that will be searched in your PATH.<
</layout>
</widget>
</item>
<item row="1" column="0">
<item>
<widget class="QGroupBox" name="groupBoxPluginDebugging">
<property name="title">
<string>Behaviour of breakpoint setting in plugins</string>
......@@ -145,48 +145,47 @@ you indent to use or the name of a terminal that will be searched in your PATH.<
</layout>
</widget>
</item>
<item row="2" column="0">
<widget class="QCheckBox" name="checkBoxUseDumpers">
<property name="toolTip">
<string>Checking this will make the debugger try to use code to format certain data (QObject, QString, std::string etc.) nicely.</string>
</property>
<property name="text">
<string>Use custom display for Qt and Standard Library objects</string>
<item>
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>User interface</string>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QCheckBox" name="checkBoxSkipKnownFrames">
<property name="toolTip">
<string>When this option is checked, 'Step Into' compresses several steps into one in certain situations, leading to 'less noisy' debugging. So will, e.g., the atomic
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QCheckBox" name="checkBoxListSourceFiles">
<property name="toolTip">
<string>Checking this will populate the source file view automatically but might slow down debugger startup considerably.</string>
</property>
<property name="text">
<string>Populate source file view automatically</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkBoxSkipKnownFrames">
<property name="toolTip">
<string>When this option is checked, 'Step Into' compresses several steps into one in certain situations, leading to 'less noisy' debugging. So will, e.g., the atomic
reference counting code be skipped, and a single 'Step Into' for a signal emission will end up directly in the slot connected to it.</string>
</property>
<property name="text">
<string>Skip known frames when stepping</string>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QCheckBox" name="checkBoxUseToolTips">
<property name="toolTip">
<string>Checking this will make enable tooltips for variable values during debugging. Since this can slow down debugging and does not provide reliable information as it does not use scope information, it is switched off by default.</string>
</property>
<property name="text">
<string>Use tooltips while debugging</string>
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QCheckBox" name="checkBoxDebugDumpers">
<property name="toolTip">
<string notr="true">This is an internal tool to make debugging the Custom Data Dumper code easier. Using this action is in general not needed unless you want do debug Qt Creator itself.</string>
</property>
<property name="text">
<string>Debug Custom Dumpers</string>
</property>
</property>
<property name="text">
<string>Skip known frames when stepping</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkBoxUseToolTips">
<property name="toolTip">
<string>Checking this will make enable tooltips for variable values during debugging. Since this can slow down debugging and does not provide reliable information as it does not use scope information, it is switched off by default.</string>
</property>
<property name="text">
<string>Use tooltips while debugging</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="7" column="0">
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
......@@ -199,16 +198,6 @@ you indent to use or the name of a terminal that will be searched in your PATH.<
</property>
</spacer>
</item>
<item row="3" column="0">
<widget class="QCheckBox" name="checkBoxListSourceFiles">
<property name="toolTip">
<string>Checking this will populate the source file view automatically but might slow down debugger startup considerably.</string>
</property>
<property name="text">
<string>Populate source file view automatically</string>
</property>
</widget>
</item>
</layout>
</widget>
<customwidgets>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment