From bba8a6e3a7c413f6b001fa81258573169bf7d8b1 Mon Sep 17 00:00:00 2001 From: Zhang TingAn Date: Mon, 5 Aug 2024 11:46:53 +0800 Subject: [PATCH] fix: [debugger] An abnormal prompt message occurs when terminating debugging Log: 1.cmake :Multiple prompts 2.python : no prompt --- src/plugins/debugger/dap/dapdebugger.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/plugins/debugger/dap/dapdebugger.cpp b/src/plugins/debugger/dap/dapdebugger.cpp index 633893cdc..7ceaaa505 100644 --- a/src/plugins/debugger/dap/dapdebugger.cpp +++ b/src/plugins/debugger/dap/dapdebugger.cpp @@ -631,8 +631,10 @@ void DAPDebugger::registerDapHandlers() if (event.reason == "exited") { d->threads.removeOne(event.threadId); - if (d->threads.isEmpty()) + if (d->threads.isEmpty()) { + printOutput(tr("\nThe debugee has Terminated.\n"), OutputPane::OutputFormat::NormalMessage); updateRunState(kNoRun); + } } }); @@ -774,7 +776,7 @@ void DAPDebugger::handleEvents(const dpf::Event &event) auto prjInfo = event.property("projectInfo").value(); if (d->projectInfo.isSame(prjInfo)) { d->activeProjectKitName.clear(); - updateRunState(kNoRun); + abortDebug(); } } else if (event.data() == editor.switchedFile.name) { QString filePath = event.property(editor.switchedFile.pKeys[0]).toString(); @@ -1203,9 +1205,6 @@ void DAPDebugger::updateWatchingVariables() void DAPDebugger::exitDebug() { - //abort debugger - abortDebug(); - // Change UI. editor.removeDebugLine(); d->variablesPane->hide();