I want to enable integrated debugging with gdb for my project in Eclipse CDT. The problem is I can't run the debugger with just a simple command like
run.sh could handle command line parameters. Add a parameter to it, e.g.
--debug, and have it invoke GDB after it has set up whatever environment variables are required, e.g. replace
export FOO=... ... other setup ... exec /path/to/binary $ARGS
... setup ... exec $GDB /path/to/binary $ARGS
$GDB is empty if
--debug was not on command line, or is set to
gdb --args if it was.
Now set up Eclipse to invoke
run.sh --debug when debugging, and you are done.