GNU Project debugger for analyzing program execution, reverse engineering binaries, and debugging crashes.
gdb -q -ex "{command}" {binary} ๐ command โ ๐ binary โ gdb -q -ex "{command}" {binary} Sandbox: execFile · Timeout: 300s
reverse.debugging reverse.disassembly reverse.analysis debug.memory.inspect debug.register.inspect | Name | Type | Required | Default | Description | Aliases |
|---|---|---|---|---|---|
quiet | boolean | No | - | Suppress introductory banner and warnings | -q |
ex | string | No | - | Execute a single GDB command | -ex |
x | string | No | - | Execute GDB commands from file | -x |
pid | integer | No | - | Attach to a running process by PID | -p |
batch | boolean | No | - | Run in batch mode (no interactive shell) | -batch |
symbols | string | No | - | Read symbol table from file | -s, --symbols |
exec | string | No | - | Use specified file as the executable | --exec |
core | string | No | - | Use specified file as the core dump | --core |
cd | string | No | - | Change to directory before starting | --cd |
nx | boolean | No | - | Do not read .gdbinit file | -nx |
nh | boolean | No | - | Do not read .gdbearlyinit file | -nh |
tty | string | No | - | Set the terminal for GDB I/O | --tty |
args | boolean | No | - | pass remaining args to program | --args |
Inputs
file.binary Binary to debug
file.core Core dump file for post-mortem analysis
Outputs
debug.backtrace Stack backtrace
debug.disassembly Disassembled code
process_spawn Produces
debug.backtracedebug.disassemblyConsumes
file.binaryfile.core| Resource | Value |
|---|---|
| CPU | medium |
| Memory | 128 MB |
| Network | low |
| Disk I/O | low |
Attach to a running process
gdb -p 1234 Analyze a core dump
gdb /bin/ls core.dump -batch -ex bt Disassemble main function in batch mode
gdb -q -batch -ex "disassemble main" /bin/ls Run with commands from a file
gdb -x commands.gdb /bin/ls Inspect registers and memory
gdb -q -ex "info registers" -ex "x/16xw \$rsp" -batch /bin/ls GDB is the standard debugger for compiled Unix programs, supporting C, C++, Rust, Go, and many other languages. It enables instruction-level debugging, memory/register inspection, disassembly, and reverse engineering.
| Command | Description |
|---|---|
disassemble main |
Disassemble the main function |
info registers |
Show CPU register values |
x/16xw $rsp |
Examine 16 words on the stack |
bt |
Print backtrace |
break *0x400510 |
Set breakpoint at address |
ni |
Execute next instruction |
si |
Step into instruction |
gdb -q -batch -ex "file /bin/ls" -ex "disassemble main" -ex "info functions"