Hi,
I also faced this problem while ago when implementing it, what did the
trick for me was to execute 'set new-console on' after starting gdb
but before executing the target
so the sequence should be something like this:
gdb<executable>
set new-console on
.. other initialization commands ...
run<args>
By running this command, gdb will create a new console for the debugee output.
i.e. all the redirected IO that you capture in your frontend will
always be gdb's output.
Note: this command does not work under Linux / Mac. To achieve this on
*NIX, you need to pass
--tty=/dev/pts/XX to gdb for achieving the same effect.
Also, here is a complete reference for codelite's GDB MI implementation:
http://codelite.svn.sourceforge.net/viewvc/codelite/trunk/Debugger/debuggergdb.cpp?revision=5439&view=markup
Look at around line 1025 in function : DoInitializeGdb()