From a5f7b0232495d02484926b86c17dc243112371c1 Mon Sep 17 00:00:00 2001 From: Roy Qu Date: Thu, 14 Mar 2024 09:23:04 +0800 Subject: [PATCH] - enhancement: Make output in the debugger console cleaner. --- RedPandaIDE/debugger/debugger.cpp | 7 +++++-- RedPandaIDE/debugger/gdbmidebugger.cpp | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/RedPandaIDE/debugger/debugger.cpp b/RedPandaIDE/debugger/debugger.cpp index ec5bc59f..5e37a556 100644 --- a/RedPandaIDE/debugger/debugger.cpp +++ b/RedPandaIDE/debugger/debugger.cpp @@ -1012,8 +1012,11 @@ void Debugger::syncFinishedParsing() // pMainWindow->addDebugOutput("(gdb)"); // } // } - for (const QString& line:mClient->consoleOutput()) { - pMainWindow->addDebugOutput(line); + if (!mClient->consoleOutput().isEmpty()) { + for (const QString& line:mClient->consoleOutput()) { + pMainWindow->addDebugOutput(line); + } + pMainWindow->addDebugOutput("(gdb)"); } } } diff --git a/RedPandaIDE/debugger/gdbmidebugger.cpp b/RedPandaIDE/debugger/gdbmidebugger.cpp index 59fe468d..225a3acb 100644 --- a/RedPandaIDE/debugger/gdbmidebugger.cpp +++ b/RedPandaIDE/debugger/gdbmidebugger.cpp @@ -867,6 +867,7 @@ void GDBMIDebuggerClient::processResultRecord(const QByteArray &line) } disOutput=newOutput; } + mConsoleOutput.clear(); emit disassemblyUpdate(mCurrentFile,mCurrentFunc, disOutput); } }