Find the path of the source code for the executable being currently debugged in GDB

前端 未结 5 1644
故里飘歌
故里飘歌 2020-12-29 05:19

I can set a breakpoint in main and debug the code with the correct source code, but I don\'t know where GDB is taking the source code from.

The source code is not pr

5条回答
  •  太阳男子
    2020-12-29 05:52

    This information is kept in the binary in the DWARF2 format. So, in order to see the DWARF2 information, you can use the dwarfdump utility. Needed information is kept in the DW_AT_comp_dir field.

提交回复
热议问题