Using the GNU Debugger for debugging
While developing any project, from time to time, we end up struggling to understand subtle bugs. The GDB is available as a package in Poky. It is installed in SDK images by default, as was detailed in Chapter 9, Developing with the Yocto Project.
Note
To install debugging packages containing the debug symbols and tools in an image, add IMAGE_FEATURES += "dbg-pkgs tools-debug"
in build/conf/local.conf
.
Using the SDK or an image with the debugging packages and tools installed allows us to debug applications directly in the target, replicating the same development workflow we usually do on our machine.
The GDB may not be usable on some targets because of memory or disk space constraints. The main reason for this limitation is that the GDB needs to load the debugging information and the binaries of the debugging process before starting the debugging process.
To overcome these constraints, we can use gdbserver
, included by default...