Debugger: Use an aspect for the source path mapping

More in line with the other settings.

Change-Id: I86494f1955120cddda7d2f2eec8ba0fdbfd99585
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
hjk
2021-03-05 12:48:26 +01:00
parent cb55af8e55
commit 641604429a
11 changed files with 197 additions and 177 deletions

View File

@@ -2812,10 +2812,10 @@ void CppDebuggerEngine::validateRunParameters(DebuggerRunParameters &rp)
bool hasEmbeddedInfo = elfData.indexOf(".debug_info") >= 0;
bool hasLink = elfData.indexOf(".gnu_debuglink") >= 0;
if (hasEmbeddedInfo) {
const GlobalDebuggerOptions *options = Internal::globalDebuggerOptions();
const SourcePathMap sourcePathMap = debuggerSettings()->sourcePathMap.value();
QList<QPair<QRegularExpression, QString>> globalRegExpSourceMap;
globalRegExpSourceMap.reserve(options->sourcePathMap.size());
for (auto it = options->sourcePathMap.begin(), end = options->sourcePathMap.end(); it != end; ++it) {
globalRegExpSourceMap.reserve(sourcePathMap.size());
for (auto it = sourcePathMap.begin(), end = sourcePathMap.end(); it != end; ++it) {
if (it.key().startsWith('(')) {
const QString expanded = Utils::globalMacroExpander()->expand(it.value());
if (!expanded.isEmpty())