summaryrefslogtreecommitdiff
path: root/src/plugins
diff options
context:
space:
mode:
authorhjk <qtc-committer@nokia.com>2009-03-23 12:28:02 +0100
committerhjk <qtc-committer@nokia.com>2009-03-23 12:28:26 +0100
commitf8f5263b386ecabeebf2f5b360bae17187ae0dc2 (patch)
treed8bf67759bf75562ecb3aaa07a9f627013638566 /src/plugins
parentb81eb94f943acc60c9d94d5ec9644eaaacbf2cbf (diff)
downloadqt-creator-f8f5263b386ecabeebf2f5b360bae17187ae0dc2.tar.gz
debugger: split options page
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/debugger/debugger.pro1
-rw-r--r--src/plugins/debugger/debuggeractions.cpp14
-rw-r--r--src/plugins/debugger/debuggeractions.h8
-rw-r--r--src/plugins/debugger/debuggerplugin.cpp111
-rw-r--r--src/plugins/debugger/debuggerplugin.h3
-rw-r--r--src/plugins/debugger/dumperoptionpage.ui115
-rw-r--r--src/plugins/debugger/gdboptionpage.ui97
7 files changed, 275 insertions, 74 deletions
diff --git a/src/plugins/debugger/debugger.pro b/src/plugins/debugger/debugger.pro
index 6818736d57..c86d379301 100644
--- a/src/plugins/debugger/debugger.pro
+++ b/src/plugins/debugger/debugger.pro
@@ -77,6 +77,7 @@ FORMS += attachexternaldialog.ui \
attachcoredialog.ui \
breakbyfunction.ui \
breakcondition.ui \
+ dumperoptionpage.ui \
gdboptionpage.ui \
startexternaldialog.ui \
diff --git a/src/plugins/debugger/debuggeractions.cpp b/src/plugins/debugger/debuggeractions.cpp
index 0a102c4ae9..7c42474b75 100644
--- a/src/plugins/debugger/debuggeractions.cpp
+++ b/src/plugins/debugger/debuggeractions.cpp
@@ -423,6 +423,20 @@ DebuggerSettings *theDebuggerSettings()
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");
item->setSettingsKey("DebugMode", "Terminal");
diff --git a/src/plugins/debugger/debuggeractions.h b/src/plugins/debugger/debuggeractions.h
index 528bcc2c4d..a319fa668c 100644
--- a/src/plugins/debugger/debuggeractions.h
+++ b/src/plugins/debugger/debuggeractions.h
@@ -148,11 +148,15 @@ enum DebuggerActionCode
WatchExpressionInWindow,
RemoveWatchExpression,
WatchModelUpdate,
+ UseToolTips,
+ AssignValue,
+
RecheckDumpers,
+ UsePrebuiltDumpers,
+ PrebuiltDumpersLocation,
+ BuildDumpersOnTheFly,
UseDumpers,
DebugDumpers,
- UseToolTips,
- AssignValue,
// Source List
ListSourceFiles,
diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp
index 8f4905c9d2..76b3033d68 100644
--- a/src/plugins/debugger/debuggerplugin.cpp
+++ b/src/plugins/debugger/debuggerplugin.cpp
@@ -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);
}
@@ -352,6 +337,89 @@ void GdbOptionPage::apply()
///////////////////////////////////////////////////////////////////////
//
+// 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;
diff --git a/src/plugins/debugger/debuggerplugin.h b/src/plugins/debugger/debuggerplugin.h
index 5714bf9dcf..1d2b233b7a 100644
--- a/src/plugins/debugger/debuggerplugin.h
+++ b/src/plugins/debugger/debuggerplugin.h
@@ -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;
diff --git a/src/plugins/debugger/dumperoptionpage.ui b/src/plugins/debugger/dumperoptionpage.ui
new file mode 100644
index 0000000000..f89cff0e38
--- /dev/null
+++ b/src/plugins/debugger/dumperoptionpage.ui
@@ -0,0 +1,115 @@
+<?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>
diff --git a/src/plugins/debugger/gdboptionpage.ui b/src/plugins/debugger/gdboptionpage.ui
index 3a51818c86..5b690eeb6b 100644
--- a/src/plugins/debugger/gdboptionpage.ui
+++ b/src/plugins/debugger/gdboptionpage.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>