2003-09-11 David Carlton <carlton@kealia.com>
authorDavid Carlton <carlton@bactrian.org>
Thu, 11 Sep 2003 23:43:56 +0000 (23:43 +0000)
committerDavid Carlton <carlton@bactrian.org>
Thu, 11 Sep 2003 23:43:56 +0000 (23:43 +0000)
* buildsym.c (finish_block): Use allocate_block to allocate the
block.
* mdebugread.c (new_block): Add FIXME.

gdb/ChangeLog
gdb/buildsym.c
gdb/mdebugread.c

index a59d05b6d01257f943ef391e13b48fd38e0f97bc..ae994cab5852025a671c53111a7a1b02871f0dbb 100644 (file)
@@ -1,3 +1,9 @@
+2003-09-11  David Carlton  <carlton@kealia.com>
+
+       * buildsym.c (finish_block): Use allocate_block to allocate the
+       block.
+       * mdebugread.c (new_block): Add FIXME.
+
 2003-09-11  David Carlton  <carlton@kealia.com>
 
        * gdbtypes.h: Add TYPE_CODE_NAMESPACE.
index f0d75ce3f52ce64c1d82460c9738bf7d70a52137..aa87d4c4fcbd392e7aaa467cb00b094864865714 100644 (file)
@@ -231,19 +231,15 @@ finish_block (struct symbol *symbol, struct pending **listhead,
   register struct pending_block *pblock;
   struct pending_block *opblock;
 
-  /* Initialize the block's dictionary.  */
+  block = allocate_block (&objfile->symbol_obstack);
 
   if (symbol)
     {
-      block = (struct block *) 
-       obstack_alloc (&objfile->symbol_obstack, sizeof (struct block));
       BLOCK_DICT (block) = dict_create_linear (&objfile->symbol_obstack,
                                               *listhead);
     }
   else
     {
-      block = (struct block *) 
-       obstack_alloc (&objfile->symbol_obstack, sizeof (struct block));
       BLOCK_DICT (block) = dict_create_hashed (&objfile->symbol_obstack,
                                               *listhead);
     }
index 1bb1e05700956159d71fbf09fe7015b6962a5166..453b983c66d300ba61b4208ab55b45fd8e85d095 100644 (file)
@@ -4696,6 +4696,9 @@ new_bvect (int nblocks)
 static struct block *
 new_block (enum block_type type)
 {
+  /* FIXME: carlton/2003-09-11: This should use allocate_block to
+     allocate the block.  Which, in turn, suggests that the block
+     should be allocated on an obstack.  */
   struct block *retval = xzalloc (sizeof (struct block));
 
   if (type == FUNCTION_BLOCK)