diff --git a/src/plugins/debugger/commonoptionspage.cpp b/src/plugins/debugger/commonoptionspage.cpp index 24138b192cd..fc0f22e1a47 100644 --- a/src/plugins/debugger/commonoptionspage.cpp +++ b/src/plugins/debugger/commonoptionspage.cpp @@ -236,7 +236,7 @@ void CommonOptionsPageWidget::apply() for (auto it = allPathMap.begin(), end = allPathMap.end(); it != end; ++it) { const QString key = it.key(); if (key.startsWith('(')) - options->sourcePathRegExpMap.append(qMakePair(QRegExp(key), it.value())); + options->sourcePathRegExpMap.append(qMakePair(QRegularExpression(key), it.value())); else options->sourcePathMap.insert(key, it.value()); } diff --git a/src/plugins/debugger/debuggeractions.cpp b/src/plugins/debugger/debuggeractions.cpp index 9df57cb430c..631bb881546 100644 --- a/src/plugins/debugger/debuggeractions.cpp +++ b/src/plugins/debugger/debuggeractions.cpp @@ -87,7 +87,7 @@ void GlobalDebuggerOptions::fromSettings() const QString key = s->value(sourcePathMappingSourceKey).toString(); const QString value = s->value(sourcePathMappingTargetKey).toString(); if (key.startsWith('(')) - sourcePathRegExpMap.append(qMakePair(QRegExp(key), value)); + sourcePathRegExpMap.append(qMakePair(QRegularExpression(key), value)); else sourcePathMap.insert(key, value); } diff --git a/src/plugins/debugger/debuggeractions.h b/src/plugins/debugger/debuggeractions.h index 61f5df39aa9..30dbe7b9af9 100644 --- a/src/plugins/debugger/debuggeractions.h +++ b/src/plugins/debugger/debuggeractions.h @@ -28,7 +28,7 @@ #include #include #include -#include +#include #include namespace Utils { class SavedAction; } @@ -37,7 +37,7 @@ namespace Debugger { namespace Internal { using SourcePathMap = QMap; -using SourcePathRegExpMap = QVector >; +using SourcePathRegExpMap = QVector>; // Global debugger options that are not stored as saved action. class GlobalDebuggerOptions diff --git a/src/plugins/debugger/debuggerengine.cpp b/src/plugins/debugger/debuggerengine.cpp index 0c604841ab9..1e0006f5d74 100644 --- a/src/plugins/debugger/debuggerengine.cpp +++ b/src/plugins/debugger/debuggerengine.cpp @@ -2827,10 +2827,10 @@ void CppDebuggerEngine::validateRunParameters(DebuggerRunParameters &rp) for (auto itExp = globalRegExpSourceMap.begin(), itEnd = globalRegExpSourceMap.end(); itExp != itEnd; ++itExp) { - QRegExp exp = itExp->first; - int index = exp.indexIn(string); - if (index != -1) { - rp.sourcePathMap.insert(string.left(index) + exp.cap(1), itExp->second); + const QRegularExpressionMatch match = itExp->first.match(string); + if (match.hasMatch()) { + rp.sourcePathMap.insert(string.left(match.capturedStart()) + match.captured(1), + itExp->second); found = true; break; }