Requirement to Run/Debug in a Windows Console [message #524285] |
Wed, 31 March 2010 08:22  |
Eclipse User |
|
|
|
I've seen this question asked by others but not directly answered, and I've searched the forums, Google, and Bing until I'm blue in the face.
A year or so ago I performed an "emergency" port of an old DOS application, that runs a crucial part of our business, to a Windows console application. I used CDT+MinGW and had great success. The application used direct framebuffer access to draw/update the screen, and managed cursor positioning, as was common in the day. I replaced those direct screen/cursor DOS calls with Win32 API Console functions that updated the screen/cursor in the same fashion.
Now I'm revisiting this code to do some tweaks (and yes we intend to rewrite as a GUI at some point, but priorities right now demand we keep this one running), but I'm having an issue with debugging. I just *know* when I initially did this conversion, that I used to debug this code in CDT while it ran in an external console (cmd.exe). It isn't possible to do so within the Eclipse console because of the full screen framebuffer/cursor manipulation required.
Thing is, I've since updated to Windows 7 Pro 64-bit and reinstalled Eclipse 3.5+CDT 6 with the latest TDM build of MinGW. Opening the same project, I cannot for the life of me get it to launch/debug in a Windows console -- it runs "invisible", apparently grabbed by the Eclipse console, and I see nothing since the app doesn't use stdin/out IO. I must have had this working before, as I distinctly remember debugging within CDT and it would have been impossible to do so with the Eclipse console given the nature of the app. Why won't the same project work the same now? I'd prefer to debug within CDT obviously, as opposed to running gdb directly from the console.
I've tried all sorts of Debug Launch configuration options with no luck. I'll probably feel stupid that it's something obvious, but at this point I'm feeling pretty stupid anyway, so all guidance is appreciated.
|
|
|
|
|
Re: Requirement to Run/Debug in a Windows Console [message #529397 is a reply to message #528780] |
Sat, 24 April 2010 13:07   |
Eclipse User |
|
|
|
Marc-Andre,
Thanks, this seems to have done the trick with a basic Hello World app I whipped together at home today. Next week at work I'll try with the app I posted about.
But from what you're saying, I take it this has never been possible before? Man, I must really be losing my mind then, because I distinctly remember stepping through this code with CDT/GDB in the past, but that would have been impossible without running in the cmd.exe window. Maybe I attached to the running process, but that doesn't seem right either -- this was the first MinGW/CDT work I had done, and I remember launching in debug and stopping at main upon entry, which wouldn't be possible by running then attaching.
Anyway, I agree this is critical functionality. If it's never been there, then it needs to be or else MinGW/CDT will be difficult to use as an IDE for any but the most basic of console development. Hopefully the release of 3.6+CDT7 will fully address this issue.
|
|
|
|
|
|
|
|
Re: Requirement to Run/Debug in a Windows Console [message #529991 is a reply to message #529989] |
Tue, 27 April 2010 19:30   |
Eclipse User |
|
|
|
Adrian wrote on Tue, 27 April 2010 19:06 |
Now when I debug, the console window appears but it doesn't step through the code (I've setup 2 break points in the main).
|
You're nearly there 
This is probably a debug info problem. EDC only supports dwarf2 debug info, I think MinGW generates stabs by default so you have to specify that you want dwarf2 in the compiler arguments. I assume you have a Managed project (i.e. you don't write Makefiles yourself). To add the argument, open your project properties, C/C++ Build, Settings, Tool Settings (tab), under GCC C++ compiler go to Debugging. In Other debugging flags, add -gdwarf-2
There is a bug opened about this:
Debugger should prompt when main executable has no recognizable debug info
https://bugs.eclipse.org/bugs/show_bug.cgi?id=295387
|
|
|
|
Powered by
FUDForum. Page generated in 0.11812 seconds