[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#176797: libstdc++5: GDB looks in the wrong place for libstdc++ headers



Package: libstdc++5
Version: 1:3.2.2-0pre5
Severity: important

When running my c++ program from inside gdb I get the following:

danielb@frodo:~/software/src/cvs/gsim/src/examples/mm1$ gdb .libs/mm1
GNU gdb 5.3-debian
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you
are
welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for
details.
This GDB was configured as "i386-linux"...
(gdb) run
Starting program:
/home/danielb/software/src/cvs/gsim/src/examples/mm1/.libs/mm1
[New Thread 16384 (LWP 20311)]
 
 Program received signal SIGSEGV, Segmentation fault.
 [Switching to Thread 16384 (LWP 20311)]
 0x400313b6 in bool std::has_facet<std::ctype<char> >(std::locale
 const&) (__loc=@0x804dc48)
     at /usr/include/g++-v3/bits/locale_facets.tcc:87
     87      /usr/include/g++-v3/bits/locale_facets.tcc: No such file or
     directory.
             in /usr/include/g++-v3/bits/locale_facets.tcc


Even making a symlink here does not fix things.

(gdb) run
Starting program:
/home/danielb/software/src/cvs/gsim/src/examples/mm1/.libs/mm1
[New Thread 16384 (LWP 20366)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 16384 (LWP 20366)]
0x400313b6 in bool std::has_facet<std::ctype<char> >(std::locale const&)
(__loc=@0x804dc48)
    at /usr/include/g++-v3/bits/locale_facets.tcc:87
warning: Source file is more recent than executable.

87          }

So then I just said the heck with it and did an apt-get install
libstdc++3 and libstdc++3-dev (because the headers for that version are
located in the above include path that it complains about) and tried to
run it. Note: this is the wrong version of libstdc++ my program is linked
with.

danielb@frodo:~/software/src/cvs/gsim/src/examples/mm1$ gdb .libs/mm1
GNU gdb 5.3-debian
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you
are
welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for
details.
This GDB was configured as "i386-linux"...
(gdb) run
Starting program:
/home/danielb/software/src/cvs/gsim/src/examples/mm1/.libs/mm1
[New Thread 16384 (LWP 20439)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 16384 (LWP 20439)]
0x400313b6 in bool std::has_facet<std::ctype<char> >(std::locale const&)
(__loc=@0x804dc48)
    at /usr/include/g++-v3/bits/locale_facets.tcc:87
    87            __vec_facet* __facet = __loc._M_impl->_M_facets;
(gdb)


I think something funky may be going on with libstdc++. At any rate it makes 
debugging some c++ programs impossible. It wold be nice to be able to
use the latest libstdc++ when developing c++ apps and be able to run
them inside gdb. 

Also, this may be hard to reproduce as it seems perhaps you need to make
a call into the locale templates, but I am not 100% sure of this.

Dan
<danielb@libertyetech.com>
-- System Information:
Debian Release: testing/unstable
Architecture: i386
Kernel: Linux frodo 2.4.20-xfs #4 Thu Jan 9 11:54:54 CST 2003 i686
Locale: LANG=C, LC_CTYPE=C

Versions of packages libstdc++5 depends on:
ii  gcc-3.2-base               1:3.2.2-0pre5 The GNU Compiler Collection (base 
ii  libc6                      2.3.1-9       GNU C Library: Shared libraries an
ii  libgcc1                    1:3.2.2-0pre5 GCC support library

-- no debconf information




Reply to: