Conversation
Document a tmux-based workflow for driving persistent GDB sessions from non-interactive shells. Cover local binaries, remote targets, QEMU gdbstub connections, core dumps, command execution, output inspection, and session cleanup. Signed-off-by: Bin Meng <bin.meng@processmission.com>
|
@codex review this PR thoroughly |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e20c44df68
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| tmux kill-session -t gdb 2>/dev/null | ||
| tmux kill-session -t qemu 2>/dev/null |
There was a problem hiding this comment.
Use unique tmux session names for each debugging run
When a user already has a gdb or qemu tmux session, the fixed-name new-session commands fail, but the subsequent send-keys and unconditional cleanup still target those existing sessions. Following this workflow can therefore inject commands into and then destroy an unrelated debugging or QEMU session; generate per-run names and only kill sessions successfully created by this run.
Useful? React with 👍 / 👎.
| | Read GDB output | `tmux capture-pane -t gdb -p` | | ||
| | Read with scrollback | `tmux capture-pane -t gdb -p -S -50` | |
There was a problem hiding this comment.
Capture the complete output of long debugger commands
For commands producing more than one pane plus 50 history lines—such as a long backtrace or a noisy inferior run—capture-pane -p returns only the visible pane, while tmux's -S -50 start-line semantics include only 50 lines of preceding history. Earlier output can therefore be silently omitted, including the top frames that identify a crash; track the scrollback position before each command or capture all newly produced history instead of using a fixed 50-line window.
Useful? React with 👍 / 👎.
Summary
Testing