From SEGGER Wiki
Revision as of 16:27, 16 August 2019 by MartinBaldwin (talk | contribs) (fixed a typo - changed "no" to "now")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

GDB stands for GNU Debugger. GDB is a command line debugger available on many systems. GDB is free software released under the GNU General Public License (GPL).


GDB was modeled after the DBX debugger, which came with Berkeley Unix distributions. The initial GDB was written by Richard Stallman, who started in 1986. Now it is maintained by the GDB Steering Committee which is appointed by the Free Software Foundation.

Remote operation

When debugging an Embedded System with GDB, the remote mode is used. Remote operation is when GDB runs on one machine and the program being debugged runs on another.
In this situation, GDB is the Client, talking to a remote "stub". The GDB protocol can use a serial link (UART) or TCP/IP. Modern systems almost always use TCP/IP. Typically, the remote stub is a debug probe such as J-Link, using a GDB-Server, and communicating with GDB via TCP/IP.

GDB Protocol

The GDB Protocol has evolved over the years. It is used by GDB, but has now been adopted as a somewhat standardized way for debuggers to communicate to debug probes via TCP/IP. In this scenario, the debugger is acting as client, connecting to the debug probe, acting as server. In most cases, the client (debugger) and the server run on the same machine, so the client connects to a port on localhost.


  • Process separation

One of the advantages of this approach is that the debugger and the debug probe software run in different processes, so that they are shielded from one another. This is quite helpful especially if they are maintained by different software developers or different teams or different companies. Should the debug probe software crash, it does not affect the other debugger / IDE and vice versa.

  • Interoperability
  • Remove debugging