This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: How to get debug mode version of libstdc++ when compiling GCC
- From: Benjamin Kosnik <bkoz at redhat dot com>
- To: "Pit Cuppens" <pcuppens at gmx dot net>
- Cc: libstdc++ at gcc dot gnu dot org
- Date: Thu, 22 Jul 2004 11:47:28 -0500
- Subject: Re: How to get debug mode version of libstdc++ when compiling GCC
- Organization: Red Hat / Chicago
- References: <31013.1090508645@www46.gmx.net>
>#include <vector>
>
>int main(int,char **) {
> std::vector<int> v;
> v[3] = 2;
>}
>
>with -D_GLIBCXX_DEBUG would result in a
>runtime error mesage. Wonderful!
Indeed.
gcc-3.4:
%COMP.sh "-g -O2 -D_GLIBCXX_DEBUG" debug_test.cc
<bkoz@roscoe> /home/bkoz %a.out
/mnt/hd/bld/gcc/i686-pc-linux-gnu/libstdc++-v3/include/debug/vector:192:
error: attempt to subscript container with out-of-bounds index 3, but
container only holds 0 elements.
Objects involved in the operation:
sequence "this" @ 0x0xbffff290 {
type = N15__gnu_debug_def6vectorIiSaIiEEE;
}
Abort (core dumped)
-benjamin