GDB
sourceware.org
What it is
GDB is a free debugger for inspecting a program as it runs or after it crashes. It can launch programs, stop execution under specified conditions, examine the stopped state, and change program state for experimentation. A target can run on the same machine, remotely, or in a simulator. GDB runs on popular UNIX variants, Microsoft Windows, and macOS, and supports languages including C, C++, Rust, Go, Ada, Fortran, Assembly, and others. Debugging options include conditional and exception breakpoints, core dump debugging, and record-and-replay with forward and reverse execution on supported platforms. For remote debugging, gdbserver connects a program to GDB. The console interpreter and GDB/MI are available, while Python extensions and the Debugger Adapter Protocol require Python support at build time. GDB is part of the GNU Project and is free software under the GNU General Public License, which allows copying, adaptation, and redistribution with source access. Official releases are available from GNU and Sourceware, with signature verification through the GNU keyring. Version 18.1 was released on September 25, 2026.
Spec sheet
- Purpose
- GDB lets users inspect what another program is doing while it executes or after it crashes.Read 30 Sep 2026 · sourceware.org
- Support
- The project provides mailing lists for announcements, discussion, patches, bug reports, and testing.Read 30 Sep 2026 · sourceware.org
- License
- GDB is free software protected by the GNU General Public License, which permits copying, adapting, and redistributing copies with source access.Read 30 Sep 2026 · sourceware.org
- Core debugging
- GDB can start programs, stop them under specified conditions, examine stopped execution, and change program state for experimentation.Read 30 Sep 2026 · sourceware.org
- Debugger protocols
- GDB supports the console interpreter, GDB/MI, and the Debugger Adapter Protocol when built with Python support.Read 30 Sep 2026 · sourceware.org
- Distribution
- Official releases are downloadable from GNU's HTTPS server and Sourceware's releases site, with signature verification through the GNU keyring.Read 30 Sep 2026 · sourceware.org
- Languages
- GDB supports Ada, Assembly, C, C++, D, Fortran, Go, Objective-C, OpenCL, Modula-2, Pascal, and Rust.Read 30 Sep 2026 · sourceware.org
- Latest release
- GDB version 18.1 was released on September 25, 2026.Read 30 Sep 2026 · sourceware.org
- Operating systems
- GDB runs on popular UNIX and Microsoft Windows variants and on macOS.Read 30 Sep 2026 · sourceware.org
- Project identity
- GDB is a Free Software project that is part of the GNU Project.Read 30 Sep 2026 · sourceware.org
- Python extension
- GDB can be extended with Python when configured with --with-python.Read 30 Sep 2026 · sourceware.org
- Record and replay
- On supported platforms, GDB records process execution and replays it with forward and reverse execution commands.Read 30 Sep 2026 · sourceware.org
- Remote debugging
- The gdbserver control program connects programs to a remote GDB through target remote or target extended-remote.Read 30 Sep 2026 · sourceware.org
- Security behavior
- On targets that support it, virtual address space randomization protects programs against certain security attacks.Read 30 Sep 2026 · sourceware.org
- Targets
- Programs can run on the same machine, another machine remotely, or a simulator.Read 30 Sep 2026 · sourceware.org
Plans and prices
Strong points and limits
Strong points
- Conditional and exception breakpoints
- Record-and-replay on supported platforms
- Remote debugging through gdbserver
- Free software with source access
Limits
- Python extensions require a Python-enabled build
- Record-and-replay is limited to supported platforms
- Debugger Adapter Protocol requires Python support
Who it suits
GDB suits developers who need to inspect and control programs running locally, remotely, or in a simulator. Its language support covers a broad set of compiled and other programming languages.
GDB in depth
Read the full write-up
Overview
GDB is a debugger for examining program execution and investigating crashes. It suits developers who need to control programs across a broad range of languages and target environments. Its breadth and free, source-available license make it a strong general-purpose choice, though some integrations and replay capabilities depend on build configuration or platform support.
Developers can launch a program, pause it under chosen conditions, inspect its state, and alter that state to explore behavior. That makes GDB useful both for following a live failure and for probing how a program responds to a different state. Core-dump debugging also supports investigation after a crash.
GDB is part of the GNU Project and is distributed under the GNU General Public License, which allows copying, adaptation, and redistribution with source access. Official releases are available from GNU and Sourceware, with signature verification through the GNU keyring.
Key features
Breakpoints and inspection
Conditional and exception breakpoints let developers stop at relevant situations rather than interrupting execution indiscriminately. Once stopped, the program can be examined or modified. These controls are useful for narrowing down state-dependent bugs, while core-dump support extends investigation beyond a live session.
Remote targets and replay
GDB can target programs on the local machine, a remote machine, or a simulator. For remote debugging, gdbserver connects the target program to GDB using target remote or target extended-remote. This makes GDB suitable when the program runs somewhere other than the developer's workstation.
On supported platforms, GDB can record execution and replay it with forward and reverse commands. Rewinding through a failure can help identify how execution reached a problematic state, but this capability is conditional on platform support.
Languages and extensibility
GDB supports Ada, Assembly, C, C++, D, Fortran, Go, Objective-C, OpenCL, Modula-2, Pascal, and Rust. Python can extend GDB when it is configured with --with-python. The console interpreter and GDB/MI are supported; the Debugger Adapter Protocol is available when the build has Python support. Teams relying on Python-based integrations should confirm that their chosen build includes that configuration.
Pricing
GDB costs nothing. The free plan, GDB, is covered by the GNU General Public License and includes source code. There is no paid tier to weigh against a reduced free version, making it a straightforward option for individual developers and teams able to work with the license's terms.
Platforms
GDB runs on UNIX variants, Microsoft Windows, and macOS, and supports native, remote, and simulator targets. Platform support does not imply identical capabilities everywhere: record-and-replay is limited to supported platforms, and the Debugger Adapter Protocol requires a Python-enabled build.
Who it's for
GDB is a good fit for developers who need a free debugger spanning multiple languages and target types, particularly those investigating crashes, remote programs, or execution paths that benefit from replay. Its command-oriented interfaces and configuration-dependent extensions are less compelling for readers who need a particular integration to work without checking how GDB was built.
Pros and cons
Pros: Broad language support, conditional and exception breakpoints, and core-dump debugging cover varied investigation needs.
Pros: Local, remote, and simulator targets make it useful across different execution environments.
Pros: Free software with source access can be copied, adapted, and redistributed under the GNU General Public License.
Cons: Record-and-replay is only available on supported platforms, so it cannot be assumed for every target.
Cons: Python-based extensions and the Debugger Adapter Protocol require a suitably configured build.
Alternatives
LLDB is another free debugger for readers whose platform needs include Android or iOS alongside Linux, macOS, and Windows.
PonyDebugger is a free option for readers specifically seeking an iOS client and gateway server across iOS, macOS, self-hosted, and web environments.
Black Magic Debug is the more targeted choice for embedded microcontroller debugging with JTAG/SWD, provided you have compatible probe hardware and a suitable toolchain.
Perl Debugger is a free alternative included with Perl; it requires the program to compile correctly before debugging.
pyOCD is a free, Apache 2.0-licensed alternative for readers whose requirements fit its listed API, desktop, and self-hosted platforms.
FlowStorm is a free, open-source alternative for readers who want software described as free as in speech and usable without payment.
IDA Pro is worth considering for readers focused on x86-32 or x86-64 disassembly: IDA Free includes two cloud-based decompilers, while IDA Pro Essential costs 1099.00 USD.
Erlang Debugger is another free option for readers considering a debugger on Linux, macOS, or Windows.
Browse more options in Debuggers.
Verdict
Choose GDB if you need a capable, free debugger for supported languages across local, remote, or simulator targets, with conditional stops and post-crash investigation. Its chief advantage is that breadth without a price barrier; look elsewhere if you depend on replay or Python-based integrations that your target or build cannot support.
Verdict
GDB covers core debugging, remote targets, and time-travel debugging where supported. Its Python-dependent integrations require a suitably configured build.
Where Specifiction places it
- Debuggers#9 of 278.0
- Debugging Software#16 of 308.0