forked from qt-creator/qt-creator
Debugger: make default number of array elements configurable
Change-Id: Iad7b653d66f9f87d818f8cce612a82a5fc391b23 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -153,7 +153,8 @@ public:
|
||||
|
||||
Grid limits {
|
||||
s.maximalStringLength, br,
|
||||
s.displayStringLimit
|
||||
s.displayStringLimit, br,
|
||||
s.defaultArraySize
|
||||
};
|
||||
|
||||
Column {
|
||||
|
||||
@@ -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("<p>"
|
||||
+ 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);
|
||||
|
||||
@@ -146,6 +146,7 @@ public:
|
||||
Utils::BoolAspect autoDerefPointers;
|
||||
Utils::IntegerAspect maximalStringLength;
|
||||
Utils::IntegerAspect displayStringLimit;
|
||||
Utils::IntegerAspect defaultArraySize;
|
||||
Utils::BoolAspect sortStructMembers;
|
||||
Utils::BoolAspect useToolTipsInLocalsView;
|
||||
|
||||
|
||||
@@ -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<QString> WatchHandler::expandedINames() const
|
||||
|
||||
int WatchHandler::maxArrayCount(const QString &iname) const
|
||||
{
|
||||
return m_model->m_maxArrayCount.value(iname, WatchModel::defaultMaxArrayCount);
|
||||
return m_model->m_maxArrayCount.value(iname, debuggerSettings()->defaultArraySize.value());
|
||||
}
|
||||
|
||||
void WatchHandler::recordTypeInfo(const GdbMi &typeInfo)
|
||||
|
||||
Reference in New Issue
Block a user