Instead you have to check your debug configuration :
Menu > Run > Debug Configuration > select your config
in Main (TAB) make sure that the correct Project is selected
in Debugger (TAB) make sure that stm32f4discovery.cfg (or stm32f407g_disc1.cfg) is selected as default script
if not you have to check your project target (project properties > C/C++ Build > Settings > Target (TAB))
Sorry I have answered without refreshing the browser, so I haven’t remarqued that your issue is solved.