summaryrefslogtreecommitdiff
path: root/src/plugins/debugger/debuggerprotocol.cpp
diff options
context:
space:
mode:
authorJarek Kobus <jaroslaw.kobus@qt.io>2021-05-20 12:15:03 +0200
committerJarek Kobus <jaroslaw.kobus@qt.io>2021-05-20 11:13:39 +0000
commit3dc360f728e9e62e2d89d7723eaf6e52b57300a2 (patch)
tree7444d94a776c2ba26e347ab2e280f7d971462fd1 /src/plugins/debugger/debuggerprotocol.cpp
parent1d9f535c8ad58df1179b31ed3183a355b898e09d (diff)
downloadqt-creator-3dc360f728e9e62e2d89d7723eaf6e52b57300a2.tar.gz
Fix matching closing square bracket
Task-number: QTCREATORBUG-25745 Change-Id: I63ceb93d6208fb3fe19b4c11c6963a69bc01f260 Reviewed-by: hjk <hjk@qt.io>
Diffstat (limited to 'src/plugins/debugger/debuggerprotocol.cpp')
-rw-r--r--src/plugins/debugger/debuggerprotocol.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/plugins/debugger/debuggerprotocol.cpp b/src/plugins/debugger/debuggerprotocol.cpp
index 67340c4e1f..6dc856324d 100644
--- a/src/plugins/debugger/debuggerprotocol.cpp
+++ b/src/plugins/debugger/debuggerprotocol.cpp
@@ -101,7 +101,7 @@ QChar DebuggerOutputParser::readChar()
static bool isNameChar(char c)
{
- return c != '=' && c != ':' && !isspace(c);
+ return c != '=' && c != ':' && c != ']' && !isspace(c);
}
void GdbMi::parseResultOrValue(DebuggerOutputParser &parser)
@@ -118,8 +118,12 @@ void GdbMi::parseResultOrValue(DebuggerOutputParser &parser)
//qDebug() << "no valid result in " << parser.buffer();
return;
}
- if (parser.isAtEnd() || parser.isCurrent('('))
+ if (parser.isAtEnd())
+ return;
+ if (parser.isCurrent('(')) {
+ parser.advance();
return;
+ }
m_name = parser.readString(isNameChar);
@@ -296,7 +300,8 @@ void GdbMi::parseList(DebuggerOutputParser &parser)
parser.advance();
m_type = List;
parser.skipCommas();
- while (!parser.isAtEnd()) {
+ while (true) {
+ QTC_ASSERT(!parser.isAtEnd(), break);
if (parser.isCurrent(']')) {
parser.advance();
break;
@@ -306,11 +311,7 @@ void GdbMi::parseList(DebuggerOutputParser &parser)
if (child.isValid()) {
m_children.push_back(child);
parser.skipCommas();
- continue;
}
-
- QTC_ASSERT(!parser.isAtEnd(), break);
- parser.advance();
}
}