GDB debugging over UART

GDB can communicate with the target over a serial line, or over an IP network using TCP or UDP. In each case, gdb uses the same protocol for debugging your program; only the medium carrying the debugging packets varies. The target remote and target extended-remote commands establish a connection to the target. Both commands accept the same arguments, which indicate the medium to use:

target remote serial-device
target extended-remote serial-device

Use serial-device to communicate with the target. For example, to use a serial line connected to the device named /dev/ttyb:
target remote /dev/ttyb

May be this will help you.

Regards,
Nati