

Combining the power of gdb and valgrind - jlemoine
http://billiob.net/blog//20140330_vgdb.html

======
gjulianm
I just discovered a few days ago that gdb + valgrind integration. It's awesome
for debugging and finding weird memory errors. A neat thing that isn't
explained in the article is that valgrind automatically sends SIGTRAP to gdb
whenever there are invalid write/reads (even when those wouldn't cause a
segfault), so the program stops and you can inspect the state (get backtrace,
jump to different frames with "frame #" and inspect variable values) to detect
quickly what's causing the error.

By the way, if you're really interested in learning all things gdb, the GNU
GDB Manual [1] is really great and detailed, including a PDF version.

[1]
[http://www.gnu.org/software/gdb/documentation/](http://www.gnu.org/software/gdb/documentation/)

------
jmspring
Great article. I've recently had to walk some more junior engineers through
these tools. I would through in Electric Fence as one to consider.

~~~
padenot
I thought I'd mention ASAN [1] for this. It's built in in the most recent
version of gcc and clang (just pass -fsanitize=address), and enjoy the nice
reporting when you do something silly with a buffer.

We use this extensively at Mozilla when working on Firefox, and I know Google
folks use it a lot on Chromium as well.

[1]: [https://code.google.com/p/address-
sanitizer/](https://code.google.com/p/address-sanitizer/)

------
rramsden
Wanted to look more into valgrind but their website is down :(

------
heinrich5991
Kind of offtopic, but the background really distracts me, I think it has too
much detail.

~~~
dima55
Yeah, that is offtopic. Why did you bring it up?

