libstdc++ debug option

Jonathan Wakely jwakely.gcc@gmail.com
Thu Dec 5 01:03:00 GMT 2013


On 5 December 2013 00:22, Oleg Smolsky wrote:
> Hi all, I have a question about the |--enable-libstdcxx-debug option - do I
> need to pass it to the configure script in order to use the debugging
> features?

No.  That option causes a second set of libstdc++ libraries to be
built with (by default) CXXFLAGS="-O0 -g" and installed to
${libdir}/debug so that you can use LD_LIBRARY_PATH to use those
unoptimized libs if you want to step through libstdc++ code in GDB, it
does not affect the availability of any features.

See http://gcc.gnu.org/onlinedocs/libstdc++/manual/debug.html#debug.req

> Also, a complementary question: what happens when I define
> _GLIBCXX_DEBUG in the program yet the aforementioned flag was not passed to
> configure?

_GLIBCXX_DEBUG is completely unrelated to --enable-libstdcxx-debug, it
enables the Debug Mode, see
http://gcc.gnu.org/onlinedocs/libstdc++/manual/debug_mode.html



More information about the Libstdc++ mailing list