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

Bug 311118

Summary: [cdi][launch] Attach does not work with MinGW gdb 7.0
Product: [Tools] CDT Reporter: John Cortell <john.cortell>
Component: cdt-debug-dsf-gdbAssignee: John Cortell <john.cortell>
Status: RESOLVED FIXED QA Contact: Marc Khouzam <marc.khouzam>
Severity: normal    
Priority: P3 CC: nobody, pawel.1.piech
Version: 7.0Flags: marc.khouzam: review+
Target Milestone: 7.0   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
gdb log
none
Fix courtesy of Marc. john.cortell: iplog-, john.cortell: review?

Description John Cortell CLA 2010-04-29 17:25:18 EDT
Created attachment 166573 [details]
gdb log

Steps to reproduce:
1. Create a simple C project that doesn't just run to completion (give it a long sleep call)
2. Build the project
3. run the executable from a Windows command prompt
4. Create a dsf-gdb attach launch configuration and make sure to specify a 7.0 MinGW gdb
5. Launch the session and pick your program from the list of running processes
The debug view populates but it shows the process to be running. It is in fact suspended. You can confirm this by typing 'info threads' in the Eclipse gdb console

The problem is that MinGW gdb sends an empty stopped event (see attached gdb log). dsf-gdb doesn't know what to do with it, as the event provides no process or thread context. Search for "Badly formatted event" in MIRunControlEventProcessor_7_0 to see where it gives up on the event.

But the target truly is suspended, so we really shouldn't be giving up so easily and throwing the event under the rug.

BTW, running an mi gdb session at the command line shows the same exact behavior. It receives an empty stopped event.
Comment 1 John Cortell CLA 2010-04-29 17:29:26 EDT
This works with CDI, so making this a parity issue.
Comment 2 John Cortell CLA 2010-04-30 11:53:51 EDT
Created attachment 166632 [details]
Fix courtesy of Marc.
Comment 3 John Cortell CLA 2010-04-30 11:54:26 EDT
Fix courtesy of Marc. Committed to HEAD. Marc, please review :-)
Comment 4 Marc Khouzam CLA 2010-04-30 11:57:30 EDT
OK :-)
Comment 5 CDT Genie CLA 2010-07-28 15:24:55 EDT
*** cdt cvs genie on behalf of jcortell ***
Bug 311118: Attach does not work with MinGW gdb 7.0

[*] MIRunControlEventProcessor_7_0.java 1.8 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/MIRunControlEventProcessor_7_0.java?root=Tools_Project&r1=1.7&r2=1.8