debugger: make string cutoff value configurable

Change-Id: I118016956a597ad689daa438f5517a47efe3cef0
Reviewed-by: hjk <qthjk@ovi.com>
This commit is contained in:
hjk
2012-11-11 00:32:33 +01:00
parent cb7d4f8d1c
commit 3685ce7599
6 changed files with 32 additions and 8 deletions

View File

@@ -91,7 +91,7 @@ DisplayUtf8String \
= range(7) = range(7)
qqStringCutOff = 1000 qqStringCutOff = 10000
# #
# Gnuplot based display for array-like structures. # Gnuplot based display for array-like structures.

View File

@@ -41,7 +41,7 @@
#include <projectexplorer/projectexplorer.h> #include <projectexplorer/projectexplorer.h>
#include <QFileInfo> #include <QLabel>
#include <QTextStream> #include <QTextStream>
using namespace Core; using namespace Core;
@@ -93,8 +93,7 @@ CommonOptionsPageWidget::CommonOptionsPageWidget
checkBoxRegisterForPostMortem->setToolTip(tr("Register Qt Creator for debugging crashed applications.")); checkBoxRegisterForPostMortem->setToolTip(tr("Register Qt Creator for debugging crashed applications."));
checkBoxRegisterForPostMortem->setText(tr("Use Qt Creator for post-mortem debugging")); checkBoxRegisterForPostMortem->setText(tr("Use Qt Creator for post-mortem debugging"));
labelMaximalStackDepth = new QLabel(behaviorBox); labelMaximalStackDepth = new QLabel(tr("Maximum stack depth:"), behaviorBox);
labelMaximalStackDepth->setText(tr("Maximum stack depth:"));
spinBoxMaximalStackDepth = new QSpinBox(behaviorBox); spinBoxMaximalStackDepth = new QSpinBox(behaviorBox);
spinBoxMaximalStackDepth->setSpecialValueText(tr("<unlimited>")); spinBoxMaximalStackDepth->setSpecialValueText(tr("<unlimited>"));
@@ -102,6 +101,14 @@ CommonOptionsPageWidget::CommonOptionsPageWidget
spinBoxMaximalStackDepth->setSingleStep(5); spinBoxMaximalStackDepth->setSingleStep(5);
spinBoxMaximalStackDepth->setValue(10); spinBoxMaximalStackDepth->setValue(10);
labelMaximalStringLength = new QLabel(tr("Maximum string length:"), behaviorBox);
spinBoxMaximalStringLength = new QSpinBox(behaviorBox);
spinBoxMaximalStringLength->setSpecialValueText(tr("<unlimited>"));
spinBoxMaximalStringLength->setMaximum(10000000);
spinBoxMaximalStringLength->setSingleStep(1000);
spinBoxMaximalStringLength->setValue(10000);
sourcesMappingWidget = new DebuggerSourcePathMappingWidget(this); sourcesMappingWidget = new DebuggerSourcePathMappingWidget(this);
QHBoxLayout *horizontalLayout = new QHBoxLayout(); QHBoxLayout *horizontalLayout = new QHBoxLayout();
@@ -109,20 +116,25 @@ CommonOptionsPageWidget::CommonOptionsPageWidget
horizontalLayout->addWidget(spinBoxMaximalStackDepth); horizontalLayout->addWidget(spinBoxMaximalStackDepth);
horizontalLayout->addStretch(); horizontalLayout->addStretch();
QHBoxLayout *horizontalLayout2 = new QHBoxLayout();
horizontalLayout2->addWidget(labelMaximalStringLength);
horizontalLayout2->addWidget(spinBoxMaximalStringLength);
horizontalLayout2->addStretch();
QGridLayout *gridLayout = new QGridLayout(behaviorBox); QGridLayout *gridLayout = new QGridLayout(behaviorBox);
gridLayout->addWidget(checkBoxUseAlternatingRowColors, 0, 0, 1, 1); gridLayout->addWidget(checkBoxUseAlternatingRowColors, 0, 0, 1, 1);
gridLayout->addWidget(checkBoxUseToolTipsInMainEditor, 1, 0, 1, 1); gridLayout->addWidget(checkBoxUseToolTipsInMainEditor, 1, 0, 1, 1);
gridLayout->addWidget(checkBoxCloseBuffersOnExit, 2, 0, 1, 1); gridLayout->addWidget(checkBoxCloseBuffersOnExit, 2, 0, 1, 1);
gridLayout->addWidget(checkBoxBringToForegroundOnInterrrupt, 3, 0, 1, 1); gridLayout->addWidget(checkBoxBringToForegroundOnInterrrupt, 3, 0, 1, 1);
gridLayout->addWidget(checkBoxBreakpointsFullPath, 4, 0, 1, 1); gridLayout->addWidget(checkBoxBreakpointsFullPath, 4, 0, 1, 1);
gridLayout->addLayout(horizontalLayout, 6, 0, 1, 2);
gridLayout->addWidget(checkBoxFontSizeFollowsEditor, 0, 1, 1, 1); gridLayout->addWidget(checkBoxFontSizeFollowsEditor, 0, 1, 1, 1);
gridLayout->addWidget(checkBoxListSourceFiles, 1, 1, 1, 1); gridLayout->addWidget(checkBoxListSourceFiles, 1, 1, 1, 1);
gridLayout->addWidget(checkBoxSwitchModeOnExit, 2, 1, 1, 1); gridLayout->addWidget(checkBoxSwitchModeOnExit, 2, 1, 1, 1);
gridLayout->addWidget(checkBoxShowQmlObjectTree, 3, 1, 1, 1); gridLayout->addWidget(checkBoxShowQmlObjectTree, 3, 1, 1, 1);
gridLayout->addWidget(checkBoxRegisterForPostMortem, 4, 1, 1, 1); gridLayout->addWidget(checkBoxRegisterForPostMortem, 4, 1, 1, 1);
gridLayout->addLayout(horizontalLayout2, 6, 1, 1, 2);
gridLayout->addLayout(horizontalLayout, 6, 0, 1, 2);
QVBoxLayout *verticalLayout = new QVBoxLayout(this); QVBoxLayout *verticalLayout = new QVBoxLayout(this);
verticalLayout->addWidget(behaviorBox); verticalLayout->addWidget(behaviorBox);
@@ -161,8 +173,8 @@ CommonOptionsPageWidget::CommonOptionsPageWidget
m_group->insert(dc->action(UseAddressInBreakpointsView), 0); m_group->insert(dc->action(UseAddressInBreakpointsView), 0);
m_group->insert(dc->action(UseAddressInStackView), 0); m_group->insert(dc->action(UseAddressInStackView), 0);
m_group->insert(dc->action(AlwaysAdjustStackColumnWidths), 0); m_group->insert(dc->action(AlwaysAdjustStackColumnWidths), 0);
m_group->insert(dc->action(MaximalStackDepth), m_group->insert(dc->action(MaximalStackDepth), spinBoxMaximalStackDepth);
spinBoxMaximalStackDepth); m_group->insert(dc->action(MaximalStringLength), spinBoxMaximalStringLength);
m_group->insert(dc->action(ShowStdNamespace), 0); m_group->insert(dc->action(ShowStdNamespace), 0);
m_group->insert(dc->action(ShowQtNamespace), 0); m_group->insert(dc->action(ShowQtNamespace), 0);
m_group->insert(dc->action(SortStructMembers), 0); m_group->insert(dc->action(SortStructMembers), 0);

View File

@@ -74,7 +74,9 @@ private:
QCheckBox *checkBoxBreakpointsFullPath; QCheckBox *checkBoxBreakpointsFullPath;
QCheckBox *checkBoxRegisterForPostMortem; QCheckBox *checkBoxRegisterForPostMortem;
QLabel *labelMaximalStackDepth; QLabel *labelMaximalStackDepth;
QLabel *labelMaximalStringLength;
QSpinBox *spinBoxMaximalStackDepth; QSpinBox *spinBoxMaximalStackDepth;
QSpinBox *spinBoxMaximalStringLength;
DebuggerSourcePathMappingWidget *sourcesMappingWidget; DebuggerSourcePathMappingWidget *sourcesMappingWidget;
const QSharedPointer<Utils::SavedActionSet> m_group; const QSharedPointer<Utils::SavedActionSet> m_group;

View File

@@ -552,6 +552,11 @@ DebuggerSettings::DebuggerSettings(QSettings *settings)
item->setDefaultValue(20); item->setDefaultValue(20);
insertItem(MaximalStackDepth, item); insertItem(MaximalStackDepth, item);
item = new SavedAction(this);
item->setSettingsKey(debugModeGroup, QLatin1String("MaximalStringLength"));
item->setDefaultValue(10000);
insertItem(MaximalStringLength, item);
item = new SavedAction(this); item = new SavedAction(this);
item->setText(tr("Reload Full Stack")); item->setText(tr("Reload Full Stack"));
insertItem(ExpandStack, item); insertItem(ExpandStack, item);

View File

@@ -140,6 +140,7 @@ enum DebuggerActionCode
SortStructMembers, SortStructMembers,
AutoDerefPointers, AutoDerefPointers,
AlwaysAdjustLocalsColumnWidths, AlwaysAdjustLocalsColumnWidths,
MaximalStringLength,
// Source List // Source List
ListSourceFiles, ListSourceFiles,

View File

@@ -4905,6 +4905,10 @@ void GdbEngine::loadPythonDumpers()
postCommand("python execfile('" + dumperSourcePath + "qttypes.py')", postCommand("python execfile('" + dumperSourcePath + "qttypes.py')",
ConsoleCommand|NonCriticalResponse); ConsoleCommand|NonCriticalResponse);
postCommand("python qqStringCutOff = "
+ debuggerCore()->action(MaximalStringLength)->value().toByteArray(),
ConsoleCommand|NonCriticalResponse);
loadInitScript(); loadInitScript();
postCommand("bbsetup", ConsoleCommand, CB(handleHasPython)); postCommand("bbsetup", ConsoleCommand, CB(handleHasPython));