Description of problem: cat test.cc ~=~ struct s { s() { } int foo() { int i = 0; ++i; return i; } void bar() { int j = 0; j *= 2; } }; int main() { s something; something.bar(); something.foo(); return 0; } ~=~ [dodji@adjoa tests]$ g++ -g -Wall -o test test.cc [dodji@adjoa tests]$ gdb test GNU gdb (GDB) Fedora (7.1-33.fc13) 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-redhat-linux-gnu". For bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>... Reading symbols from /home/dodji/tests/test...done. (gdb) b main Breakpoint 1 at 0x40055c: file test.cc, line 26. (gdb) run Starting program: /home/dodji/tests/test Breakpoint 1, main () at test.cc:26 26 s something; Missing separate debuginfos, use: debuginfo-install libgcc-4.4.4-10.fc13.x86_64 libstdc++-4.4.4-10.fc13.x86_64 (gdb) n 27 something.bar(); (gdb) s s::bar (this=0x7fffffffdfaf) at test.cc:18 18 int j = 0; (gdb) p foo() No symbol "foo" in current context. (gdb) p this->foo() $1 = 1 (gdb) Version-Release number of selected component (if applicable): 7.1-33.fc13 How reproducible: Always.
Upstream Sami's post: [patch] PR 11992 "Regression: C++ this scope sometimes does not work" http://sourceware.org/ml/gdb-patches/2010-09/msg00229.html
gdb-7.1-34.fc13 has been submitted as an update for Fedora 13. https://admin.fedoraproject.org/updates/gdb-7.1-34.fc13
gdb-7.2-4.fc14 has been submitted as an update for Fedora 14. https://admin.fedoraproject.org/updates/gdb-7.2-4.fc14
gdb-7.2-4.fc14 has been pushed to the Fedora 14 stable repository. If problems still persist, please make note of it in this bug report.
gdb-7.1-34.fc13 has been pushed to the Fedora 13 stable repository. If problems still persist, please make note of it in this bug report.