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

前端 未结 5 1637
故里飘歌
故里飘歌 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 06:04

    Use

    (gdb) show directories
    

    If you don't know where those directories are set, check your .gdbinit file to see if there are statements like

    directory /path/to/source
    

    See also this other Stack Overflow question about GDB.

提交回复
热议问题