Skip to content

Commit ab29b81

Browse files
committed
Print GDB errors in log
1 parent a48a45b commit ab29b81

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

debugger.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,10 @@ void Debugger::readOutputToBuffer()
147147
return;
148148
QByteArray error = process->readAllStandardError();
149149
errorBuffer += QString::fromLocal8Bit(error.constData(), error.size());
150+
allErrorBuffer += QString::fromLocal8Bit(error.constData(), error.size());
150151
QByteArray output = process->readAllStandardOutput();
151152
buffer += QString::fromLocal8Bit(output.constData(), output.size());
153+
allBuffer += QString::fromLocal8Bit(output.constData(), output.size());
152154
}
153155

154156
void Debugger::processOutput()
@@ -171,6 +173,8 @@ void Debugger::checkGdbRun()
171173
checkGdbRunTimer->stop();
172174
if (!gdbRun) {
173175
emit printLog(tr("GDB error\n"), Qt::red);
176+
emit printLog(allBuffer, Qt::red);
177+
emit printLog(allErrorBuffer, Qt::red);
174178
emit finished();
175179
}
176180
}

debugger.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,9 +147,15 @@ class Debugger : public QObject
147147
//! Global gdb output buffer
148148
QString buffer;
149149

150+
//! Global gdb all output buffer
151+
QString allBuffer;
152+
150153
//! Global gdb error buffer
151154
QString errorBuffer;
152155

156+
//! Global gdb all error buffer
157+
QString allErrorBuffer;
158+
153159
//! Timer for checking output and sending ready output to processing with Debugger::processOutput() function
154160
QTimer *bufferTimer;
155161

0 commit comments

Comments
 (0)