Tutorial: Emacs and GDB

I remember learning how to use a debugger and Utah State University as an undergraduate.  We learned to program in Fortran 90, and used a Microsoft debugger.  It seemed cool, but honestly with the types of programs I was writing at the time, using print statement seemed to be effective enough and less of a hassle.  Recently I have been working with the Uintah MPM code, which is MUCH larger and more complex than any code I’ve ever written.  After several months of wading through the code I finally came across a problem that “cout” just could not help me solve.  The code was suddenly crashing with an allocation error and giving no useful backtrace information.  A colleague suggested that I use gdb to find out where the problem was occurring.  It turned out to be very, very helpful and surprisingly easy to use.  I’ve recently become a convert to Emacs, and found that the gdb interface in Emacs is especially nice.  So here is goes:

Continue reading