all repos — mgba @ 6fb7c0780a4cd81aa2d125808dece19066aebc2a

mGBA Game Boy Advance Emulator

Qt: Handle interrupting CLI debugger better (fixes #697)
Vicki Pfau vi@endrift.com
Sat, 22 Apr 2017 18:40:55 -0700
commit

6fb7c0780a4cd81aa2d125808dece19066aebc2a

parent

36c66e7db434bc3034ec172323cc7f0cd7e5c1ec

1 files changed, 5 insertions(+), 4 deletions(-)

jump to
M src/platform/qt/DebuggerConsoleController.cppsrc/platform/qt/DebuggerConsoleController.cpp

@@ -80,10 +80,11 @@ QMutexLocker lock(&self->m_mutex);

while (self->m_lines.isEmpty()) { self->m_cond.wait(&self->m_mutex); } - self->m_last = self->m_lines.takeFirst().toUtf8(); - if (self->m_last.isEmpty()) { - self->m_last = "\n"; + QString last = self->m_lines.takeFirst(); + if (last.isNull()) { + return nullptr; } + self->m_last = last.toUtf8(); *len = self->m_last.size(); return self->m_last.constData();

@@ -101,7 +102,7 @@ DebuggerConsoleController* self = consoleBe->self;

GameController::Interrupter interrupter(self->m_gameController, true); QMutexLocker lock(&self->m_mutex); if (self->m_history.isEmpty()) { - return "\n"; + return "i"; } self->m_last = self->m_history.last().toUtf8(); return self->m_last.constData();