gdb is jumping over lines

前端 未结 1 393
既然无缘
既然无缘 2020-12-02 02:32

i have some problems on understanding gdb.

i have a main function, i wrote this main function on myself.

Some lines in this main, call some functions in a li

相关标签:
1条回答
  • 2020-12-02 02:54

    The library you are stepping into has been built with optimization and debug symbols (most likely -g -O2, which is the default for Linux builds).

    Debugging optimized code is somewhat hard, as control flow optimization causes the code to "jump around", some variables become "<optimized out>", etc.

    You can rebuild the library with CXXFLAGS = -g -O0, or you can learn to debug with optimization on.

    The latter is a very useful skill, as many times your program will only crash in optimized mode, and you'll have to debug it in that mode anyway.

    0 讨论(0)
提交回复
热议问题