Para el rastreo de problemas con la manipulación de memoria y punteros desbordados podemos usar VALGRIND, para ello usar:
$ g++ -g -O0 *.cpp
$ valgrind --tool=memcheck --leak-check=yes --show-reachable=yes ./a.out
o analizar la salida usando kcachegrind
$ valgrind --tool=callgrind ./a.out
$ kcachegrind profile.callgrind
Existen varios front-end para valgrind, uno de ellos es alleyoop y para usarlo hacer:
$ alleyoop ./a.out -v --arg1=foo
otro es kcachegrind.
http://alleyoop.sourceforge.net/usage.html
http://kcachegrind.sourceforge.net/html/Home.html