Home

GDB

GDB, the GNU Debugger, is a portable debugger for many programming languages and targets. It is part of the GNU project and distributed under the GNU General Public License. GDB can debug programs locally or remotely, by launching a program under its control or by attaching to a running process, across a wide range of architectures and operating systems.

GDB provides breakpoints, including conditional and watchpoints, as well as stepping commands such as step, next,

Language support covers C and C++, Fortran, and other languages; Go, D, Ada, Objective-C, Pascal, and Rust

Typical workflow: compile with debugging symbols (-g), avoid heavy optimization if precise debugging is needed, start

and
finish.
It
can
continue
execution,
handle
signals,
and
inspect
or
modify
program
state.
It
offers
examination
of
memory
and
registers,
backtraces
and
stack
frames,
and
disassembly.
It
supports
expression
evaluation
and
printing
of
complex
values,
and
it
can
be
extended
with
Python
scripting
for
automation
and
custom
commands.
A
text
user
interface
is
available,
and
many
IDEs
provide
graphical
front-ends
that
use
GDB
as
the
backend.
have
varying
levels
of
support.
Debug
information
is
typically
provided
by
DWARF.
For
remote
debugging,
gdbserver
can
run
on
the
target
and
GDB
connects
from
the
host.
GDB
with
the
executable,
set
breakpoints,
run,
and
inspect
variables,
memory,
and
call
stacks.
GDB
is
widely
used
in
the
GNU
toolchain
and
interoperates
with
various
development
environments,
making
it
a
core
tool
for
diagnosing
and
understanding
program
behavior
on
multiple
platforms.