The global pointer using_directives is used to temporarily store the using_direct linked list until it is used to set the current blocks using directives. The pointer must be reset to NULL every time after block initialization. This patch fixes that. 2010-03-12 Sami Wagiaalla * buildsym.c (finish_block): Reset using_directives pointer after block initialization. 2010-03-12 Sami Wagiaalla * gdb.cp/gdb2384-base.h: Created 'namespace B'. * gdb.cp/gdb2384-base.cc: Use 'namespace B'. Index: gdb/buildsym.c =================================================================== RCS file: /cvs/src/src/gdb/buildsym.c,v retrieving revision 1.78 diff -u -r1.78 buildsym.c --- gdb/buildsym.c 1 Jan 2010 07:31:30 -0000 1.78 +++ gdb/buildsym.c 12 Mar 2010 16:45:37 -0000 @@ -387,6 +387,7 @@ } block_set_using (block, using_directives, &objfile->objfile_obstack); + using_directives = NULL; record_pending_block (objfile, block, opblock); Index: gdb/testsuite/gdb.cp/gdb2384-base.cc =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.cp/gdb2384-base.cc,v retrieving revision 1.5 diff -u -r1.5 gdb2384-base.cc --- gdb/testsuite/gdb.cp/gdb2384-base.cc 1 Jan 2010 07:32:01 -0000 1.5 +++ gdb/testsuite/gdb.cp/gdb2384-base.cc 12 Mar 2010 16:45:38 -0000 @@ -23,6 +23,8 @@ { } +using namespace B; + int base::meth () { Index: gdb/testsuite/gdb.cp/gdb2384-base.h =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.cp/gdb2384-base.h,v retrieving revision 1.5 diff -u -r1.5 gdb2384-base.h --- gdb/testsuite/gdb.cp/gdb2384-base.h 1 Jan 2010 07:32:01 -0000 1.5 +++ gdb/testsuite/gdb.cp/gdb2384-base.h 12 Mar 2010 16:45:38 -0000 @@ -16,6 +16,10 @@ along with this program. If not, see . */ +namespace B{ + int x; +} + class base { public: