summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorhjk <qthjk@ovi.com>2012-11-11 00:32:33 +0100
committerhjk <qthjk@ovi.com>2012-11-16 13:59:47 +0100
commit3685ce759986db45598cb5c4df2e53568d9dd63c (patch)
tree8f67bff59baa78cbc0a16eee55b5dde76a926547 /src
parentcb7d4f8d1ccf5925243cad57807c6e1f4f8296ba (diff)
downloadqt-creator-3685ce759986db45598cb5c4df2e53568d9dd63c.tar.gz
debugger: make string cutoff value configurable
Change-Id: I118016956a597ad689daa438f5517a47efe3cef0 Reviewed-by: hjk <qthjk@ovi.com>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/debugger/commonoptionspage.cpp26
-rw-r--r--src/plugins/debugger/commonoptionspage.h2
-rw-r--r--src/plugins/debugger/debuggeractions.cpp5
-rw-r--r--src/plugins/debugger/debuggeractions.h1
-rw-r--r--src/plugins/debugger/gdb/gdbengine.cpp4
5 files changed, 31 insertions, 7 deletions
diff --git a/src/plugins/debugger/commonoptionspage.cpp b/src/plugins/debugger/commonoptionspage.cpp
index 505c252d25..ed128cb47b 100644
--- a/src/plugins/debugger/commonoptionspage.cpp
+++ b/src/plugins/debugger/commonoptionspage.cpp
@@ -41,7 +41,7 @@
#include <projectexplorer/projectexplorer.h>
-#include <QFileInfo>
+#include <QLabel>
#include <QTextStream>
using namespace Core;
@@ -93,8 +93,7 @@ CommonOptionsPageWidget::CommonOptionsPageWidget
checkBoxRegisterForPostMortem->setToolTip(tr("Register Qt Creator for debugging crashed applications."));
checkBoxRegisterForPostMortem->setText(tr("Use Qt Creator for post-mortem debugging"));
- labelMaximalStackDepth = new QLabel(behaviorBox);
- labelMaximalStackDepth->setText(tr("Maximum stack depth:"));
+ labelMaximalStackDepth = new QLabel(tr("Maximum stack depth:"), behaviorBox);
spinBoxMaximalStackDepth = new QSpinBox(behaviorBox);
spinBoxMaximalStackDepth->setSpecialValueText(tr("<unlimited>"));
@@ -102,6 +101,14 @@ CommonOptionsPageWidget::CommonOptionsPageWidget
spinBoxMaximalStackDepth->setSingleStep(5);
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);
QHBoxLayout *horizontalLayout = new QHBoxLayout();
@@ -109,20 +116,25 @@ CommonOptionsPageWidget::CommonOptionsPageWidget
horizontalLayout->addWidget(spinBoxMaximalStackDepth);
horizontalLayout->addStretch();
+ QHBoxLayout *horizontalLayout2 = new QHBoxLayout();
+ horizontalLayout2->addWidget(labelMaximalStringLength);
+ horizontalLayout2->addWidget(spinBoxMaximalStringLength);
+ horizontalLayout2->addStretch();
+
QGridLayout *gridLayout = new QGridLayout(behaviorBox);
gridLayout->addWidget(checkBoxUseAlternatingRowColors, 0, 0, 1, 1);
gridLayout->addWidget(checkBoxUseToolTipsInMainEditor, 1, 0, 1, 1);
gridLayout->addWidget(checkBoxCloseBuffersOnExit, 2, 0, 1, 1);
gridLayout->addWidget(checkBoxBringToForegroundOnInterrrupt, 3, 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(checkBoxListSourceFiles, 1, 1, 1, 1);
gridLayout->addWidget(checkBoxSwitchModeOnExit, 2, 1, 1, 1);
gridLayout->addWidget(checkBoxShowQmlObjectTree, 3, 1, 1, 1);
gridLayout->addWidget(checkBoxRegisterForPostMortem, 4, 1, 1, 1);
-
- gridLayout->addLayout(horizontalLayout, 6, 0, 1, 2);
+ gridLayout->addLayout(horizontalLayout2, 6, 1, 1, 2);
QVBoxLayout *verticalLayout = new QVBoxLayout(this);
verticalLayout->addWidget(behaviorBox);
@@ -161,8 +173,8 @@ CommonOptionsPageWidget::CommonOptionsPageWidget
m_group->insert(dc->action(UseAddressInBreakpointsView), 0);
m_group->insert(dc->action(UseAddressInStackView), 0);
m_group->insert(dc->action(AlwaysAdjustStackColumnWidths), 0);
- m_group->insert(dc->action(MaximalStackDepth),
- spinBoxMaximalStackDepth);
+ m_group->insert(dc->action(MaximalStackDepth), spinBoxMaximalStackDepth);
+ m_group->insert(dc->action(MaximalStringLength), spinBoxMaximalStringLength);
m_group->insert(dc->action(ShowStdNamespace), 0);
m_group->insert(dc->action(ShowQtNamespace), 0);
m_group->insert(dc->action(SortStructMembers), 0);
diff --git a/src/plugins/debugger/commonoptionspage.h b/src/plugins/debugger/commonoptionspage.h
index 474aab5514..b018c2b94a 100644
--- a/src/plugins/debugger/commonoptionspage.h
+++ b/src/plugins/debugger/commonoptionspage.h
@@ -74,7 +74,9 @@ private:
QCheckBox *checkBoxBreakpointsFullPath;
QCheckBox *checkBoxRegisterForPostMortem;
QLabel *labelMaximalStackDepth;
+ QLabel *labelMaximalStringLength;
QSpinBox *spinBoxMaximalStackDepth;
+ QSpinBox *spinBoxMaximalStringLength;
DebuggerSourcePathMappingWidget *sourcesMappingWidget;
const QSharedPointer<Utils::SavedActionSet> m_group;
diff --git a/src/plugins/debugger/debuggeractions.cpp b/src/plugins/debugger/debuggeractions.cpp
index 655f3bcda5..a80ad358b6 100644
--- a/src/plugins/debugger/debuggeractions.cpp
+++ b/src/plugins/debugger/debuggeractions.cpp
@@ -553,6 +553,11 @@ DebuggerSettings::DebuggerSettings(QSettings *settings)
insertItem(MaximalStackDepth, item);
item = new SavedAction(this);
+ item->setSettingsKey(debugModeGroup, QLatin1String("MaximalStringLength"));
+ item->setDefaultValue(10000);
+ insertItem(MaximalStringLength, item);
+
+ item = new SavedAction(this);
item->setText(tr("Reload Full Stack"));
insertItem(ExpandStack, item);
diff --git a/src/plugins/debugger/debuggeractions.h b/src/plugins/debugger/debuggeractions.h
index a3413b480c..358f87f943 100644
--- a/src/plugins/debugger/debuggeractions.h
+++ b/src/plugins/debugger/debuggeractions.h
@@ -140,6 +140,7 @@ enum DebuggerActionCode
SortStructMembers,
AutoDerefPointers,
AlwaysAdjustLocalsColumnWidths,
+ MaximalStringLength,
// Source List
ListSourceFiles,
diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp
index 802ea2fc5b..500724ebde 100644
--- a/src/plugins/debugger/gdb/gdbengine.cpp
+++ b/src/plugins/debugger/gdb/gdbengine.cpp
@@ -4905,6 +4905,10 @@ void GdbEngine::loadPythonDumpers()
postCommand("python execfile('" + dumperSourcePath + "qttypes.py')",
ConsoleCommand|NonCriticalResponse);
+ postCommand("python qqStringCutOff = "
+ + debuggerCore()->action(MaximalStringLength)->value().toByteArray(),
+ ConsoleCommand|NonCriticalResponse);
+
loadInitScript();
postCommand("bbsetup", ConsoleCommand, CB(handleHasPython));