Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 341406 - [all-stop] "Connect to process" button in the debug view does nothing while target is running
Summary: [all-stop] "Connect to process" button in the debug view does nothing while t...
Status: RESOLVED FIXED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-debug-dsf-gdb (show other bugs)
Version: 8.0   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 8.0   Edit
Assignee: Marc Khouzam CLA
QA Contact: Marc Khouzam CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-30 14:12 EDT by Dobrin Alexiev CLA
Modified: 2011-05-04 17:23 EDT (History)
2 users (show)

See Also:
marc.khouzam: review? (nobody)


Attachments
Fix to disable the connect command in all-stop (1.15 KB, patch)
2011-05-04 16:21 EDT, Marc Khouzam CLA
marc.khouzam: iplog-
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dobrin Alexiev CLA 2011-03-30 14:12:45 EDT
Build Identifier: CDT 8

Start a stop mode GDB dubug session
Run the target
Click on the Connect to process bottun in the debug view few times
nothing happens
Yuo may need to select different nodes in the debug view to renable the button
After I suspend the target one or more dialogs pop up

I think we need to disable that button if the command cannot be dispatched to the debugger. 


Reproducible: Always
Comment 1 Marc Khouzam CLA 2011-05-04 16:18:40 EDT
Thanks Dobrin.

The problem here is that in all-stop mode, GDB will not answer any requests until the inferior stops.  So, in your case, we ask GDB for the list of processes that we can connect to, but since the target is running, this call does not return from GDB.  Once you suspend the target, the request is answered and the dialog comes up.

Ultimately, I see a couple of ways to handle this.
1- as you suggest, not allow to connect while the target is running
2- forcibly interrupt the target (like we do for a detach/terminate/breakpoint) before doing the attach.  The problem here is that an attach is actually two operations: first listing the processes, and then doing the attach.  To avoid interrupting the target for a long time, while the user selects a second process, we should probably interrupt once to list the processes and then resume; once the user makes her choice, we should then interrupt again, attach and resume again.

However, because we don't currently support multi-process in all-stop mode (bug 337897), there is no point in doing #2 yet.  I will attach a patch for the current bug that simply disables the command in all-stop mode, if we are trying to run a second process.  This is actually much nicer than allow the user to do multi-process in all-stop while we know it does not work yet.
Comment 2 Marc Khouzam CLA 2011-05-04 16:21:44 EDT
Created attachment 194764 [details]
Fix to disable the connect command in all-stop

Fix to disable the connect command in all-stop if we are already connected to a process.

Committed to HEAD.
Comment 3 Marc Khouzam CLA 2011-05-04 16:23:04 EDT
Mikhail, can you review?
Comment 4 CDT Genie CLA 2011-05-04 17:23:02 EDT
*** cdt cvs genie on behalf of mkhouzam ***
 Bug 341406: "Connect to process" button in the debug view does nothing while target is running in all-stop

[*] GDBProcesses_7_2.java 1.14 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBProcesses_7_2.java?root=Tools_Project&r1=1.13&r2=1.14