You’re using Eclipse to develop a C/C++ Windows command line application, and instead of debugging using the Eclipse integrated console you would like to use a native DOS/Windows console. Some reasons to do so are that the Eclipse integrated console doesn’t deal very well with some DOS console features (like cursor positioning), and it may buffer some inputs. Happily, it is possible to configure Eclipse to use a native console !
The following steps describe in details the procedure to follow. Else, you can download from here a sample “HelloWorld” Eclipse C++ project which is configured to use an external DOS console for debug.
- Create your Hello World C++ command line project, from the Eclipse menu File > New > C++ Project :
- In your project folder, create a “.gdbinit” text file. It will contain your gdb debugger configuration
- Edit “.gdbinit”, and add the line (without the quotes) : “set new-console on”
(or download the file from here)
- In Eclipse, go to menu Run > “Debug Configurations”, and select your application name in the left pane :
- In the “debugger” tab, ensure the “GDB command file” now points to your “.gdbinit” file. Else, input the path to your “.gdbinit” configuration file :
- Click “Apply” and “Debug”. You’re done ! A native DOS command line should be launched.