summaryrefslogtreecommitdiff
path: root/src/plugins/debugger/gdb/gdbengine.cpp
diff options
context:
space:
mode:
authorOrgad Shaneh <orgad.shaneh@audiocodes.com>2023-03-08 18:14:41 +0200
committerOrgad Shaneh <orgads@gmail.com>2023-03-09 18:50:11 +0000
commitf9b6ee54d84b031915491aab1634b5caf7a45a0c (patch)
treeed29df67b14120bf98ba8a62f7efde242b52f62f /src/plugins/debugger/gdb/gdbengine.cpp
parent13b5254df6113cfb8c675cef71653928cb255335 (diff)
downloadqt-creator-f9b6ee54d84b031915491aab1634b5caf7a45a0c.tar.gz
Debugger: Fix write error on terminated GDB process
Stopping/Aborting the debugger in core dump mode popped an error message saying "An error occurred when attempting to write to the process." Take 2 of 87c00b86dbf75a9204041b0b8e836415b97dc125. The flow is: InferiorUnrunnable -> InferiorShutdownRequested. For AttachToCore, there is a no-op transition to InferiorShutdownFinished, and then EngineShutdownRequested is triggered. This calls exitGdb, and when the thread group is clear, the engine calls notifyInferiorExited, which retriggered EngineShutdownRequested. Now the flow looks like this: EngineShutdownRequested -> InferiorShutdownFinished InferiorShutdownFinished -> EngineShutdownRequested And exitGdb is called again. Fix this by changing the Finished type to match the Requested. Change-Id: I45332d3ee1a1e9421ed516cd513542b310198c93 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Diffstat (limited to 'src/plugins/debugger/gdb/gdbengine.cpp')
-rw-r--r--src/plugins/debugger/gdb/gdbengine.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp
index 3fd126a4b0..5156d2e447 100644
--- a/src/plugins/debugger/gdb/gdbengine.cpp
+++ b/src/plugins/debugger/gdb/gdbengine.cpp
@@ -1715,6 +1715,8 @@ void GdbEngine::handleThreadGroupExited(const GdbMi &result)
notifyExitCode(exitCode);
if (m_rerunPending)
m_rerunPending = false;
+ else if (state() == EngineShutdownRequested)
+ notifyEngineShutdownFinished();
else
notifyInferiorExited();
}