register-watch

Snapshot and diff registers in Breenix GDB sessions to diagnose corruption.

7|Updated Nov 21, 2015
One-click install
npx skills add https://github.com/ryanbreen/breenix --skill register-watch
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: register-watch
Source: https://github.com/ryanbreen/breenix/tree/main/breenix-register-watch
Command: npx skills add https://github.com/ryanbreen/breenix --skill register-watch

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Helps diagnose register corruption that occurs during context switches, interrupts, or syscall entry/exit by providing systematic snapshots and diffing.

Core Features & Use Cases

  • Register snapshot and diff utilities
  • Watchpoints on critical registers
  • Real-world use: confirm if a context switch saves/restores registers correctly

Quick Start

  1. Start a Breenix GDB session
  2. In the session, snapshot: define snap-regs, then diff-regs after a suspect boundary
  3. Use commands like 'watch' and 'continue' to observe changes

Frequently Asked Questions about register-watch

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I detect register corruption during context switches?

Register corruption during context switches occurs when the kernel fails to properly save and restore register state. This Skill provides snapshot and diff utilities to capture register values before and after context boundaries, letting you systematically compare state to identify where corruption happens.

Can I use GDB watchpoints to monitor register changes across interrupts?

Yes. This Skill enables watchpoints on critical registers and integrates with GDB sessions to track changes across interrupt and syscall boundaries. Set watchpoints, take snapshots at suspect points, then diff the register state to isolate where unexpected changes occur.

What's the best way to verify a kernel saves registers correctly during context switches?

Snapshot registers before a context switch using the Skill's register capture utilities, then diff them after the switch completes. Comparing snapshots reveals whether the kernel properly preserved or corrupted each register, confirming save/restore correctness.

Do I need to manually inspect kernel code to find register corruption bugs?

No. This Skill automates the process with systematic snapshot and diff capabilities within GDB, eliminating manual register inspection. You define snapshots at critical boundaries—context switches, interrupts, syscalls—and the Skill highlights differences automatically.

Why would register state differ after a syscall entry or exit?

Syscall transitions involve kernel mode entry and exit, which must preserve user-space register state. Unexpected differences signal that the kernel's register-save or register-restore logic is broken, corrupting application state or violating ABI contracts that syscalls must maintain.