IT lexicon › Programming › GDB Remote Serial Protocol (RSP)

GDB Remote Serial Protocol (RSP)

Programming På svenska → Updated: 2026-11-04

The text-based protocol GDB uses to drive a program running somewhere else — on a board, in an emulator, or on another machine.

Every packet looks like $data#cs, where cs is a two-digit hex checksum, and the receiver acknowledges with + or asks for a resend with -. The command set is spartan: g reads all registers, m reads memory, c continues, s steps, Z0 sets a breakpoint. It was designed for serial cables, hence the name, but these days it nearly always runs over TCP via target remote :3333.

The simplicity is the whole point. Implement a handful of packets and you get a full source-level debugger for free, which is why OpenOCD, pyOCD, J-Link's GDB server, QEMU's gdbstub and the Black Magic Probe all speak it. GDB needs to know nothing about JTAG or SWD; the probe or server does the translating. The downside is chattiness — stepping over a long function on a slow link is an exercise in patience.

← Back to the lexicon