Commit 3de773a5 authored by hjk's avatar hjk

debugger: rework dumper settings page

parent a2c68a53
......@@ -64,7 +64,7 @@ DebuggerSettings::~DebuggerSettings()
void DebuggerSettings::insertItem(int code, SavedAction *item)
{
QTC_ASSERT(!m_items.contains(code), return);
QTC_ASSERT(!m_items.contains(code), qDebug() << code << item->toString(); return);
m_items[code] = item;
}
......@@ -115,6 +115,10 @@ DebuggerSettings *theDebuggerSettings()
SavedAction *item = 0;
item = new SavedAction(instance);
instance->insertItem(SettingsDialog, item);
item->setText(QObject::tr("Debugger properties..."));
//
// View
//
......@@ -141,7 +145,6 @@ DebuggerSettings *theDebuggerSettings()
item = new SavedAction(instance);
instance->insertItem(WatchExpressionInWindow, item);
item->setTextPattern(QObject::tr("Watch expression \"%1\" in separate window"));
//item->setCheckable(true);
item = new SavedAction(instance);
instance->insertItem(AssignValue, item);
......@@ -158,14 +161,29 @@ DebuggerSettings *theDebuggerSettings()
// Dumpers
//
item = new SavedAction(instance);
instance->insertItem(SettingsDialog, item);
item->setText(QObject::tr("Debugger properties..."));
instance->insertItem(UseDumpers, item);
item->setDefaultValue(true);
item->setSettingsKey("DebugMode", "UseDumpers");
item->setText(QObject::tr("Use data dumpers"));
item->setCheckable(true);
item->setDefaultValue(true);
item = new SavedAction(instance);
instance->insertItem(UseCustomDumperLocation, item);
item->setSettingsKey("DebugMode", "CustomDumperLocation");
item->setCheckable(true);
item = new SavedAction(instance);
instance->insertItem(CustomDumperLocation, item);
item->setSettingsKey("DebugMode", "CustomDumperLocation");
item = new SavedAction(instance);
instance->insertItem(DebugDumpers, item);
item->setText(QObject::tr("Debug custom dumpers"));
item->setSettingsKey("DebugMode", "DebugDumpers");
item->setText(QObject::tr("Debug data dumpers"));
item->setCheckable(true);
item = new SavedAction(instance);
item->setText(QObject::tr("Recheck custom dumper availability"));
instance->insertItem(RecheckDumpers, item);
......@@ -227,20 +245,6 @@ DebuggerSettings *theDebuggerSettings()
instance->insertItem(FormatNatural, item);
registerFormatGroup->addAction(item);
//
// Misc
//
item = new SavedAction(instance);
instance->insertItem(SkipKnownFrames, item);
item->setText(QObject::tr("Skip known frames"));
item->setCheckable(true);
item = new SavedAction(instance);
instance->insertItem(UseToolTips, item);
item->setText(QObject::tr("Use tooltips when debugging"));
item->setCheckable(true);
//
// Settings
......@@ -266,33 +270,9 @@ DebuggerSettings *theDebuggerSettings()
item = new SavedAction(instance);
instance->insertItem(UseToolTips, item);
item->setSettingsKey("DebugMode", "UseToolTips");
item = new SavedAction(instance);
instance->insertItem(DisplayRawData, item);
item->setSettingsKey("DebugMode", "DisplayRawData");
item->setText(QObject::tr("Display raw data"));
item->setCheckable(true);
item = new SavedAction(instance);
instance->insertItem(UseDefaultDumperLocation, item);
item->setDefaultValue(true);
item->setSettingsKey("DebugMode", "UseDefaultDumperLocation");
item->setCheckable(true);
item = new SavedAction(instance);
instance->insertItem(UseCustomDumperLocation, item);
item->setSettingsKey("DebugMode", "CustomDumperLocation");
item->setCheckable(true);
item = new SavedAction(instance);
instance->insertItem(DisplayRawData, item);
item->setSettingsKey("DebugMode", "DisplayRawData");
item->setText(QObject::tr("Use tooltips when debugging"));
item->setCheckable(true);
item = new SavedAction(instance);
instance->insertItem(CustomDumperLocation, item);
item->setSettingsKey("DebugMode", "CustomDumperLocation");
item = new SavedAction(instance);
instance->insertItem(TerminalApplication, item);
item->setDefaultValue("xterm");
......@@ -307,10 +287,8 @@ DebuggerSettings *theDebuggerSettings()
item = new SavedAction(instance);
instance->insertItem(SkipKnownFrames, item);
item->setSettingsKey("DebugMode", "SkipKnownFrames");
item = new SavedAction(instance);
instance->insertItem(DebugDumpers, item);
item->setSettingsKey("DebugMode", "DebugDumpers");
item->setText(QObject::tr("Skip known frames"));
item->setCheckable(true);
item = new SavedAction(instance);
instance->insertItem(AllPluginBreakpoints, item);
......
......@@ -87,9 +87,8 @@ enum DebuggerActionCode
CollapseItem,
RecheckDumpers,
DisplayRawData,
UseDumpers,
UseCustomDumperLocation,
UseDefaultDumperLocation,
CustomDumperLocation,
DebugDumpers,
......
......@@ -345,6 +345,8 @@ public:
void finish() { m_group.finish(); }
private:
Q_SLOT void updateState();
friend class DebuggerPlugin;
Ui::DumperOptionPage m_ui;
......@@ -362,16 +364,16 @@ QWidget *DumperOptionPage::createPage(QWidget *parent)
m_ui.dumperLocationChooser->setInitialBrowsePathBackup(
Core::ICore::instance()->resourcePath() + "../../lib");
connect(m_ui.radioButtonUseCustomDumperLocation, SIGNAL(toggled(bool)),
m_ui.dumperLocationChooser, SLOT(setEnabled(bool)));
connect(m_ui.checkBoxUseDumpers, SIGNAL(toggled(bool)),
this, SLOT(updateState()));
connect(m_ui.checkBoxUseCustomDumperLocation, SIGNAL(toggled(bool)),
this, SLOT(updateState()));
m_group.clear();
m_group.insert(theDebuggerAction(DisplayRawData),
m_ui.radioButtonDisplayRawData);
m_group.insert(theDebuggerAction(UseDumpers),
m_ui.checkBoxUseDumpers);
m_group.insert(theDebuggerAction(UseCustomDumperLocation),
m_ui.radioButtonUseCustomDumperLocation);
m_group.insert(theDebuggerAction(UseDefaultDumperLocation),
m_ui.radioButtonUseDefaultDumperLocation);
m_ui.checkBoxUseCustomDumperLocation);
m_group.insert(theDebuggerAction(CustomDumperLocation),
m_ui.dumperLocationChooser);
......@@ -394,6 +396,15 @@ QWidget *DumperOptionPage::createPage(QWidget *parent)
return w;
}
void DumperOptionPage::updateState()
{
m_ui.checkBoxUseCustomDumperLocation->setEnabled(
m_ui.checkBoxUseDumpers->isChecked());
m_ui.dumperLocationChooser->setEnabled(
m_ui.checkBoxUseDumpers->isChecked()
&& m_ui.checkBoxUseCustomDumperLocation->isChecked());
}
} // namespace Internal
} // namespace Debugger
......
......@@ -6,81 +6,95 @@
<rect>
<x>0</x>
<y>0</y>
<width>398</width>
<height>426</height>
<width>403</width>
<height>434</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>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QCheckBox" name="checkBoxUseDumpers">
<property name="toolTip">
<string>This will enable nice display of Qt and Standard Library objects in the Locals&amp;Watchers view</string>
</property>
<property name="text">
<string>Use data dumpers</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="1" column="0">
<widget class="QRadioButton" name="radioButtonUseDefaultDumperLocation">
<property name="toolTip">
<string>This will load a dumper library</string>
</property>
<property name="text">
<string>Use dumpers from default location</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QRadioButton" name="radioButtonUseCustomDumperLocation">
<property name="text">
<string>Use dumpers from custom location</string>
</property>
</widget>
</item>
<item row="3" 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>
<item row="0" column="0">
<widget class="QRadioButton" name="radioButtonDisplayRawData">
<property name="toolTip">
<string>This will disable nice display of Qt and Standard Library objects in the Locals&amp;Watchers view</string>
</property>
<property name="text">
<string>Do not use data dumpers</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="3" column="0">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>10</width>
<height>10</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QCheckBox" name="checkBoxUseCustomDumperLocation">
<property name="toolTip">
<string>This will load a dumper library</string>
</property>
<property name="text">
<string>Use dumpers from custom location</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>20</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>
<item>
<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>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
......@@ -93,17 +107,14 @@
</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>
</layout>
<zorder>checkBoxDebugDumpers</zorder>
<zorder>checkBoxUseDumpers</zorder>
<zorder>checkBoxUseDefaultDumperLocation</zorder>
<zorder>horizontalSpacer</zorder>
<zorder>labelDumperLocation</zorder>
<zorder>horizontalSpacer_2</zorder>
<zorder>labelDumperLocation</zorder>
</widget>
<customwidgets>
<customwidget>
......
......@@ -210,8 +210,8 @@ void GdbEngine::initializeConnections()
q, SLOT(showApplicationOutput(QString)),
Qt::QueuedConnection);
connect(theDebuggerAction(DisplayRawData), SIGNAL(valueChanged(QVariant)),
this, SLOT(setDisplayRawData(QVariant)));
connect(theDebuggerAction(UseDumpers), SIGNAL(valueChanged(QVariant)),
this, SLOT(setUseDumpers(QVariant)));
connect(theDebuggerAction(DebugDumpers), SIGNAL(valueChanged(QVariant)),
this, SLOT(setDebugDumpers(QVariant)));
connect(theDebuggerAction(RecheckDumpers), SIGNAL(triggered()),
......@@ -2849,7 +2849,7 @@ static void setWatchDataSAddress(WatchData &data, const GdbMi &mi)
data.saddr = mi.data();
}
void GdbEngine::setDisplayRawData(const QVariant &on)
void GdbEngine::setUseDumpers(const QVariant &on)
{
qDebug() << "SWITCHING ON/OFF DUMPER DEBUGGING:" << on;
// FIXME: a bit too harsh, but otherwise the treeview sometimes look funny
......@@ -2860,7 +2860,7 @@ void GdbEngine::setDisplayRawData(const QVariant &on)
bool GdbEngine::isCustomValueDumperAvailable(const QString &type) const
{
if (theDebuggerBoolSetting(DisplayRawData))
if (!theDebuggerBoolSetting(UseDumpers))
return false;
if (q->startMode() == AttachCore) {
......@@ -3991,10 +3991,7 @@ QString GdbEngine::dumperLibraryName() const
{
if (theDebuggerAction(UseCustomDumperLocation)->value().toBool())
return theDebuggerAction(CustomDumperLocation)->value().toString();
if (theDebuggerAction(UseDefaultDumperLocation)->value().toBool())
return q->m_dumperLib;
QTC_ASSERT(false, /**/);
return QString();
return q->m_dumperLib;
}
void GdbEngine::tryLoadCustomDumpers()
......
......@@ -131,7 +131,7 @@ private:
void loadAllSymbols();
Q_SLOT void setDebugDumpers(const QVariant &on);
Q_SLOT void setDisplayRawData(const QVariant &on);
Q_SLOT void setUseDumpers(const QVariant &on);
//
// Own stuff
......
......@@ -177,7 +177,7 @@ void WatchWindow::contextMenuEvent(QContextMenuEvent *ev)
menu.addSeparator();
menu.addAction(theDebuggerAction(RecheckDumpers));
menu.addAction(theDebuggerAction(DisplayRawData));
menu.addAction(theDebuggerAction(UseDumpers));
menu.addSeparator();
menu.addAction(theDebuggerAction(SettingsDialog));
......
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