diff --git a/src/plugins/debugger/commonoptionspage.cpp b/src/plugins/debugger/commonoptionspage.cpp index dc47fb79e08..f04eeb74b91 100644 --- a/src/plugins/debugger/commonoptionspage.cpp +++ b/src/plugins/debugger/commonoptionspage.cpp @@ -153,7 +153,8 @@ public: Grid limits { s.maximalStringLength, br, - s.displayStringLimit + s.displayStringLimit, br, + s.defaultArraySize }; Column { diff --git a/src/plugins/debugger/debuggeractions.cpp b/src/plugins/debugger/debuggeractions.cpp index a3a6187a417..208ca88d61e 100644 --- a/src/plugins/debugger/debuggeractions.cpp +++ b/src/plugins/debugger/debuggeractions.cpp @@ -531,6 +531,15 @@ DebuggerSettings::DebuggerSettings() + Tr::tr("The maximum length for strings in separated windows. " "Longer strings are cut off and displayed with an ellipsis attached.")); + defaultArraySize.setSettingsKey(debugModeGroup, "DefaultArraySize"); + defaultArraySize.setDefaultValue(100); + defaultArraySize.setRange(10, 1000000000); + defaultArraySize.setSingleStep(100); + defaultArraySize.setLabelText(Tr::tr("Default array size:")); + defaultArraySize.setToolTip("
"
+ + Tr::tr("The number of array elements requested when expanding "
+ "entries in the Locals and Expressions views."));
+
expandStack.setLabelText(Tr::tr("Reload Full Stack"));
createFullBacktrace.setLabelText(Tr::tr("Create Full Backtrace"));
@@ -610,6 +619,7 @@ DebuggerSettings::DebuggerSettings()
page4.registerAspect(&showQObjectNames);
page4.registerAspect(&displayStringLimit);
page4.registerAspect(&maximalStringLength);
+ page4.registerAspect(&defaultArraySize);
// Page 5
page5.registerAspect(&cdbAdditionalArguments);
diff --git a/src/plugins/debugger/debuggeractions.h b/src/plugins/debugger/debuggeractions.h
index 69cc76a1f1b..f01ef74aa99 100644
--- a/src/plugins/debugger/debuggeractions.h
+++ b/src/plugins/debugger/debuggeractions.h
@@ -146,6 +146,7 @@ public:
Utils::BoolAspect autoDerefPointers;
Utils::IntegerAspect maximalStringLength;
Utils::IntegerAspect displayStringLimit;
+ Utils::IntegerAspect defaultArraySize;
Utils::BoolAspect sortStructMembers;
Utils::BoolAspect useToolTipsInLocalsView;
diff --git a/src/plugins/debugger/watchhandler.cpp b/src/plugins/debugger/watchhandler.cpp
index 9b3521e11fd..0923348d94f 100644
--- a/src/plugins/debugger/watchhandler.cpp
+++ b/src/plugins/debugger/watchhandler.cpp
@@ -402,7 +402,6 @@ public:
WatchModel(WatchHandler *handler, DebuggerEngine *engine);
static QString nameForFormat(int format);
- constexpr static int defaultMaxArrayCount = 100;
QVariant data(const QModelIndex &idx, int role) const override;
bool setData(const QModelIndex &idx, const QVariant &value, int role) override;
@@ -1350,7 +1349,8 @@ void WatchModel::expand(WatchItem *item, bool requestEngineUpdate)
return;
if (item->isLoadMore()) {
item = item->parent();
- m_maxArrayCount[item->iname] = m_maxArrayCount.value(item->iname, defaultMaxArrayCount) * 10;
+ m_maxArrayCount[item->iname]
+ = m_maxArrayCount.value(item->iname, debuggerSettings()->defaultArraySize.value()) * 10;
if (requestEngineUpdate)
m_engine->updateItem(item->iname);
} else {
@@ -2848,7 +2848,7 @@ QSet