Commit 1154aab0 authored by Orgad Shaneh's avatar Orgad Shaneh Committed by hjk

Debugger: Fix crash on regexp matching

Conversion of QList to QVector required further adaptations.

Instead of trying to match all expressions, break on first match.

Change-Id: I76d67ae876687ac15f3099a0a26eac582ad73c76
Reviewed-by: default avatarhjk <hjk121@nokiamail.com>
parent c218c051
......@@ -1843,21 +1843,21 @@ void DebuggerEngine::validateExecutable(DebuggerStartParameters *sp)
if (QSharedPointer<Utils::ElfMapper> mapper = reader.readSection(".debug_str")) {
const char *str = mapper->start;
const char *limit = str + mapper->fdlen;
bool found = false;
while (str < limit) {
QString string = QString::fromUtf8(str);
auto itExp = globalRegExpSourceMap.begin();
auto itEnd = globalRegExpSourceMap.end();
while (itExp != itEnd) {
const QString string = QString::fromUtf8(str);
for (auto itExp = globalRegExpSourceMap.begin(), itEnd = globalRegExpSourceMap.end();
itExp != itEnd;
++itExp) {
QRegExp exp = itExp->first;
int index = exp.indexIn(string);
if (index != -1) {
sp->sourcePathMap.insert(string.left(index) + exp.cap(1), itExp->second);
itExp = globalRegExpSourceMap.erase(itExp);
} else {
++itExp;
found = true;
break;
}
}
if (globalRegExpSourceMap.isEmpty())
if (found)
break;
const int len = strlen(str);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment