I have some trouble with gdb. This is my code in a single file named main.cpp
#include void myfunc(); int main(){ char msg[] = \"Hello
Try to use '-Og', too. Maybe that will help, because as @KevinDTimm wrote: compiler may optimize it.
Reference: