GDB

The GNU debugger.

KaliParrotLinuxpassive

pkg: gdb

GDB dynamically debugs programs — breakpoints, memory/register inspection and execution control — essential for exploit dev (esp. with GEF/pwndbg).

Syntax

gdb {binary} → break / run / info

Example

gdb ./binary -ex "break main" -ex run

Loads the binary, sets a breakpoint at main and starts execution.

Options & flags

What each switch does. Toggle them in the builder below to assemble a command.

-ex <break main>Run a GDB command at start (repeatable).
-qQuiet (no banner).
-p <1234>Attach to a running PID.
--args <./bin arg>Program plus its arguments.

Command builder

Tick options (and fill any values) to build a ready-to-copy command.

gdb

Usage examples

gdb ./binary -ex "break main" -ex run

Break at main and run.

gdb -p 1234

Attach to a running process.

Advantages
  • Standard dynamic debugger
  • Scriptable; great with GEF/pwndbg
  • Deep runtime visibility
Disadvantages
  • Bare GDB UX is unfriendly
  • CLI learning curve
  • Source-level needs symbols
Tags
#debugger#exploit-dev

Official docs: GDB

Related commands

Frequently asked questions

What is GDB used for?
GDB dynamically debugs programs — breakpoints, memory/register inspection and execution control — essential for exploit dev (esp. with GEF/pwndbg).
What is an example GDB command?
A common example is: gdb ./binary -ex "break main" -ex run — Loads the binary, sets a breakpoint at main and starts execution.
Is GDB part of Kali Linux?
Yes. GDB ships with Kali Linux (and Parrot OS). If missing, install it with: sudo apt install gdb.
What category of security tool is GDB?
GDB is a Reverse Engineering tool with a passive-risk profile when run against a live target.

Try recon tools live

Run real scans against a domain you control, stage by stage.

Open the lab →