How to start the debugger in stopped state?

What I’m looking for is the the effect of pressing “F10” in visual studio. I want to single-step my program in the debugger, right from the start.

What i tried was creating a script:

break _start 
run

(or main, instead of _start) and specified it in launch configurations as “run gdb script”. Doing so makes the whole UI unresponsive. The buttons don’t do anything, the windows (like “Frame Stack”) are empty, the gdb window seems broken: entering “status”, creates this respsonse:

(gdb) 45status
45^error,msg="Undefined command: \"status\". Try \"help\"."

(I did not type 45), only status. What’s going on here, how to use this?

The reason that the windows where empty was that the binary was compiled without the -g option, to include debug symbols.