GDB
$ gdb Foundation Med Riskgdb is the standard GNU source-level debugger for compiled binaries and core dumps. While interactive by default, agents can extract backtraces and registers safely without hanging using gdb --batch -ex "bt" or drive it programmatically via the Machine Interface (--interpreter=mi3).
brew install gdb Low-level local process and core-dump debugger; requires direct OS ptrace/binary access.
Agent-Readiness Checklist
Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.
FCRS-1.0 6-Dimension Breakdown
Interactive REPL by default (hangs non-TTY agents if --batch is forgotten); provides --batch -ex scripting and GDB/MI (--interpreter=mi3) rather than JSON.
--batch -exensures non-interactive exit--interpreter=mi3provides structured MI line protocol, not JSON
Inspecting core dumps is read-only, while attaching to live processes (-p) pauses execution and can modify memory/registers; .gdbinit auto-loading poses code-execution risk if enabled.
- Live process attachment pauses target processes
- Use
-nxto skip untrusted.gdbinitfiles
Preinstalled/standard on Linux and available via MinGW on Windows, but macOS requires manual code-signing certificates and lacks Apple Silicon native support.
- Seamless on Linux; significant macOS setup friction
Unmatched support for Linux core dumps, embedded targets, and multi-language symbols, though verbose without Python pretty-printers.
- Standard Linux crash/core-dump diagnostics
Maintained by the GNU Project (sourceware.org/gdb) with regular major releases under GPL-3.0-or-later.
- Official GNU Project debugger
Massive official manual exists, though scripting -ex sequences and MI syntax are complex.
- Comprehensive manual at sourceware.org/gdb
Security, Auth & Guardrails
No credentials required; inspects local ELF/Mach-O/PE executables and core dumps.
GPL-3.0-or-later GNU Project free software; free.
# GDB Agent Rules - Always pass `--batch -q` (and `-ex ...`) so `gdb` exits cleanly instead of entering the interactive `(gdb)` REPL. - Never use `gdb` interactively without a batch script or `--interpreter=mi3`. - On macOS, prefer `lldb` unless `gdb` is code-signed for taskgated debugging.
Agent-Ready Command Recipes
Safe Read-Only Queries
gdb --batch -q -ex "thread apply all bt full" ./build/app core.dump
Loads the binary and core dump, prints full stack traces for all threads, and exits immediately without prompting.
gdb --batch -q -ex "run" -ex "bt" --args ./build/app --test
Executes the binary non-interactively and prints the backtrace on crash before exiting.
Strengths for Agents
- +
gdb --batch -q -ex "thread apply all bt"extracts crash backtraces cleanly in one shot. - +
--interpreter=mi3offers deterministic machine-readable event framing.
Caveats & Pitfalls
- ! Enters a blocking
(gdb)prompt unless--batchis passed. - ! Outputs GDB/MI or plain text rather than JSON, and macOS requires code-signing setup (prefer
lldbon macOS).