While debugging memory leaks inĀ one of my private projects, I discovered that GDB and Valgrind can actually operate together in a very nice fashion.
GDB is capable of debugging remote programs, like for embedded device software development, by using a remote protocol to communicate with a proxy within the device.
Valgrind is an almost necessary tool if you are working in an environment of dynamically allocated and returned memory. It follows each allocation in your program and tracks it to see if it is returned properly, continue to be referenced or is lost in space, which is a ‘memory leak’. And as any leak, given enough time you will drown, in this case require more and more memory, until either you program is eating up your whole computer, or you get out of memory. Continue reading “Debugging memory leaks with Valgrind and GDB”