🌐
GNU Project
sourceware.org β€Ί gdb
GDB: The GNU Project Debugger
GDB, the GNU Project debugger, allows you to see what is going on `inside' another program while it executes -- or what another program was doing at the moment it crashed.
Current
However, if you would like to try a version of gdb drawn from the most recent release branch, they are also available. ... If you already have a read-only copy of git on hand then there is no need to re-check out a source tree. Instead, you can edit your .git/config to change the remote to ...
Download
for more info) Sources to the current development version are also available using HTTPS, git and WWW. See current. We've got GDB releases going back to the 2.4/2.8 timeframe in 1988.
🌐
GNU
ftp.gnu.org β€Ί gnu β€Ί gdb
Index of /gnu/gdb
Index of /gnu/gdb Β· Apache/2.4.52 (Trisquel_GNU/Linux) Server at ftp.gnu.org Port 443
Discussions

debugging - GDB source path - Stack Overflow
How to make gdb to use different directory to look for source files. For example my source file during the compilation was in directory: /home/foo/bar.c Next, I moved it into directory: /tmp/debug/ More on stackoverflow.com
🌐 stackoverflow.com
linux - How to open a source file in GDB - Stack Overflow
I use GDB to attach to a running process and catch a breakpoint. I execute the following commands sequence: $ gdb -tui (gdb) attach PID And now I have the GUI TUI view open without any source More on stackoverflow.com
🌐 stackoverflow.com
GDB "no source available"
You tried to step inside printf() (the clue is where it says "at printf.c: 28"). It's complaining that it doesn't have the source code for printf itself. Probably you want "next" instead of "step" to run printf completely and break after the printf instead of trying to break inside printf. (gdb) help step Step program until it reaches a different source line. Usage: step [N] Argument N means step N times (or till program stops for another reason). (gdb) help next Step program, proceeding through subroutine calls. Usage: next [N] Unlike "step", if the current source line calls a subroutine, this command does not enter the subroutine, but instead steps over the call, in effect treating it as a single source line. Since it's an assembly class, it's possible you're meant to debug printf assembly code. If that is the case, try "layout next" or "layout asm". This will show you an assembly language view. (gdb) help layout Change the layout of windows. Usage: layout prev | next | LAYOUT-NAME Layout names are: src : Displays source and command windows. asm : Displays disassembly and command windows. split : Displays source, disassembly and command windows. regs : Displays register window. If existing layout is source/command or assembly/command, the register window is displayed. If the source/assembly/command (split) is displayed, the register window is displayed with the window that has current logical focus. More on reddit.com
🌐 r/C_Programming
1
1
April 5, 2024
How to include files in gdb ?
That's the kind of question you want to ask ChatGPT. It'll be more patient with you than Reddit. More on reddit.com
🌐 r/embedded
10
0
March 28, 2023
🌐
GitHub
github.com β€Ί bminor β€Ί binutils-gdb
GitHub - bminor/binutils-gdb: Unofficial mirror of sourceware binutils-gdb repository. Updated daily.
Unofficial mirror of sourceware binutils-gdb repository. Updated daily. - bminor/binutils-gdb
Starred by 654 users
Forked by 643 users
Languages Β  C 45.2% | Makefile 24.3% | Assembly 14.6% | C++ 5.1% | DTrace 4.4% | Roff 1.1%
🌐
Desy
www-zeuthen.desy.de β€Ί dv β€Ί documentation β€Ί unixguide β€Ί infohtml β€Ί gdb β€Ί Source-Path.html
Source Path - Debugging with GDB
Executable programs sometimes do ... could be moved between the compilation and your debugging session. gdb has a list of directories to search for source files; this is called the source path....
🌐
Apple Developer
developer.apple.com β€Ί library β€Ί archive β€Ί documentation β€Ί DeveloperTools β€Ί gdb β€Ί gdb β€Ί gdb_8.html
Debugging with gdb - Examining Source Files
GDB can print parts of your program's source, since the debugging information recorded in the program tells GDB what source files were used to build it. When your program stops, GDB spontaneously prints the line where it stopped. Likewise, when you select a stack frame (see section Selecting ...
🌐
Opensource.com
opensource.com β€Ί article β€Ί 21 β€Ί 3 β€Ί debug-code-gdb
Learn to debug code with the GNU Debugger | Opensource.com
March 4, 2021 - The GNU Debugger, more commonly known by its command, gdb, is an interactive console to help you step through source code, analyze what gets executed, and essentially reverse-engineer what's going wrong in a buggy application.
Find elsewhere
🌐
Red Hat
docs.redhat.com β€Ί en β€Ί documentation β€Ί red_hat_developer_toolset β€Ί 12 β€Ί html β€Ί user_guide β€Ί chap-gdb
Chapter 8. GNU Debugger (GDB) | User Guide | Red Hat Developer Toolset | 12 | Red Hat Documentation
Once you start the execution, gdb displays the lines that are surrounding the line on which the execution stops, typically when you set a breakpoint. You can also display the code that is surrounding a particular line: ... Copy to Clipboard Copied! ... Copy to Clipboard Copied! ... Copy to Clipboard Copied! ... Example 8.4. Listing the Source ...
🌐
Dzyoba
alex.dzyoba.com β€Ί blog β€Ί gdb-source-path
How to point GDB to your sources | There is no magic here
April 30, 2017 - To find the sources GDB parses .debug_info section to find all DIEs with tag DW_TAG_compile_unit. The DIE with this tag has 2 main attributes DW_AT_comp_dir (compilation directory) and DW_AT_name - path to the source file.
🌐
MIT
web.mit.edu β€Ί gnu β€Ί doc β€Ί html β€Ί gdb_9.html
Debugging with GDB - Examining Source Files
Executable programs sometimes do ... could be moved between the compilation and your debugging session. GDB has a list of directories to search for source files; this is called the source path....
🌐
Chang Ge
www-users.cse.umn.edu β€Ί ~kauffman β€Ί tutorials β€Ί gdb
CSCI 2021 Quick Guide to gdb: The GNU Debugger
Without debug symbols, gdb does not know what source to display. Since binary files correspond to assembly, one can always get the debugger to show assembly code in TUI with layout asm.

source-level debugger

GNU_gdb_12.1_screenshot.png
The GNU Debugger (GDB) is a portable debugger that runs on many Unix-like systems and works for many programming languages, including Ada, Assembly, C, C++, D, Fortran, Haskell, Go, Objective-C, OpenCL C, … Wikipedia
Factsheet
Developer GNU Project
Initial release 1986; 39 years ago (1986)
Stable release 16.3
/ 20 April 2025
Factsheet
Developer GNU Project
Initial release 1986; 39 years ago (1986)
Stable release 16.3
/ 20 April 2025
🌐
Wikipedia
en.wikipedia.org β€Ί wiki β€Ί GNU_Debugger
GNU Debugger - Wikipedia
1 month ago - Command definitions placed in the local file .gdbinit are automatically loaded at the beginning of the gdb session. Command definitions can also be saved in ordinary files and loaded using the source command.
🌐
VisualGDB
visualgdb.com β€Ί gdbreference β€Ί commands β€Ί info_source
GDB Command Reference - info source command
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.
🌐
Reddit
reddit.com β€Ί r/c_programming β€Ί gdb "no source available"
r/C_Programming on Reddit: GDB "no source available"
April 5, 2024 -

Hey, I'm a Comp Eng student and I've been recently introduced to GDB in my assembly class, and while I think as a tool it has very good practical uses, I seem to be unable to use it properly. My teacher gives us weekly assignments that are based on tests, and for each test passed correctly you score 1 point. Now, when trying to debug with GDB as soon as I get to the "printf("Test"....)" that prints my program's result and compares it to the correct result, the print also appears in the GDB debugger command like (aka where I type), therefore bugging it out and subsequently turning the code screen to "No Source Available". Any help?

https://imgur.com/a/110wc7S this is before the printf
https://imgur.com/a/CEOsL67 this is after the printf