Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 311118 - [cdi][launch] Attach does not work with MinGW gdb 7.0
Summary: [cdi][launch] Attach does not work with MinGW gdb 7.0
Status: RESOLVED FIXED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-debug-dsf-gdb (show other bugs)
Version: 7.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 7.0   Edit
Assignee: John Cortell CLA
QA Contact: Marc Khouzam CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-04-29 17:25 EDT by John Cortell CLA
Modified: 2010-07-28 15:24 EDT (History)
2 users (show)

See Also:
marc.khouzam: review+


Attachments
gdb log (2.61 KB, text/plain)
2010-04-29 17:25 EDT, John Cortell CLA
no flags Details
Fix courtesy of Marc. (1.63 KB, patch)
2010-04-30 11:53 EDT, John Cortell CLA
john.cortell: iplog-
john.cortell: review?
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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