KDevelop does not exit its debugging state after debug-launching an executable fails. Reproducible: Always Steps to Reproduce: 1. Configure executable launch that will fail. For example, set path to non-existing executable. 2. Start debugging. 3. Dismiss a Process Error warning. 4. (Optional) select another possibly valid executable as a Current Launch Configuration. 5. Start debugging again. Actual Results: * After step 3: KDevelop did not exit Debug mode. * After step 5: "A program is already being debugged..." warning appeared. Expected Results: * After step 3: previous debug attempt should have finished after the Process Error and KDevelop should have switched to the normal (Code) mode in the same way as after successful debugging. * After step 5: a new debug launch should have started normally without a prompt to stop the previous failed launch. Workarounds * After step 3: (optional) go back to the normal Code mode from the top right corner menu. * After step 5: click Yes in the warning dialog to stop the failed launch and start the new one.
Thank you for reporting this bug in KDE software. As it has been a while since this issue was reported, can we please ask you to see if you can reproduce the issue with a recent software version? If you can reproduce the issue, please change the status to "REPORTED" when replying. Thank you!
The bug is still present in current KDevelop master - version 5.10.221170 (22.11.70) One could argue that a failed launch is inconclusive and so keeps KDevelop in the Debug mode. However, the "A program is already being debugged..." warning dialog definitely should be displayed only if debugging is really taking place. Otherwise, not only the user is confused, but (s)he is also being accustomed/trained to dismiss this warning and start a new launch without considering if something went wrong.
*** Bug 379532 has been marked as a duplicate of this bug. ***
Git commit a6183b28c2077b3610ab4afa9180489c3aa05e5d by Igor Kushnir. Committed on 21/01/2023 at 06:50. Pushed by igorkushnir into branch 'master'. MIDebugJob: don't leak the debug session if config is invalid The constructor of a MI debug job creates a debug session. When the configured launch executable or its arguments are invalid, MIDebugJob doesn't call MIDebugSession::startDebugging() and finishes with an error. The debug session is not destroyed and the Debug area remains active in KDevelop then. Calling MIDebugSession::stopDebugger() finishes the debug session and lets DebugController destroy it. This function explicitly and correctly handles stopping debugger when it is not started. FIXED-IN: 5.11.230400 M +2 -0 plugins/debuggercommon/midebugjobs.cpp https://invent.kde.org/kdevelop/kdevelop/commit/a6183b28c2077b3610ab4afa9180489c3aa05e5d