How to get debug mode version of libstdc++ when compiling GCC
Benjamin Kosnik
bkoz@redhat.com
Thu Jul 22 16:48:00 GMT 2004
>#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
More information about the Libstdc++
mailing list