Sunday, 8 March 2015

Eclipse debugging with input from console

The issue comes from Eclipse buffering the console inputs. One way to fix it is to force Eclipse to debug using a Windows/DOS native console.
The procedure is described in details here, but in brief :
  1. Create your Hello World C++ command line project, from the Eclipse menu File > New > C++ Project
  2. In your project folder, create a ".gdbinit" text file. It will contain your gdb debugger configuration
  3. Edit ".gdbinit", and add the following line (without quotes) : "set new-console on"
  4. In Eclipse, go to menu Run > "Debug Configurations", and select your application name in the left pane
  5. In the "debugger" tab, ensure the "GDB command file" now points to your « .gdbinit » file. Else, input the path to your ".gdbinit" configuration file
  6. Click « Apply » and « Debug ». You’re done ! A native DOS command line should be launched.

0 comments:

Post a Comment