Bug 369313 - Debugging does not end after Process Error
Summary: Debugging does not end after Process Error
Status: RESOLVED FIXED
Alias: None
Product: kdevelop
Classification: Applications
Component: CPP Debugger (show other bugs)
Version: git master
Platform: Compiled Sources Linux
: NOR minor
Target Milestone: ---
Assignee: kdevelop-bugs-null
URL:
Keywords:
: 379532 (view as bug list)
Depends on:
Blocks:
 
Reported: 2016-09-25 09:31 UTC by Igor Kushnir
Modified: 2023-01-21 06:51 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.11.230400
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Igor Kushnir 2016-09-25 09:31:09 UTC
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.
Comment 1 Justin Zobel 2022-10-24 00:46:58 UTC
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!
Comment 2 Igor Kushnir 2022-10-24 06:05:58 UTC
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.
Comment 3 Igor Kushnir 2022-11-07 07:55:53 UTC
*** Bug 379532 has been marked as a duplicate of this bug. ***
Comment 4 Igor Kushnir 2023-01-21 06:51:31 UTC
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