Go to Project -> Build Options and check the first entry at the bottom panel (produce debugging symbols -g). This should do it for the current project.
If you want to always compile in debug mode you can make the -g default by going in Build -> Compiler Options -> Produce debugging symbols -g.