This is the mail archive of the
gdb-prs@sources.redhat.com
mailing list for the GDB project.
c++/1350: Static variable defined in another method is displayed instead of variable in current method.
- From: duma at gorodok dot net
- To: gdb-gnats at sources dot redhat dot com
- Date: 22 Aug 2003 03:48:35 -0000
- Subject: c++/1350: Static variable defined in another method is displayed instead of variable in current method.
- Reply-to: duma at gorodok dot net
>Number: 1350
>Category: c++
>Synopsis: Static variable defined in another method is displayed instead of variable in current method.
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Fri Aug 22 03:58:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator: duma@gorodok.net
>Release: unknown-1.0
>Organization:
>Environment:
Os:
Linux itest8 2.4.21-0.13mdk #1 Fri Mar 14 15:08:06 EST 2003 i686 unknown unknown GNU/Linux
gdb:
GNU gdb 5.3-22mdk (Mandrake Linux)
i586-mandrake-linux-gnu
also:
gdb 2003-08-18-cvs
i686-pc-linux-gnu
gcc:
Reading specs from
/usr/lib/gcc-lib/i586-mandrake-linux-gnu/3.2.2/specs
Configured with: ../configure --prefix=/usr
--libdir=/usr/lib --with-slibdir=/lib
--mandir=/usr/share/man --infodir=/usr/share/info
--enable-shared --enable-threads=posix --disable-checking
--enable-long-long --enable-__cxa_atexit
--enable-languages=c,c++,ada,f77,objc,java
--host=i586-mandrake-linux-gnu --with-system-zlib
Thread model: posix
gcc version 3.2.2 (Mandrake Linux 9.1 3.2.2-3mdk)
>Description:
Inspecting static variable gives wrong result:
content of another variable is shown
>How-To-Repeat:
Compile attached file and try to inspect variable g in conversion operator.
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: text/x-c++src; name="Test.cpp"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="Test.cpp"
dGVtcGxhdGUgPHVuc2lnbmVkIFc+CnN0cnVjdCBBCnsKCWxvbmcgbG9uZyBhOwoJc2lnbmVkIGI7
Cglib29sIGM7Cn07CnRlbXBsYXRlPHVuc2lnbmVkIFY+CnN0cnVjdCBCCnsKCWludCBmOwpwdWJs
aWM6CglCKCl7fQoJdGVtcGxhdGUgPHVuc2lnbmVkIFc+CglvcGVyYXRvciBBPFc+KCkgY29uc3QK
CXsKCQlzdGF0aWMgQjxWPiBnOwoJCQoJCWcuZiA9IDA7CgkJCgkJQTxXPiBhOwoJCS8vcHJpbnQg
ZyBpbiBnZGIgcHJvbXB0IAoJCS8vaXQgd291bGQgc2hvdyB0aGF0IGcuZiA9PSA2CgkJYS5hID0g
Zy5mOwoJCWEuYiA9IDE7CgkJYS5jID0gdHJ1ZTsKCQlyZXR1cm4gYTsKCX0KCXZvaWQgcygpCgl7
CgkJc3RhdGljIEI8Vj4gZzsKCgkJZy5mID0gNjsKCX0KfTsKaW50IG1haW4oKQp7CglCPDE+IGI7
CglBPDI+IGE7CgliLnMoKTsKCS8vc3RlcCBpbiBhbmQgZXhhbWluZSB2YXJpYWJsZSBnLgoJLy9h
Y3R1YWxseSBnIGluIHMoKSBpcyBkaXNwbGF5ZWQKCWEgPSAoQTwyPiliOwoJYi5zKCk7CglhID0g
KEE8Mj4pYjsKCXJldHVybiAwOwp9Cg==