Skip to content
gdb-chat logo

Breenix GDB Chat

gdb-chat

Conversational GDB debugging for Breenix kernel. Use for interactive debugging sessions - set breakpoints, inspect registers, examine memory, step through code, investigate crashes.

SKILL.md

Full skill instructions

Breenix GDB Chat

Conversational GDB debugging interface for Breenix kernel development.

When to Use This Skill

Use this skill when you need interactive, stateful GDB debugging:

  • Investigating crashes, page faults, or exceptions
  • Stepping through syscall execution
  • Examining register state at specific points
  • Setting breakpoints and watchpoints
  • Analyzing memory contents
  • Tracing context switches

Quick Reference

# Start a debug session
breenix-gdb-chat/​scripts/​start_session.py

# Execute GDB commands
breenix-gdb-chat/​scripts/​gdb_cmd.py --session SESSION_ID --command "info registers"
breenix-gdb-chat/​scripts/​gdb_cmd.py --session SESSION_ID -c "break main" -c "continue"

# Stop session
breenix-gdb-chat/​scripts/​stop_session.py --session SESSION_ID

# List active sessions
breenix-gdb-chat/​scripts/​list_sessions.py

Workflow Example

Investigating a Page Fault

# 1. Start session
$ breenix-gdb-chat/​scripts/​start_session.py
{"session_id": "gdb_20251204_151030", "status": "connected"}

# 2. Set breakpoint
$ breenix-gdb-chat/​scripts/​gdb_cmd.py --session gdb_20251204_151030 \
    --command "break page_fault_handler"
{"success": true, "output": "Breakpoint 1 at 0xffffffff80003450"}

# 3. Continue to breakpoint
$ breenix-gdb-chat/​scripts/​gdb_cmd.py --session gdb_20251204_151030 \
    --command "continue"
{"success": true, "output": "Breakpoint 1, page_fault_handler()"}

# 4. Check faulting address (CR2)
$ breenix-gdb-chat/​scripts/​gdb_cmd.py --session gdb_20251204_151030 \
    --command "print/​x \$cr2"
{"success": true, "output": "0x0000000000000008"}

# 5. Get backtrace
$ breenix-gdb-chat/​scripts/​gdb_cmd.py --session gdb_20251204_151030 \
    --command "backtrace"
{"success": true, "output": [{"function": "page_fault_handler", ...}]}

# 6. Check local variables
$ breenix-gdb-chat/​scripts/​gdb_cmd.py --session gdb_20251204_151030 \
    -c "frame 1" -c "info locals"

# 7. Stop session
$ breenix-gdb-chat/​scripts/​stop_session.py --session gdb_20251204_151030

Available Commands

Execution Control

CommandDescription
continue / cContinue execution
step / sStep one source line
stepi / siStep one instruction
next / nStep over function calls
nexti / niStep over one instruction
finishRun until function returns

Breakpoints

CommandDescription
break LOCATIONSet breakpoint (function, file:line, *address)
hbreak LOCATIONHardware breakpoint (works before paging)
tbreak LOCATIONTemporary breakpoint (deletes after hit)
watch EXPRBreak when memory is written
rwatch EXPRBreak when memory is read
info breakpointsList all breakpoints
delete NDelete breakpoint N

Registers

CommandDescription
info registersShow general-purpose registers
print/​x $REGShow specific register (e.g., $rip, $rax)
print/​x $cr2Page fault address
print/​x $cr3Current page table
show-segmentsShow segment registers (custom)
show-controlShow control registers (custom)

Memory

CommandDescription
x/​Nxg ADDRExamine N 8-byte values at ADDR
x/​Nxw ADDRExamine N 4-byte values
x/​Ni ADDRDisassemble N instructions
x/​s ADDRShow string at ADDR
disassembleDisassemble current function
disassemble FUNCDisassemble specific function

Stack & Frames

CommandDescription
backtrace / btShow call stack
backtrace fullShow stack with locals
frame NSelect frame N
info localsShow local variables
info argsShow function arguments

Kernel-Specific Tips

Page Fault Investigation

--command "print/​x \$cr2"     # Faulting address
--command "print/​x \$rip"     # Faulting instruction
--command "x/​i \$rip"         # Show faulting instruction
--command "backtrace"         # Call stack

Syscall Debugging

--command "break rust_syscall_handler"
--command "continue"
--command "print/​x \$rax"     # Syscall number
--command "print/​x \$rdi"     # First argument
--command "step"              # Step into handler

Timer/​Interrupt Analysis

--command "break timer_interrupt_handler"
--command "continue"
--command "info registers"    # See state at interrupt
--command "finish"            # Complete handler

Context Switch Tracing

--command "break check_need_resched_and_switch"
--command "continue"
--command "info locals"       # See scheduler state

Script Options

start_session.py

--mode uefi|bios    Boot mode (default: uefi)
--timeout SECONDS   Session timeout (default: 300)
--kernel PATH       Kernel binary path (auto-detected)
--debug             Print debug output

gdb_cmd.py

--session ID        Session ID (required)
--command CMD       GDB command (can specify multiple with -c)
--timeout SECONDS   Command timeout (default: 30)
--format json|text  Output format (default: json)

stop_session.py

--session ID        Session ID (required)
--force             Force kill without cleanup

list_sessions.py

--format json|text  Output format (default: json)
--cleanup           Remove dead sessions

Session State

Sessions are stored in /​tmp/​breenix_gdb_sessions/:

  • SESSION_ID.json - Session metadata
  • SESSION_ID.log - GDB command log
  • SESSION_ID.qemu.log - QEMU output

Troubleshooting

Session not found

# List all sessions
breenix-gdb-chat/​scripts/​list_sessions.py

# Clean up dead sessions
breenix-gdb-chat/​scripts/​list_sessions.py --cleanup

# Start fresh session
breenix-gdb-chat/​scripts/​start_session.py

Command timeout

The target may be hung. Try:

# Force stop and restart
breenix-gdb-chat/​scripts/​stop_session.py --session ID --force
breenix-gdb-chat/​scripts/​start_session.py

Cannot connect to QEMU

Check QEMU started correctly:

cat /​tmp/​breenix_gdb_sessions/​SESSION_ID.qemu.log

More skills from majiayu000

xiaohongshu logo
majiayu000/claude-arsenal

xiaohongshu

xiaohongshu

286 148
View
agent-task-conductor logo
majiayu000/claude-skill-registry

agent-task-conductor

Conduct multi-agent task orchestration and workflow coordination.

663 1
View
conductor-setup logo
majiayu000/claude-skill-registry

conductor-setup

Initialize project with Conductor artifacts (product definition,

663 1
View
animation-designer logo
majiayu000/claude-skill-registry

animation-designer

Expert in web animations, transitions, and motion design using Framer Motion and CSS

663 1
View
diagramming logo
majiayu000/claude-skill-registry

diagramming

Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...

663 1
View
h3-pg logo
majiayu000/claude-skill-registry-data

h3-pg

PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.

23 1
View
conductor-development logo
majiayu000/claude-skill-registry

conductor-development

Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...

663 1
View
conductor-status logo
majiayu000/claude-skill-registry

conductor-status

Display project status, active tracks, and next actions

663 1
View
dockerization logo
majiayu000/claude-skill-registry

dockerization

Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.

663 1
View

Popular AI tools

Kaiber logo
Video

Kaiber

Generate, edit, and beat-sync AI video with leading models in one workspace.

Paid
View
Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View

Transform Your Design with AI Designer by ImgCreator.ai

Freemium
View
Akool AI logo
Content & writing

Akool AI

Revolutionizing Video Production with AI-Powered Creativity

Paid
View

Extend an image past the frame and let AI fill the new aspect ratio.

Freemium
View
StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
C

ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.

Freemium
View
Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View