Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Program access to application stdio console in debug session
Program access to application stdio console in debug session [message #1415928] Thu, 04 September 2014 01:39 Go to next message
David Wootton is currently offline David WoottonFriend
Messages: 18
Registered: July 2009
Junior Member
I have a process that I've started as part of the startup sequence for the debugger. I want to connect the stdin, stdout and stderr streams for this process to the console view that the application started under gdb control so that my process can accept stdin input from this console and can write stdout and stderr to that console.

I've spent a couple days looking at CDT code trying to figure out how I can get access to the console, but I'm just not seeing a way to do this.

Is there a way for me to get access to the console, and if so, how do I approach this?

Thanks
Re: Program access to application stdio console in debug session [message #1420133 is a reply to message #1415928] Tue, 09 September 2014 14:49 Go to previous message
David Wootton is currently offline David WoottonFriend
Messages: 18
Registered: July 2009
Junior Member
I have gotten console I/O to the process object I created to sort of work by creating an IOConsole object, getting access to the console manager by calling ConsolePlugin.getDefault().getConsoleManager() and adding my console to the console manager. I have separate processing threads for stdin, stdout and stderr, but I am having problems with order of output where a printf in my application process does not display until after the read from stdin in my application process is satisfied even though the printf occurs first.

I've been trying to figure out how CDT handles this because the CDT console output is correct. I've looked for references to IOConsole, TextConsole and MessageConsole that might have something to do with running or debugging the application process, but I'm not finding anything. I found references to a TraceConsole but I don't think that's relevant.

I also found out that if I put fflush() calls in my application, then the console works correctly. So there's some interaction with how the I/O streams for the process are being managed.

Any suggestions what I should be looking for to help me figure this out?

Thanks

[Updated on: Tue, 09 September 2014 15:01]

Report message to a moderator

Previous Topic:Mars Kepler Juno, what's the difference?
Next Topic:[Feature] Generate constructor using fields - productive. Do you want it?
Goto Forum:
  


Current Time: Wed Oct 09 03:13:37 GMT 2024

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

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

Back to the top