From 9d24d568220566aebb06aa64caae5ab57c8b9eab Mon Sep 17 00:00:00 2001 From: hjk <qtc-committer@nokia.com> Date: Tue, 29 Nov 2011 13:30:09 +0100 Subject: [PATCH] debugger: "inline" gdboptionspage.ui Change-Id: I89b0f0dd5c9764d2080faefe9734911090616976 Reviewed-by: hjk <qthjk@ovi.com> --- src/plugins/debugger/gdb/gdb.pri | 2 - src/plugins/debugger/gdb/gdboptionspage.cpp | 222 ++++++++++++++++-- src/plugins/debugger/gdb/gdboptionspage.h | 10 +- src/plugins/debugger/gdb/gdboptionspage.ui | 237 -------------------- 4 files changed, 211 insertions(+), 260 deletions(-) delete mode 100644 src/plugins/debugger/gdb/gdboptionspage.ui diff --git a/src/plugins/debugger/gdb/gdb.pri b/src/plugins/debugger/gdb/gdb.pri index 99b43101bea..04d3b4074d1 100644 --- a/src/plugins/debugger/gdb/gdb.pri +++ b/src/plugins/debugger/gdb/gdb.pri @@ -36,6 +36,4 @@ SOURCES += \ $$PWD/abstractplaingdbadapter.cpp \ $$PWD/symbian.cpp -FORMS += $$PWD/gdboptionspage.ui - RESOURCES += $$PWD/gdb.qrc diff --git a/src/plugins/debugger/gdb/gdboptionspage.cpp b/src/plugins/debugger/gdb/gdboptionspage.cpp index 01a60a9a294..239626e85e3 100644 --- a/src/plugins/debugger/gdb/gdboptionspage.cpp +++ b/src/plugins/debugger/gdb/gdboptionspage.cpp @@ -42,10 +42,204 @@ #include <QtCore/QDebug> #include <QtCore/QTextStream> +#include <QtGui/QCheckBox> +#include <QtGui/QFormLayout> +#include <QtGui/QGridLayout> +#include <QtGui/QGroupBox> +#include <QtGui/QLabel> +#include <QtGui/QLineEdit> +#include <QtGui/QRadioButton> +#include <QtGui/QSpinBox> +#include <QtGui/QTextEdit> namespace Debugger { namespace Internal { +class GdbOptionsPageUi +{ +public: + QGroupBox *groupBoxGeneral; + QLabel *labelGdbWatchdogTimeout; + QSpinBox *spinBoxGdbWatchdogTimeout; + QCheckBox *checkBoxSkipKnownFrames; + QCheckBox *checkBoxUseMessageBoxForSignals; + QCheckBox *checkBoxAdjustBreakpointLocations; + QCheckBox *checkBoxUseDynamicType; + QCheckBox *checkBoxLoadGdbInit; + QLabel *labelDangerous; + QCheckBox *checkBoxTargetAsync; + QCheckBox *checkBoxAutoEnrichParameters; + QCheckBox *checkBoxBreakOnWarning; + QCheckBox *checkBoxBreakOnFatal; + QCheckBox *checkBoxEnableReverseDebugging; + + QGroupBox *groupBoxStartupCommands; + QTextEdit *textEditStartupCommands; + + //QGroupBox *groupBoxPluginDebugging; + //QRadioButton *radioButtonAllPluginBreakpoints; + //QRadioButton *radioButtonSelectedPluginBreakpoints; + //QRadioButton *radioButtonNoPluginBreakpoints; + //QLabel *labelSelectedPluginBreakpoints; + //QLineEdit *lineEditSelectedPluginBreakpointsPattern; + + void setupUi(QWidget *q) + { + groupBoxGeneral = new QGroupBox(q); + groupBoxGeneral->setTitle(GdbOptionsPage::tr("General")); + + labelGdbWatchdogTimeout = new QLabel(groupBoxGeneral); + labelGdbWatchdogTimeout->setText(GdbOptionsPage::tr("GDB timeout:")); + labelGdbWatchdogTimeout->setToolTip(GdbOptionsPage::tr( + "This is the number of seconds Qt Creator will wait before\n" + "it terminates a non-responsive GDB process. The default value of 20 seconds\n" + "should be sufficient for most applications, but there are situations when\n" + "loading big libraries or listing source files takes much longer than that\n" + "on slow machines. In this case, the value should be increased.")); + + spinBoxGdbWatchdogTimeout = new QSpinBox(groupBoxGeneral); + spinBoxGdbWatchdogTimeout->setToolTip(labelGdbWatchdogTimeout->toolTip()); + spinBoxGdbWatchdogTimeout->setSuffix(GdbOptionsPage::tr("sec")); + spinBoxGdbWatchdogTimeout->setLayoutDirection(Qt::LeftToRight); + spinBoxGdbWatchdogTimeout->setMinimum(20); + spinBoxGdbWatchdogTimeout->setMaximum(1000000); + spinBoxGdbWatchdogTimeout->setSingleStep(20); + spinBoxGdbWatchdogTimeout->setValue(20); + + checkBoxSkipKnownFrames = new QCheckBox(groupBoxGeneral); + checkBoxSkipKnownFrames->setText(GdbOptionsPage::tr("Skip known frames when stepping")); + checkBoxSkipKnownFrames->setToolTip(GdbOptionsPage::tr( + "Allows 'Step Into' to compress several steps into one step\n" + "for less noisy debugging. For example, the atomic reference\n" + "counting code is skipped, and a single 'Step Into' for a signal\n" + "emission ends up directly in the slot connected to it.")); + + checkBoxUseMessageBoxForSignals = new QCheckBox(groupBoxGeneral); + checkBoxUseMessageBoxForSignals->setText(GdbOptionsPage::tr( + "Show a message box when receiving a signal")); + checkBoxUseMessageBoxForSignals->setToolTip(GdbOptionsPage::tr( + "This will show a message box as soon as your application\n" + "receives a signal like SIGSEGV during debugging.")); + + checkBoxAdjustBreakpointLocations = new QCheckBox(groupBoxGeneral); + checkBoxAdjustBreakpointLocations->setText(GdbOptionsPage::tr( + "Adjust breakpoint locations")); + checkBoxAdjustBreakpointLocations->setToolTip(GdbOptionsPage::tr( + "GDB allows setting breakpoints on source lines for which no code \n" + "was generated. In such situations the breakpoint is shifted to the\n" + "next source code line for which code was actually generated.\n" + "This option reflects such temporary change by moving the breakpoint\n" + "markers in the source code editor.")); + + checkBoxUseDynamicType = new QCheckBox(groupBoxGeneral); + checkBoxUseDynamicType->setText(GdbOptionsPage::tr( + "Use dynamic object type for display")); + checkBoxUseDynamicType->setToolTip(GdbOptionsPage::tr( + "This specifies whether the dynamic or the static type of objects will be" + "displayed. Choosing the dynamic type might be slower.")); + + checkBoxLoadGdbInit = new QCheckBox(groupBoxGeneral); + checkBoxLoadGdbInit->setText(GdbOptionsPage::tr("Load .gdbinit file on startup")); + checkBoxLoadGdbInit->setToolTip(GdbOptionsPage::tr( + "This allows or inhibits reading the user's default\n" + ".gdbinit file on debugger startup.")); + + labelDangerous = new QLabel(GdbOptionsPage::tr( + "The options below should be used with care.")); + + checkBoxTargetAsync = new QCheckBox(groupBoxGeneral); + checkBoxTargetAsync->setText(GdbOptionsPage::tr( + "Use asynchronous mode to control the inferior")); + + checkBoxAutoEnrichParameters = new QCheckBox(groupBoxGeneral); + checkBoxAutoEnrichParameters->setText(GdbOptionsPage::tr( + "Use common locations for debug information")); + checkBoxAutoEnrichParameters->setToolTip(GdbOptionsPage::tr( + "This adds common paths to locations of debug information\n" + "at debugger startup.")); + + checkBoxBreakOnWarning = new QCheckBox(groupBoxGeneral); + checkBoxBreakOnWarning->setText(GdbOptionsPage::tr("Stop when a qWarning is issued")); + + checkBoxBreakOnFatal = new QCheckBox(groupBoxGeneral); + checkBoxBreakOnFatal->setText(GdbOptionsPage::tr("Stop when a qFatal is issued")); + + checkBoxEnableReverseDebugging = new QCheckBox(groupBoxGeneral); + checkBoxEnableReverseDebugging->setText(GdbOptionsPage::tr("Enable reverse debugging")); + checkBoxEnableReverseDebugging->setToolTip(GdbOptionsPage::tr( + "<html><head/><body><p>Selecting this enables reverse debugging.</p><.p>" + "<b>Note:</b> This feature is very slow and unstable on the GDB side." + "It exhibits unpredictable behavior when going backwards over system " + "calls and is very likely to destroy your debugging session.</p><body></html>")); + + groupBoxStartupCommands = new QGroupBox(q); + groupBoxStartupCommands->setTitle(GdbOptionsPage::tr("Additional Startup Commands")); + + textEditStartupCommands = new QTextEdit(groupBoxStartupCommands); + + + /* + groupBoxPluginDebugging = new QGroupBox(q); + groupBoxPluginDebugging->setTitle(GdbOptionsPage::tr( + "Behavior of Breakpoint Setting in Plugins")); + + radioButtonAllPluginBreakpoints = new QRadioButton(groupBoxPluginDebugging); + radioButtonAllPluginBreakpoints->setText(GdbOptionsPage::tr( + "Always try to set breakpoints in plugins automatically")); + radioButtonAllPluginBreakpoints->setToolTip(GdbOptionsPage::tr( + "This is the slowest but safest option.")); + + radioButtonSelectedPluginBreakpoints = new QRadioButton(groupBoxPluginDebugging); + radioButtonSelectedPluginBreakpoints->setText(GdbOptionsPage::tr( + "Try to set breakpoints in selected plugins")); + + radioButtonNoPluginBreakpoints = new QRadioButton(groupBoxPluginDebugging); + radioButtonNoPluginBreakpoints->setText(GdbOptionsPage::tr( + "Never set breakpoints in plugins automatically")); + + lineEditSelectedPluginBreakpointsPattern = new QLineEdit(groupBoxPluginDebugging); + + labelSelectedPluginBreakpoints = new QLabel(groupBoxPluginDebugging); + labelSelectedPluginBreakpoints->setText(GdbOptionsPage::tr( + "Matching regular expression: ")); + */ + + QFormLayout *formLayout = new QFormLayout(groupBoxGeneral); + formLayout->addRow(labelGdbWatchdogTimeout, spinBoxGdbWatchdogTimeout); + formLayout->addRow(checkBoxSkipKnownFrames); + formLayout->addRow(checkBoxUseMessageBoxForSignals); + formLayout->addRow(checkBoxAdjustBreakpointLocations); + formLayout->addRow(checkBoxUseDynamicType); + formLayout->addRow(checkBoxLoadGdbInit); + formLayout->addRow(labelDangerous); + formLayout->addRow(checkBoxTargetAsync); + formLayout->addRow(checkBoxAutoEnrichParameters); + formLayout->addRow(checkBoxBreakOnWarning); + formLayout->addRow(checkBoxBreakOnFatal); + formLayout->addRow(checkBoxEnableReverseDebugging); + + QGridLayout *startLayout = new QGridLayout(groupBoxStartupCommands); + startLayout->addWidget(textEditStartupCommands, 0, 0, 1, 1); + + //QHBoxLayout *horizontalLayout = new QHBoxLayout(); + //horizontalLayout->addItem(new QSpacerItem(10, 10, QSizePolicy::Preferred, QSizePolicy::Minimum)); + //horizontalLayout->addWidget(labelSelectedPluginBreakpoints); + //horizontalLayout->addWidget(lineEditSelectedPluginBreakpointsPattern); + + QGridLayout *gridLayout = new QGridLayout(q); + gridLayout->addWidget(groupBoxGeneral, 0, 0); + gridLayout->addWidget(groupBoxStartupCommands, 0, 1); + + //gridLayout->addWidget(groupBoxStartupCommands, 0, 1, 1, 1); + //gridLayout->addWidget(radioButtonAllPluginBreakpoints, 0, 0, 1, 1); + //gridLayout->addWidget(radioButtonSelectedPluginBreakpoints, 1, 0, 1, 1); + + //gridLayout->addLayout(horizontalLayout, 2, 0, 1, 1); + //gridLayout->addWidget(radioButtonNoPluginBreakpoints, 3, 0, 1, 1); + //gridLayout->addWidget(groupBoxPluginDebugging, 1, 0, 1, 2); + } +}; + GdbOptionsPage::GdbOptionsPage() : m_ui(0) { } @@ -78,7 +272,7 @@ QIcon GdbOptionsPage::categoryIcon() const QWidget *GdbOptionsPage::createPage(QWidget *parent) { QWidget *w = new QWidget(parent); - m_ui = new Ui::GdbOptionsPage; + m_ui = new GdbOptionsPageUi; m_ui->setupUi(w); m_group.clear(); @@ -109,17 +303,17 @@ QWidget *GdbOptionsPage::createPage(QWidget *parent) m_ui->checkBoxEnableReverseDebugging); m_group.insert(debuggerCore()->action(GdbWatchdogTimeout), 0); - m_ui->groupBoxPluginDebugging->hide(); + //m_ui->groupBoxPluginDebugging->hide(); - m_ui->lineEditSelectedPluginBreakpointsPattern-> - setEnabled(debuggerCore()->action(SelectedPluginBreakpoints)->value().toBool()); - connect(m_ui->radioButtonSelectedPluginBreakpoints, SIGNAL(toggled(bool)), - m_ui->lineEditSelectedPluginBreakpointsPattern, SLOT(setEnabled(bool))); + //m_ui->lineEditSelectedPluginBreakpointsPattern-> + // setEnabled(debuggerCore()->action(SelectedPluginBreakpoints)->value().toBool()); + //connect(m_ui->radioButtonSelectedPluginBreakpoints, SIGNAL(toggled(bool)), + // m_ui->lineEditSelectedPluginBreakpointsPattern, SLOT(setEnabled(bool))); if (m_searchKeywords.isEmpty()) { QLatin1Char sep(' '); QTextStream(&m_searchKeywords) - << sep << m_ui->groupBoxLocations->title() + << sep << m_ui->groupBoxGeneral->title() << sep << m_ui->checkBoxLoadGdbInit->text() << sep << m_ui->checkBoxTargetAsync->text() << sep << m_ui->checkBoxUseDynamicType->text() @@ -128,17 +322,15 @@ QWidget *GdbOptionsPage::createPage(QWidget *parent) << sep << m_ui->checkBoxSkipKnownFrames->text() << sep << m_ui->checkBoxUseMessageBoxForSignals->text() << sep << m_ui->checkBoxAdjustBreakpointLocations->text() - << sep << m_ui->groupBoxPluginDebugging->title() - << sep << m_ui->radioButtonAllPluginBreakpoints->text() - << sep << m_ui->radioButtonSelectedPluginBreakpoints->text() - << sep << m_ui->labelSelectedPluginBreakpoints->text() - << sep << m_ui->radioButtonNoPluginBreakpoints->text(); + // << sep << m_ui->groupBoxPluginDebugging->title() + // << sep << m_ui->radioButtonAllPluginBreakpoints->text() + // << sep << m_ui->radioButtonSelectedPluginBreakpoints->text() + // << sep << m_ui->labelSelectedPluginBreakpoints->text() + // << sep << m_ui->radioButtonNoPluginBreakpoints->text() + ; m_searchKeywords.remove(QLatin1Char('&')); } - // FIXME: Not fully working on the gdb side yet. - //m_ui->checkBoxTargetAsync->hide(); - return w; } diff --git a/src/plugins/debugger/gdb/gdboptionspage.h b/src/plugins/debugger/gdb/gdboptionspage.h index b2cd7c89ab2..702876d4362 100644 --- a/src/plugins/debugger/gdb/gdboptionspage.h +++ b/src/plugins/debugger/gdb/gdboptionspage.h @@ -33,18 +33,16 @@ #ifndef GDBOPTIONSPAGE_H #define GDBOPTIONSPAGE_H -#include "ui_gdboptionspage.h" - #include <coreplugin/dialogs/ioptionspage.h> #include <utils/savedaction.h> -namespace ProjectExplorer { -class ToolChain; -} // namespace ProjectExplorer +namespace ProjectExplorer { class ToolChain; } namespace Debugger { namespace Internal { +class GdbOptionsPageUi; + class GdbOptionsPage : public Core::IOptionsPage { Q_OBJECT @@ -65,7 +63,7 @@ public: static QString settingsId(); private: - Ui::GdbOptionsPage *m_ui; + GdbOptionsPageUi *m_ui; Utils::SavedActionSet m_group; QString m_searchKeywords; }; diff --git a/src/plugins/debugger/gdb/gdboptionspage.ui b/src/plugins/debugger/gdb/gdboptionspage.ui deleted file mode 100644 index a63038e07ab..00000000000 --- a/src/plugins/debugger/gdb/gdboptionspage.ui +++ /dev/null @@ -1,237 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<ui version="4.0"> - <class>Debugger::Internal::GdbOptionsPage</class> - <widget class="QWidget" name="Debugger::Internal::GdbOptionsPage"> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>673</width> - <height>474</height> - </rect> - </property> - <layout class="QGridLayout" name="gridLayout_3"> - <item row="0" column="0"> - <widget class="QGroupBox" name="groupBoxLocations"> - <property name="title"> - <string>General</string> - </property> - <layout class="QFormLayout" name="formLayout"> - <item row="0" column="0"> - <widget class="QLabel" name="labelGdbWatchdogTimeout"> - <property name="toolTip"> - <string>This is the number of seconds Qt Creator will wait before -it terminates a non-responsive GDB process. The default value of 20 seconds -should be sufficient for most applications, but there are situations when -loading big libraries or listing source files takes much longer than that -on slow machines. In this case, the value should be increased.</string> - </property> - <property name="text"> - <string>GDB timeout:</string> - </property> - </widget> - </item> - <item row="0" column="1"> - <widget class="QSpinBox" name="spinBoxGdbWatchdogTimeout"> - <property name="toolTip"> - <string>This is the number of seconds Qt Creator will wait before -it terminates a non-responsive GDB process. The default value of 20 seconds -should be sufficient for most applications, but there are situations when -loading big libraries or listing source files takes much longer than that -on slow machines. In this case, the value should be increased.</string> - </property> - <property name="layoutDirection"> - <enum>Qt::LeftToRight</enum> - </property> - <property name="suffix"> - <string>sec</string> - </property> - <property name="minimum"> - <number>20</number> - </property> - <property name="maximum"> - <number>1000000</number> - </property> - <property name="singleStep"> - <number>20</number> - </property> - <property name="value"> - <number>20</number> - </property> - </widget> - </item> - <item row="1" column="0" colspan="2"> - <widget class="QCheckBox" name="checkBoxSkipKnownFrames"> - <property name="toolTip"> - <string>Allows 'Step Into' to compress several steps into one step for less noisy debugging. For example, the atomic reference - counting code is skipped, and a single 'Step Into' for a signal emission ends 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="2" column="0" colspan="2"> - <widget class="QCheckBox" name="checkBoxUseMessageBoxForSignals"> - <property name="toolTip"> - <string>This will show a message box as soon as your application receives a signal like SIGSEGV during debugging.</string> - </property> - <property name="text"> - <string>Show a message box when receiving a signal</string> - </property> - </widget> - </item> - <item row="3" column="0" colspan="2"> - <widget class="QCheckBox" name="checkBoxAdjustBreakpointLocations"> - <property name="toolTip"> - <string><html><head/></body><p>GDB allows setting breakpoints on source lines for which no code was generated. In such situations the breakpoint is shifted to the next source code line for which code was actually generated. This option reflects such temporary change by moving the breakpoint markers in the source code editor.</p></body></html></string> - </property> - <property name="text"> - <string>Adjust breakpoint locations</string> - </property> - </widget> - </item> - <item row="4" column="0" colspan="2"> - <widget class="QCheckBox" name="checkBoxUseDynamicType"> - <property name="toolTip"> - <string>This specifies whether the dynamic or the static type of objects will be displayed. Choosing the dynamic type might be slower.</string> - </property> - <property name="text"> - <string>Use dynamic object type for display</string> - </property> - </widget> - </item> - <item row="5" column="0" colspan="2"> - <widget class="QCheckBox" name="checkBoxLoadGdbInit"> - <property name="toolTip"> - <string>This allows or inhibits reading the user's default .gdbinit file on debugger startup.</string> - </property> - <property name="text"> - <string>Load .gdbinit file on startup</string> - </property> - </widget> - </item> - <item row="6" column="0" colspan="2"> - <widget class="QCheckBox" name="checkBoxTargetAsync"> - <property name="text"> - <string>Use asynchronous mode to control the inferior</string> - </property> - </widget> - </item> - <item row="7" column="0" colspan="2"> - <widget class="QCheckBox" name="checkBoxAutoEnrichParameters"> - <property name="toolTip"> - <string>This adds common paths to locations of debug information at debugger startup.</string> - </property> - <property name="text"> - <string>Use common locations for debug information</string> - </property> - </widget> - </item> - <item row="8" column="0" colspan="2"> - <widget class="QCheckBox" name="checkBoxBreakOnWarning"> - <property name="text"> - <string>Stop when a qWarning is issued</string> - </property> - </widget> - </item> - <item row="9" column="0" colspan="2"> - <widget class="QCheckBox" name="checkBoxBreakOnFatal"> - <property name="text"> - <string>Stop when a qFatal is issued</string> - </property> - </widget> - </item> - <item row="10" column="0" colspan="2"> - <widget class="QCheckBox" name="checkBoxEnableReverseDebugging"> - <property name="toolTip"> - <string><html><head/><body><p>Selecting this enables reverse debugging.</p><.p><b>Note:</b> This feature is very slow and unstable on the GDB side. It exhibits unpredictable behavior when going backwards over system calls and is very likely to destroy your debugging session.</p><body></html></string> - </property> - <property name="text"> - <string>Enable reverse debugging</string> - </property> - </widget> - </item> - </layout> - </widget> - </item> - <item row="0" column="1"> - <widget class="QGroupBox" name="groupBoxStartupCommands"> - <property name="title"> - <string>Additional Startup Commands</string> - </property> - <layout class="QGridLayout" name="gridLayout_2"> - <item row="0" column="0"> - <widget class="QTextEdit" name="textEditStartupCommands"/> - </item> - </layout> - </widget> - </item> - <item row="1" column="0" colspan="2"> - <widget class="QGroupBox" name="groupBoxPluginDebugging"> - <property name="title"> - <string>Behavior of Breakpoint Setting in Plugins</string> - </property> - <layout class="QGridLayout" name="gridLayout"> - <item row="0" column="0"> - <widget class="QRadioButton" name="radioButtonAllPluginBreakpoints"> - <property name="toolTip"> - <string>This is the slowest but safest option.</string> - </property> - <property name="text"> - <string>Always try to set breakpoints in plugins automatically</string> - </property> - </widget> - </item> - <item row="1" column="0"> - <widget class="QRadioButton" name="radioButtonSelectedPluginBreakpoints"> - <property name="text"> - <string>Try to set breakpoints in selected plugins</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="labelSelectedPluginBreakpoints"> - <property name="text"> - <string>Matching regular expression: </string> - </property> - </widget> - </item> - <item> - <widget class="QLineEdit" name="lineEditSelectedPluginBreakpointsPattern"/> - </item> - </layout> - </item> - <item row="3" column="0"> - <widget class="QRadioButton" name="radioButtonNoPluginBreakpoints"> - <property name="text"> - <string>Never set breakpoints in plugins automatically</string> - </property> - </widget> - </item> - </layout> - </widget> - </item> - </layout> - </widget> - <resources/> - <connections/> -</ui> -- GitLab