[1] Running on the same system as the program to be debugged, it allows the GNU Debugger to connect from another system; that is, only the executable to be debugged needs to be resident on the target system ("target"), while the source code and a copy of the binary file to be debugged reside on the developer's local computer ("host").
The connection can be either TCP or a serial line.
Example for debugging a program called hello_world on a remote target using TCP ("2159" is the registered TCP port number for remote GDB): Another technique for debugging programs remotely is to use a remote stub.
[2][clarification needed] In this case, the program to be debugged is linked with a few special-purpose subroutines that implement the GDB remote serial protocol.
The file containing these subroutines is called a "debugging stub".