Compile with -g option but “Single stepping until exit from function main, which has no line number information”

后端 未结 3 1208
终归单人心
终归单人心 2021-01-18 23:28

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         


        
3条回答
  •  离开以前
    2021-01-19 00:15

    Thank you for your answers. I found what is wrong. As jcm says my gcc is relatively new. I have update gdb to the last current version which is GNU gdb (GDB) 7.6. Now this works perfectly.

    By the way, with the version g++ (Ubuntu/Linaro 4.6.4-1ubuntu1~12.04) 4.6.4, gdb (Ubuntu/Linaro 7.4-2012.04-0ubuntu2.1) 7.4-2012.04 works perfectly.

    Thank you for all of you.

提交回复
热议问题