

native - where both host and target are the target processorįirst download the GDB source code compressed archive, and unpack it:.cross-target - where the host is the development workstation and the target is the target processor.You will build two sets of binaries from the GDB source code: binutils) that runs on the development workstation and generates executables for the target processor. You also need a cross-target toolchain: a GNU C compiler (together with a C run-time library and binary utilities, a.k.a.
#CLION LINUX KERNEL SERIAL#
The following example uses a 7450 PowerPC as the target processor.īefore you begin, you need a communication interface between the PC running GDB and the target platform: either a serial link or, preferably, an Ethernet network connection. In other words, you have to custom-build GDB from source code. This means you can’t simply use the GDB executable that’s installed on the workstation - you want a cross-target debugger. Typically, the development workstation has a different processor (say, an i686 class processor) than the target platform (which may be ARM, PowerPC, or something else). GDBserver takes control of the application being debugged, then waits for instructions from a remote instance of GDB running on a development workstation. The advantage of using GDBserver is that it needs just a fraction of the target resources that GDB consumes, because it implements only the low-level functionality of the debugger - namely setting breakpoints and accessing the target processor registers and read/write application memory. Rather than run a full-blown instance of GDB on the target platform, you can use GDBserver, a program that lets you run GDB on a different machine than the one on which your program is running. Here are some tips for easing the difficulties. However, the benefits of having a way to methodically debug a program instead of guessing what’s wrong with it far outweigh the effort involved. In practice, setting up GDB for this task is a bit of a challenge it takes some work, and there are some technical hurdles to overcome. In theory, GDB, the GNU debugger, can ease the chore of debugging applications running on a Linux-based embedded system.
