From 4d2b448541cfa44ee385c9da6249be67c90330e5 Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Thu, 9 Mar 2023 08:29:09 +0200 Subject: [PATCH] GDB: Do not skip detach for core inferior shutdown Another attempt for 87c00b86dbf75a9204041b0b8e836415b97dc125. This section was added in 3b5ecac238, which was a refactoring commit, not sure why. It causes state discrepancy, because only on quit the "thread-exited" messages are processed, and when the thread list is clear, the engine considers it as InferiorShutdownFinished and triggers engine shutdown again, which is wrong, because it quits twice and can no longer write to the process, which is already dead at this point. Change-Id: Ic5cfced672b640865e701ac96b6fcea34d748211 Reviewed-by: hjk Reviewed-by: Christian Stenger --- src/plugins/debugger/gdb/gdbengine.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp index 5156d2e4474..b8ba1441edd 100644 --- a/src/plugins/debugger/gdb/gdbengine.cpp +++ b/src/plugins/debugger/gdb/gdbengine.cpp @@ -1624,10 +1624,6 @@ QString GdbEngine::cleanupFullName(const QString &fileName) void GdbEngine::shutdownInferior() { CHECK_STATE(InferiorShutdownRequested); - if (runParameters().startMode == AttachToCore) { - notifyInferiorShutdownFinished(); - return; - } DebuggerCommand cmd; cmd.function = QLatin1String(runParameters().closeMode == DetachAtClose ? "detach " : "kill "); cmd.callback = CB(handleInferiorShutdown);