Supported on windows
Supported on linux
Supported on android
info source command
Dislays information about the current source file
Syntax
info source
Remarks
If you want to see the list of all source files rather than information about the current source file, use the info sources command.
Examples
Below is a sample output of the info source command:
(gdb) start
Temporary breakpoint 1 at 0x80486b6: file test.cpp, line 5.
Starting program: /home/bazis/test
Temporary breakpoint 1, main (argc=1, argv=0xbffff064) at test.cpp:5
5 std::cout << "Hello!" << std::endl;
(gdb) info source
Current source file is test.cpp
Compilation directory is /home/bazis
Located in /home/bazis/test.cpp
Contains 7 lines.
Source language is c++.
Compiled with DWARF 2 debugging format.
Does not include preprocessor macro info.
Temporary breakpoint 1 at 0x80486b6: file test.cpp, line 5.
Starting program: /home/bazis/test
Temporary breakpoint 1, main (argc=1, argv=0xbffff064) at test.cpp:5
5 std::cout << "Hello!" << std::endl;
(gdb) info source
Current source file is test.cpp
Compilation directory is /home/bazis
Located in /home/bazis/test.cpp
Contains 7 lines.
Source language is c++.
Compiled with DWARF 2 debugging format.
Does not include preprocessor macro info.
Compatibility with VisualGDB
You can execute the info source command under VisualGDB using the GDB Session window in Visual Studio.