The environment for embedded development normally involves two systems— a build system and a target system, or an emulator. Although the command-line interface of the GDB makes it a good choice even for low-performance embedded systems, in many cases, interactive debugging on the target system is impractical because of the high latency of remote communication.
In such situations, developers can use remote debugging support provided by the GDB. In this setup, an embedded application is launched on the target system using gdbserver. Developers run the GDB on a build system and connect to gdbserver over the network.
In this recipe, we will learn how to start debugging an application using the GDB and gdbserver.