Eclipse CDT debug error

If you get the error

A syntax error in expression, near `-console'.
mi_cmd_env_cd: Usage DIRECTORY

when trying to launch the debugger from Eclipse CDT, change your project and or path to not have any spaces in it. Apparently the debug launch code isn’t smart enough to put quotes around paths or escape spaces.

(On Ubuntu Gusty Gibbon)