Commit 80e89b23 authored by Oswald Buddenhagen's avatar Oswald Buddenhagen

optimize output receiver somewhat

parent 0acae6f8
......@@ -554,24 +554,29 @@ void GdbEngine::readGdbStandardError()
void GdbEngine::readGdbStandardOutput()
{
int newstart = 0;
int scan = m_inbuffer.size();
m_inbuffer.append(m_gdbProc.readAllStandardOutput());
int newstart = 0;
while (newstart < m_inbuffer.size()) {
int start = newstart;
int end = m_inbuffer.indexOf('\n', start);
int end = m_inbuffer.indexOf('\n', scan);
if (end < 0) {
m_inbuffer.remove(0, start);
return;
}
newstart = end + 1;
scan = newstart;
if (end == start)
continue;
#ifdef Q_OS_WIN
if (m_inbuffer.at(end - 1) == '\r') {
--end;
if (end == start)
continue;
}
#endif
handleResponse(QByteArray::fromRawData(m_inbuffer.constData() + start, end - start));
}
m_inbuffer.clear();
......
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