Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 487682

Summary: When showing the process selection list for attaching, detect if a process is already being debugged
Product: [Tools] CDT Reporter: Marc Dumais <marc.dumais>
Component: cdt-debug-dsf-gdbAssignee: Project Inbox <cdt-debug-dsf-gdb-inbox>
Status: RESOLVED FIXED QA Contact: Marc Khouzam <marc.khouzam>
Severity: normal    
Priority: P3 CC: cdtdoug, marc.khouzam, teodor.madan
Version: Next   
Target Milestone: 9.0.0   
Hardware: PC   
OS: Linux   
See Also: https://git.eclipse.org/r/66250
https://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=f29de7ceddd61bb6ce4ed9854f947d682bb02cc1
Whiteboard:

Description Marc Dumais CLA 2016-02-11 11:20:36 EST
This is a "spin-off" of bug 486408. It turns-out that it's not ATM possible to address both the initial stated problem in that bug, and the enhancement described here. Please refer to the above bug for background information.
-------------------

Since a given program can only be debugged by one "superior" at a time, trying to attach to a process, that is already being debugged, will fail. In some cases, it might be possible to detect this in advance, and prevent or warn the user about it. 

Cases where we think it's possible to detect the scenario: 
- within one debug session (local or remote?) (patch submitted for review: https://git.eclipse.org/r/66250)
- between multiple, local, debug sessions (patch pending)

The cases where we think it's not possible (or seems hard) to detect the scenario:
- between different remote debug session
- process already being debugged (or ptraced) outside of CDT in another instance of CDT
Comment 1 Teodor Madan CLA 2016-02-21 15:49:53 EST
Pushed for review also the second part under same gerrit change id.

With this patch, process selection dialog will show an error when selecting a process that is:
- already debugged in the same debug session (local or remote)
- already debugged by *any* *local* debug sessions.
Comment 3 Teodor Madan CLA 2016-03-03 09:52:43 EST
Pushed to master