interactive-gdb-debugging
Installation
SKILL.md
Interactive GDB Debugging via tmux
Overview
Use tmux to drive GDB interactively from a non-interactive shell. Keep GDB in a
detached terminal, send commands with send-keys, and read each result with
capture-pane. For this adaptive workflow, do not use -batch, -ex, piped
input, or pexpect.
Quick Reference
| Operation | Command |
|---|---|
| Start GDB in tmux | tmux new-session -d -P -F '#{pane_id}' -s "$GDB_SESSION" 'gdb [args]' |
| Send GDB command | tmux send-keys -t "$GDB_PANE" 'command' C-m |
| Read complete retained output | tmux capture-pane -p -S - -t "$GDB_PANE" |
| Log output beyond scrollback | tmux pipe-pane -O -t "$GDB_PANE" "$PIPE_COMMAND" |
| Kill the created session | tmux kill-session -t "=$GDB_SESSION" |