Creating symbol table for gdb using cmake

后端 未结 3 1175
感动是毒
感动是毒 2020-12-23 13:41

Is there any way to create only symbol table using cmake for gdb ?

相关标签:
3条回答
  • 2020-12-23 14:09

    Add this line to the file CMakeLists.txt:

    set(CMAKE_BUILD_TYPE Debug)
    
    0 讨论(0)
  • 2020-12-23 14:19

    The usual way to produce debugging information for gdb is to pass -g to the gcc or g++ compiler (and also at linking time).

    Look into the Cmake FAQ for how to get a debuggable executable.

    0 讨论(0)
  • 2020-12-23 14:19

    compile in Release mode optimized but adding debug symbols, useful for profiling :

    cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo ...
    

    or compile with NO optimization and adding debug symbols :

    cmake -DCMAKE_BUILD_TYPE=Debug ...
    
    0 讨论(0)
提交回复
热议问题