LabWired implements the GDB Remote Serial Protocol (RSP), allowing standard GDB clients (arm-none-eabi-gdb, gdb-multiarch) to connect for interactive debugging.
The GDB server is embedded within the labwired-cli. It listens on TCP port 3333 by default.
labwired --gdb --port 3333 --firmware firmware.elf --system system.yamlLaunch your cross-architecture GDB client and connect to the remote target.
arm-none-eabi-gdb target/firmware.elfInside GDB:
(gdb) target remote localhost:3333
(gdb) load # Optional: Reloads sections if modified
(gdb) break main
(gdb) continueThe RSP implementation supports the following subsets:
| Command | Description | Notes |
|---|---|---|
g / G |
Read/Write All Registers | Full context switch support |
P |
Write Single Register | PC modification supported |
m / M |
Read/Write Memory | Used for variable inspection |
Z0 / z0 |
Software Breakpoints | Uses BKPT instruction injection |
vCont |
Continue / Step | Supports single-stepping |
qSupported |
Feature Negotiation | XML target description |
For VS Code users preferring the GDB workflow (e.g., for extensive peripheral viewing via SVD), configured launch.json as follows:
{
"type": "cortex-debug",
"request": "launch",
"servertype": "external",
"gdbTarget": "localhost:3333",
"executable": "${workspaceFolder}/target/firmware.elf",
"runToEntryPoint": "main",
"svdFile": "${workspaceFolder}/STM32F103.svd"
}Note: You must start the LabWired GDB server manually or via a pre-launch task before starting the debug session.