This is the mail archive of the
gdb-prs@sources.redhat.com
mailing list for the GDB project.
gdb/709: static members confuse GDB.
- From: adarovsky at users dot sourceforge dot net
- To: gdb-gnats at sources dot redhat dot com
- Date: 18 Sep 2002 11:00:18 -0000
- Subject: gdb/709: static members confuse GDB.
- Reply-to: adarovsky at users dot sourceforge dot net
>Number: 709
>Category: gdb
>Synopsis: static members confuse GDB.
>Confidential: no
>Severity: serious
>Priority: high
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Wed Sep 18 04:08:01 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator: Alexander Darovsky Jr
>Release: last cvs 5.3 branch
>Organization:
>Environment:
linux,
$ gdb --version
GNU gdb 5.2.90_2002-09-18-cvs
$ gcc --version
gcc (GCC) 3.2
>Description:
gdb is got confused with standard template library class
>How-To-Repeat:
compile and run this example in gdb. Here is the sample session:
daa@a-darovskikh:~/test/gdb_bugs/string$ gdb string_bug
GNU gdb 5.2.90_2002-09-18-cvs
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 "i686-pc-linux-gnu"...[Established NGPT Debugging Environment]
(gdb) l
1 #include <iostream>
2 #include <string>
3 using namespace std;
4
5 main()
6 {
7 string s( "string" );
8 cout << s << endl;
9 }
(gdb) b 7
Breakpoint 1 at 0x8048871: file string_bug.cpp, line 7.
(gdb) r
Starting program: /home/daa/test/gdb_bugs/string/string_bug
Breakpoint 1, main () at string_bug.cpp:7
7 string s( "string" );
(gdb) n
8 cout << s << endl;
(gdb) p s
$1 = {
static npos = Cannot access memory at address 0x83cfe84
(gdb)
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="string_bug.cpp"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="string_bug.cpp"
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8c3RyaW5nPgp1c2luZyBuYW1lc3BhY2Ugc3Rk
OwoKbWFpbigpCnsKICAgIHN0cmluZyBzKCAic3RyaW5nIiApOwogICAgY291dCA8PCBzIDw8IGVu
ZGw7Cn0K