Debugging with GDB
Last week during a training course for the IOI this year, one of my friends called Patrik, showed me some useful GDB tricks which I want to share here. Let’s start with a simple example program “perm.cpp”, which is intended for printing out all permutations of a given sequence S. Please note that this program will produce a (wanted) run-time error which we are going to debug next.
