Skip to content

feat: add interactive GDB debugging skill#4

Open
lbmeng wants to merge 1 commit into
mainfrom
gdb
Open

feat: add interactive GDB debugging skill#4
lbmeng wants to merge 1 commit into
mainfrom
gdb

Conversation

@lbmeng

@lbmeng lbmeng commented Jul 20, 2026

Copy link
Copy Markdown
Member

Summary

  • add an interactive GDB debugging skill based on persistent tmux sessions
  • document workflows for local binaries, QEMU gdbstub, remote targets, and core dumps
  • include installation guidance, command examples, critical rules, and cleanup practices

Testing

  • Not run (documentation-only change)

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>
@kailiu42

kailiu42 commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

LGTM.

Edit: this just came to my mind: maybe we should follow the same SPDX headers, just as @zevorn does in #1.

@zevorn zevorn left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@zevorn

zevorn commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

@codex review this PR thoroughly

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +111 to +112
tmux kill-session -t gdb 2>/dev/null
tmux kill-session -t qemu 2>/dev/null

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Comment on lines +26 to +27
| Read GDB output | `tmux capture-pane -t gdb -p` |
| Read with scrollback | `tmux capture-pane -t gdb -p -S -50` |

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants