GCC doesn't produce line number information even with -g option

后端 未结 2 600
孤独总比滥情好
孤独总比滥情好 2021-01-02 18:27

I have built and installed GCC 4.8.1 from source:

$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPP         


        
相关标签:
2条回答
  • 2021-01-02 18:32

    Your gdb is too old -- you need a more recent gdb (I use 7.6) to understand the debugging info generated by gcc 4.8.1

    0 讨论(0)
  • 2021-01-02 18:32

    Usually GCC uses dwarf as its main debugging file format, you need to enable dwarf support when building gcc with the flag --with-dwarf2.

    While building your compiled object you can use -ggdb instead of -g which is a more specific solution but just for gdb.

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