Skip to main content



      Home
Home » Language IDEs » C / C++ IDE (CDT) » Debugging with minGW GDB(command line debugging works, CDT debugging fails)
Debugging with minGW GDB [message #524825] Fri, 02 April 2010 15:00 Go to next message
Eclipse UserFriend
Eclipse Galileo, all components are the latest from the download sites.

I have a medium sized multi-threaded application that I can stop and start (suspend and resume) successfully when I use minGW GDB from the command window. However, I am not able to do the same when I use CDT.

When I suspend the program, it takes several seconds to show it as suspended and my threads disappear from the Debug view. When I try to resume, I get a popup stating that "Target request failed: Target is not responding (timed out)."

I've tried using both GDB 6.6 and GDB 7.0 from the minGW download site. The Debug Configuration is setup to use MinGW gdb Debugger, Standard (Windows), and Protocol mi.

Here is the information I see in the Console window when this happens:
Num Active Threads = 0
Final Num Active Threads = 0~"[Switching to thread 3104.0x113c]\n"
250*stopped,reason="signal-received",signal-name="SIGINT",signal-meaning= "Interrupt",thread-id="4",frame={addr="0x7c87647d",func= "KERNEL32!GetConsoleCharType",args=[],from="C:\\WINDOWS\\system32\\kernel32.dll "}
(gdb)
&"Quit (expect signal SIGINT when the program is resumed)\n"
251 info threads
252 info threads
253 info signal SIGINT
254 info threads
255-exec-continue

Does anyone have any ideas?

[Updated on: Fri, 02 April 2010 15:11] by Moderator

Re: Debugging with minGW GDB [message #524846 is a reply to message #524825] Fri, 02 April 2010 18:40 Go to previous messageGo to next message
Eclipse UserFriend
Additional information.

If I step through the code that appears to be the problem (a thread sleep command Sleep(msecs*(CLOCKS_PER_SEC/1000))Wink GDB reports this:

*stopped,reason="end-stepping-range",frame={addr="0x004110ec ",func="main",args=[{name="argc",value="1"},{name="argv ",value="0x3e4ce8"}],file="<omitted, relative path to file>",fullname="<omitted, full path to file>",line="493"},thread-id="1",stopped-threads="all"

This happens after I step over the sleep command, which should actually allow all of my other threads to run. It does work at the command line.
Re: Debugging with minGW GDB [message #525066 is a reply to message #524825] Mon, 05 April 2010 13:18 Go to previous messageGo to next message
Eclipse UserFriend
Suspending a program is a complicated things on Windows and CDT has had some issue about it. You can look for some details on the cdt-dev mailing list and eclipse bugzilla.

I don't know the exact details for your particular case, but using MinGw 7.0 is a good start. You can also give a try to the other CDT debugging integration called DSF-GDB. To use it, open the debug launch configurations and look at the bottom of the tabs (like teh 'main' tab), you will see a hyperlink; click on the hyper link and select 'GDB (DSF) Create....." See if it works better for this case.

Marc
Re: Debugging with minGW GDB [message #525249 is a reply to message #525066] Mon, 05 April 2010 16:12 Go to previous message
Eclipse UserFriend
Thanks for the reply. I did try the DSF configuration (guess I should have mentioned that before) but it exhibited the same behavior.

An interesting data point that I forgot to mention before. Before I downloaded the latest packages, I had the Debugger type set to gdb/mi and it exhibited the behavior described in my previous posts. But, when I went back and changed the Debugger type to MinGW GDB, the GUI for the configuration window stopped working properly (could not set any of the fields and kept getting a null pointer error) but the debugger started working correctly. After downloading the updated packages, it went back to behaving like I described in my previous posts.

Is there any specific information that I could post that might help?

Thanks Again
Previous Topic:How to make "Windows" applications
Next Topic:debugging problems with breakpoint properties and hover
Goto Forum:
  


Current Time: Tue Jul 01 00:29:25 EDT 2025

Powered by FUDForum. Page generated in 0.27891 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top