This is the mail archive of the mailing list for the GDB project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Problems outputting a string

woops, had the gdb output paste wrong, here it is(everything else was

bash-2.05b$ gdb tetete.o
GNU gdb 5.3
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
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i686-pc-linux-gnu"...
(gdb) b 7
Breakpoint 1 at 0x80486ad: file /home/palomer/tetete.cpp, line 7.
(gdb) r
Starting program: /home/palomer/tetete.o

Breakpoint 1, foo() () at /home/palomer/tetete.cpp:7
7 return ret;
(gdb) p ret
$1 = {static npos = 4294967295,
_M_dataplus = {<allocator<char>> = {<No data fields>},
_M_p = 0xbffff7a0
"T\233\004\ba"+$ at ?÷y"?\035\205\004\bT_\022 at a"+$ at ?÷y"?d\n\023 at \
001"}, static _S_empty_rep_storage = {0, 0, 0, 0}}
(gdb) p ret.c_str()

Program received signal SIGSEGV, Segmentation fault.
0x400acf3c in std::char_traits<char>::assign(char&, char const&) ()
from /usr/lib/gcc-lib/i686-pc-linux-gnu/3.2.1/
The program being debugged was signaled while in a function called from GDB.
GDB remains in the frame where the signal was received.
To change this behavior use "set unwindonsignal on"
Evaluation of the expression containing the function
(std::string::c_str() const
) will be abandoned.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]