Difference between revisions of "GDB"

From SEGGER Wiki
Jump to: navigation, search
(Created page with "Category:Knowledge Base 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 L...")
 
m
Line 3: Line 3:
 
GDB is a command line debugger available on many systems.
 
GDB is a command line debugger available on many systems.
 
GDB is free software released under the GNU General Public License (GPL).
 
GDB is free software released under the GNU General Public License (GPL).
 
 
  
 
==History==
 
==History==
Line 22: Line 20:
 
In this scenario, the debugger is acting as client, connecting to the debug probe, acting as server.
 
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.
 
In most cases, the client (debugger) and the server run on the same machine, so the client connects to a port on localhost.
 +
==== Advantages ====
 +
* 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
 +
====Capabilities====

Revision as of 23:09, 15 August 2019

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).

History

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 no 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.

Advantages

  • 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

Capabilities