Bug 309364 - Add UI support for GDB "detach" and "disconnect" command
Summary: Add UI support for GDB "detach" and "disconnect" command
Status: NEW
Alias: None
Product: CDT
Classification: Tools
Component: cdt-debug (show other bugs)
Version: 6.0.2   Edit
Hardware: PC All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: cdt-debug-inbox@eclipse.org CLA
QA Contact: Jonah Graham CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-04-15 13:54 EDT by Nobody - feel free to take it CLA
Modified: 2020-09-04 15:26 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nobody - feel free to take it CLA 2010-04-15 13:54:51 EDT
See thread http://dev.eclipse.org/mhonarc/lists/cdt-dev/msg18309.html
Comment 1 Daniel Jacobowitz CLA 2010-04-15 15:42:22 EDT
I agree with several of the things said in that thread.  Having the GDB detach command available from the toolbar is useful; having the GDB disconnect command available somehow is useful, but it doesn't need to be on the toolbar.

The detach command makes sense in all GDB sessions; at least some versions of CDT only showed it for attach launches.
Comment 2 Marc Khouzam CLA 2010-04-15 21:10:05 EDT
(In reply to comment #1)

> The detach command makes sense in all GDB sessions; at least some versions of
> CDT only showed it for attach launches.

For DSF-GDB:
- the disconnect action is always available when you select the launch (top element in the debug tree), and it calls -gdb-exit
- when selection a process/thread/frame, the disconnect action calls 'detach' and is only enabled for GDB >= 7.0 and for an attach launch.

Can you explain a bit when else we should allow to 'detach'?
Comment 3 Nobody - feel free to take it CLA 2010-04-15 22:24:10 EDT
(In reply to comment #2)
> Can you explain a bit when else we should allow to 'detach'?

Marc, Dan's comment is about CDI/GDB. In CDI/GDB "Disconnect" (which translates to "etach) is only enabled for the so-called "attach" sessions. This is a limitation because it is also possible to "detach" from a regular session.  
At the same time we need to clarify when we can use "disconnect" (I mean GDB command). When I try it, I get "You can't do that when your target is a child" for both session types.
Comment 4 Daniel Jacobowitz CLA 2010-04-16 09:20:30 EDT
You can detach on any backend that supports it, and you can disconnect from any backend that supports that.

I believe the only targets that support disconnect are remote and record.  And record's disconnect only works if the underlying target is remote.  You can't use disconnect with a native target ("run", a.k.a. the "child" target), although such a thing could be added.

Most targets support detach regardless of "attach" versus "run".
Comment 5 Nobody - feel free to take it CLA 2010-04-16 11:49:36 EDT
(In reply to comment #4)
> You can detach on any backend that supports it, and you can disconnect from any
> backend that supports that.
> I believe the only targets that support disconnect are remote and record.  And
> record's disconnect only works if the underlying target is remote.  You can't
> use disconnect with a native target ("run", a.k.a. the "child" target),
> although such a thing could be added.
> Most targets support detach regardless of "attach" versus "run".

Is there a way to ask GDB whether a target supports "detach" and "disconnect"?
Comment 6 Daniel Jacobowitz CLA 2010-04-16 14:17:59 EDT
No, I don't think so.
Comment 7 Marc Khouzam CLA 2010-04-16 14:28:35 EDT
(In reply to comment #3)
> (In reply to comment #2)
> > Can you explain a bit when else we should allow to 'detach'?
> 
> Marc, Dan's comment is about CDI/GDB. In CDI/GDB "Disconnect" (which translates
> to "etach) is only enabled for the so-called "attach" sessions.

Yep, for DSF-GDB too.