Tutorial: Debugging ECE250 Projects

Vajihollah Montaghami
University of Waterloo

Douglas W. Harder
University of Waterloo

February 28, 2014

Abstract

In this tutorial you will learn what are bugs and how one can get rid of them using debugging tools, called debuggers. The GNU Project Debugger and Visual Studio debugger are two common tools that you can use them to systematically debug your projects implemented in C++.

1 Introduction
 1.1 Example
2 Using debugging tools
 2.1 Preparing program for debugging
 2.2 Breakpoints and the ‘run’, ‘break’, ‘cont’ commands
 2.3 The ‘set’ and ‘print’ commands
 2.4 Continuing execution using ‘step’, ‘finish’, and ‘next’ commands
 2.5 The ‘watch’ and ‘clear’ Commands
3 Complete example code
4 Wrap up and Further reading
References