diff options
author | hjk <[email protected]> | 2021-03-05 08:01:17 +0100 |
---|---|---|
committer | hjk <[email protected]> | 2021-03-05 10:52:57 +0000 |
commit | 7ccd9d694327b44d5033b218273f8e79f644a85c (patch) | |
tree | 3506b7db3a60f532f80ce6fedb5b6ce06e07fa18 /src/plugins/debugger/debuggeractions.cpp | |
parent | ee13340bdcb49fdb00bee9b018773b3bca0ebc97 (diff) |
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 <[email protected]>
Diffstat (limited to 'src/plugins/debugger/debuggeractions.cpp')
-rw-r--r-- | src/plugins/debugger/debuggeractions.cpp | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/src/plugins/debugger/debuggeractions.cpp b/src/plugins/debugger/debuggeractions.cpp index 21c6d8c8b0c..326ee706145 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(); |