Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

People also ask

What is path source?

The source path specifies the directories where the C and C++ source files are located. If you are debugging a user-mode process on the computer where the executable file was built, and if the source files are still in their original location, the debugger can automatically locate the source files.

Where is Gdbinit?

". gdbinit" is a file you can drop in your home directory that gdb will parse when gdb launches, either from the command line or from within Xcode. Thanks now I have the . gdbinit file in my home directory.


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 present in CWD (current working directory).

How do I find from which location GDB is taking the code?