How to debug using gdb?

后端 未结 5 1570
悲哀的现实
悲哀的现实 2020-11-22 01:16

I am trying to add a breakpoint in my program using

b {line number}

but I am always getting an error that says:

No symbol t         


        
5条回答
  •  春和景丽
    2020-11-22 02:03

    Start gdb with the executable as a parameter, so that it knows which program you want to debug:

    gdb ./myprogram
    

    Then you should be able to set breakpoints. For example:

    b myfile.cpp:25
    b some_function
    

提交回复
热议问题