.github/skills/gdb-debugging/SKILL.md
Guide for debugging Nanvix guests using GDB remote debugging over the microvm machine type. Use this when asked about attaching GDB, setting breakpoints, or stepping through kernel code.
npx skillsauth add nanvix/nanvix gdb-debuggingInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Use this skill when the user asks about debugging the Nanvix kernel or guest applications using GDB.
Refer to doc/gdb.md for the user-facing documentation.
DEPLOYMENT_MODE=standalone). The standalone feature
automatically enables the gdb Cargo feature in nanvixd and nanvix-bench. At the crate
level, the gdb feature requires microvm (enforced via feature dependency).gdb-multiarch or x86_64-elf-gdb)../z build -- all DEPLOYMENT_MODE=standalone
Through nanvixd (preferred):
RUST_LOG=info ./bin/nanvixd.elf -gdb-port 1234 -- ./bin/hello-rust-nostd.elf
Through uservm directly:
RUST_LOG=info ./bin/uservm.elf \
-kernel ./bin/kernel.elf \
-initrd ./bin/hello-rust-nostd.elf \
-standalone -gdb-port 1234
The guest halts at its first instruction until a GDB client connects.
gdb-multiarch ./bin/kernel.elf
(gdb) target remote :1234
(gdb) break _start
(gdb) continue
A ready-to-use .gdbinit exists at the repository root and is loaded automatically when GDB is
launched from the project directory.
| Operation | Command | Notes |
| ------------------- | --------------------- | ------------------------------------ |
| Read registers | info registers | All GPRs, RIP, RFLAGS, segments |
| Write registers | set $rax = 0x42 | Any general-purpose register |
| Read memory | x/16xb 0x1000 | Guest physical memory |
| Write memory | set {int}0x1000 = 1 | Guest physical memory |
| Software breakpoint | break *0x1000 | INT3-based |
| Remove breakpoint | delete 1 | Restores original instruction byte |
| Single step | stepi | One instruction |
| Continue | continue | Resume until next event |
| Backtrace | bt | Requires symbols |
| Disassemble | disas | At current RIP |
(gdb) continue
# ... guest crashes ...
(gdb) bt
(gdb) info registers
(gdb) x/10i $rip
(gdb) stepi
(gdb) info registers
(gdb) break kmain
(gdb) continue
| Problem | Cause / Fix |
| ------------------------------ | -------------------------------------------------------- |
| GDB cannot connect | Port in use (ss -tlnp \| grep 1234), or VM not started |
| | with -gdb-port. |
| "Remote connection closed" | Guest exited before GDB connected. Check VM stderr. |
| Breakpoints not hit | Address mismatch — kernel uses identity mapping |
| | (GVA == GPA). Verify symbol file: file ./bin/kernel.elf.|
| Memory access returns zeros | Address outside guest memory region |
| | (config::kernel::MEMORY_SIZE). |
microvm machine type with KVM, which is not
available on Windows. The WHP backend does not expose a GDB server.-gdb-port requires DEPLOYMENT_MODE=standalone.INT3).gdbstub crate (v0.7), feature-gated behind gdb.INT3 (0xCC); KVM delivers VcpuExit::Debug.gdb feature is enabled by the standalone feature in nanvixd and nanvix-bench.
At the crate level, gdb requires microvm (enforced via feature dependency). The
-gdb-port flag is validated at runtime to require -standalone mode.testing
Guide for Nanvix CI and GitHub Actions workflow behavior, including local pipeline execution and matrix coverage. Use this when asked about CI checks, workflow failures, or release flow.
development
Guide for developing, building, and running Nanvix user-space applications across supported runtimes and languages. Use this when asked about guest app implementation or execution.
development
Guide for diagnosing Nanvix build, runtime, and test failures, including cleanup and debugging workflows. Use this when asked to investigate errors or unstable behavior.
testing
Guide for running Nanvix tests with z. Use this when asked to run unit tests, integration tests, or the full test suite.