GCC debugger stack trace displays wrong file name and line number

后端 未结 11 1930
说谎
说谎 2021-01-21 00:22

I am trying to port a fairly large C++ project to using g++ 4.0 on Mac OS X. My project compiles without errors, but I can\'t get GDB to work properly. When I look at the stack

11条回答
  •  一生所求
    2021-01-21 01:01

    Are you compiling with optimization on? I've found that O2 or higher messes with the symbols quite a bit, making gdb and core files pretty much useless.

    Also, be sure you are compiling with the -g option.

提交回复
热议问题