------- Comment #9 from redi at gcc dot gnu dot org  2010-09-15 23:52 -------
oops, I wasn't paying attention - I screwed up my build of gdb-7.2 so it didn't
have python support and mistook the non-pretty printed string for a traceback!

Here is a fresh GCC 4.5.2 build and a vanilla GDB 7.2 build (with python
support!)

moria:shm$ cat pr45403.cc 
#include <string>
int main()
{
        std::string s( "foo" );
        s.size();
}
moria:shm$ ~/gcc/4.5/bin/g++ pr45403.cc -v 2>&1 | fgrep 'version 4.5'
gcc version 4.5.2 20100915 (prerelease) (GCC) 
GNU C++ (GCC) version 4.5.2 20100915 (prerelease) (x86_64-unknown-linux-gnu)
GNU C++ (GCC) version 4.5.2 20100915 (prerelease) (x86_64-unknown-linux-gnu)
moria:shm$ 
moria:shm$ ~/gcc/4.5/bin/g++ pr45403.cc -gdwarf-4 -g2 -Wl,-R$HOME/gcc/4.5/lib64
moria:shm$ 
moria:shm$ /dev/shm/gdb/bin/gdb ./a.out
GNU gdb (GDB) 7.2
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-unknown-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /dev/shm/a.out...done.
(gdb) br main
Breakpoint 1 at 0x4007cd: file pr45403.cc, line 4.
(gdb) r
Starting program: /dev/shm/a.out 

Breakpoint 1, main () at pr45403.cc:4
4               std::string s( "foo" );
(gdb) n
5               s.size();
(gdb) p s
$1 = "foo"

Are you sure you haven't modified your GCC sources?


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45403

Reply via email to