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 to launch a program on the target using the GDB proxy agent, gdbserver, and how to set up communication between GDB and gdbserver. Then, you will be able to perform basic debugging tasks, including setting breakpoints, stepping through code, examining variables and modifying variables. After that, you will learn 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 analyze core dumps so that you can perform a post-mortem on a crashed program.
Chris Simmonds is a software consultant and trainer living in southern England. He has almost two decades of experience in designing and building open-source embedded systems. He is the founder and chief consultant at 2net Ltd, which provides professional training and mentoring services in embedded Linux, Linux device drivers, and Android platform development. He has trained engineers at many of the biggest companies in the embedded world. He is the author of the book “Mastering Embedded Linux Programming”, and is a frequent presenter at open source and embedded conferences, including the Embedded Linux Conference and Embedded World. You can see some of his work on the “Inner Penguin” blog at www.2net.co.uk