Debugging Embedded Devices using GDB

Bugs happen. Identifying and fixing them is part of the development process. This tutorial demonstrates one of the key tools in the embedded Linux developer’s toolbox: the GNU Debugger, GDB. You will begin by using GDB to debug a program running on a target device. You will learn about debug symbols: how build them into programs and libraries, and the places that GDB will go looking for them. Next, you will perform basic debugging tasks, including setting breakpoints, stepping through code, examining variables and modifying variables. After that you will lean about GDB command files and how they can help you by automating certain tasks. You will receive a handy GDB cribsheet to help you with all of this. If time allows, we will discuss how to use GDB to analyse core dumps so that you can perform a post-mortem on a crashed program.

This is a 90 minute tutorial that I first gave at the Embedded Linux Conference Europe in October 2020




Yocto Project image for Raspberry Pi 3B:


Code samples:

GDB quick reference card: