[patch] Reset 'using_directives' after block initialization

Sami Wagiaalla swagiaal@redhat.com
Fri Mar 12 20:05:00 GMT 2010


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  <swagiaal@redhat.com>

	* buildsym.c (finish_block): Reset using_directives pointer
	after block initialization.


2010-03-12  Sami Wagiaalla  <swagiaal@redhat.com>

	* 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 <http://www.gnu.org/licenses/>.
    */
 
+namespace B{
+  int x;
+}
+
 class base
 {
  public:
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: using_directive.patch
URL: <http://sourceware.org/pipermail/gdb-patches/attachments/20100312/ef4c38d9/attachment.ksh>


More information about the Gdb-patches mailing list