From 7ccd9d694327b44d5033b218273f8e79f644a85c Mon Sep 17 00:00:00 2001 From: hjk Date: Fri, 5 Mar 2021 08:01:17 +0100 Subject: Debugger: Move interpretation on nature of source path mapping to user code Change f0e2708 introduced the ability to specify source path mapping containing regular expressions and used this in the elf reader. To simplify the code, this change here moves the decision which paths are considered regular expressions to the user. The other users which are not aware of the special handling of paths starting with '(' in the elf reader will interpret them as plain string, which appears to be the right thing. Change-Id: I31f10ed866fe7582d44307a923b6db10206acc9a Reviewed-by: Orgad Shaneh --- src/plugins/debugger/debuggeractions.cpp | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) (limited to 'src/plugins/debugger/debuggeractions.cpp') diff --git a/src/plugins/debugger/debuggeractions.cpp b/src/plugins/debugger/debuggeractions.cpp index 21c6d8c8b0..326ee70614 100644 --- a/src/plugins/debugger/debuggeractions.cpp +++ b/src/plugins/debugger/debuggeractions.cpp @@ -58,7 +58,7 @@ void GlobalDebuggerOptions::toSettings() const { QSettings *s = Core::ICore::settings(); s->beginWriteArray(sourcePathMappingArrayNameC); - if (!sourcePathMap.isEmpty() || !sourcePathRegExpMap.isEmpty()) { + if (!sourcePathMap.isEmpty()) { const QString sourcePathMappingSourceKey(sourcePathMappingSourceKeyC); const QString sourcePathMappingTargetKey(sourcePathMappingTargetKeyC); int i = 0; @@ -69,13 +69,6 @@ void GlobalDebuggerOptions::toSettings() const s->setValue(sourcePathMappingSourceKey, it.key()); s->setValue(sourcePathMappingTargetKey, it.value()); } - for (auto it = sourcePathRegExpMap.constBegin(), cend = sourcePathRegExpMap.constEnd(); - it != cend; - ++it, ++i) { - s->setArrayIndex(i); - s->setValue(sourcePathMappingSourceKey, it->first.pattern()); - s->setValue(sourcePathMappingTargetKey, it->second); - } } s->endArray(); } @@ -91,10 +84,7 @@ void GlobalDebuggerOptions::fromSettings() s->setArrayIndex(i); const QString key = s->value(sourcePathMappingSourceKey).toString(); const QString value = s->value(sourcePathMappingTargetKey).toString(); - if (key.startsWith('(')) - sourcePathRegExpMap.append(qMakePair(QRegularExpression(key), value)); - else - sourcePathMap.insert(key, value); + sourcePathMap.insert(key, value); } } s->endArray(); -- cgit v1.2.1