I work on a financial application (Linux/C++/gcc) that uses boost and templates extensively. The stack traces generated while debugging via GDB is horrifyingly complex with the internal template-wiring of boost adding a lot of ugly noise to the output. Does anyone know of a way to get a cleaner, prettier and more insightful stack-traces for C++ template-heavy (especially boost-heavy) code?
Asked
Active
Viewed 554 times
6
-
1Which version of gdb? Have you looked at the possible dup http://stackoverflow.com/questions/432567/debugging-best-practices-for-c-stl-boost-with-gdb?rq=1 ? – Sebastian Mach Sep 19 '12 at 14:10
-
1You could also try using LLDB. – James Sep 19 '12 at 14:13
1 Answers
3
The Python support in newer versions of GDB has been used to provide pretty printers for template-heavy structures like the STL.
I haven't tried any of this myself. Unfortunately, it looks like adding support for Boost and for cleaning up stack traces (as opposed to pretty-printing values) may involve rolling some of your own Python code.

Josh Kelley
- 56,064
- 19
- 146
- 246