|
|
|
|
Re: Eclipse CDT and input/output redirection with GDB [message #536021 is a reply to message #521251] |
Wed, 26 May 2010 16:40 |
James Messages: 3 Registered: May 2010 |
Junior Member |
|
|
I also had this same problem, and this is what I did to solve it:
Launch the application in a separate window. I put this code segment in the main to stop execution until I can attach the debugger. Mostly my bugs are after the first input prompt, so I don't need this anymore.
int debug = 1;
int main() {
while (debug == 1) sleep(1);
...
}
Now, in Eclipse, create a "C/C++ Attach to Application" configuration. Fill out all the information (go through all the tabs), then hit apply, then Debug.
A window will pop up and you select the name of the running application to attach to. There is a bug in the current Galileo CDT in that it takes a long time to launch the debugger, but it will start. For me it sits at 36% complete in the lower right hand corner of the screen for a while. Then the prospective will switch to debug and your application is paused. Simply modify the "debug" variable from above to be zero (or whatever, not 1) and continue the app (the vcr play button at the top). Now the app will continue on to your bugs and breakpoints within the debugger!
For future launches of the debugger, you will have to select the specific debug configuration that you created, because the default always the regular terminal debug.
Cheers,
James.
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04961 seconds