* gdbarch.sh (deprecated_register_size): Remove.
[deliverable/binutils-gdb.git] / gdb / block.c
index 98b6ccbb84b43903f495e262baf9cd0f4b12e195..35915febf2581a16eef4b35e3512a020932dec37 100644 (file)
@@ -1,6 +1,6 @@
 /* Block-related functions for the GNU debugger, GDB.
 
-   Copyright 2003 Free Software Foundation, Inc.
+   Copyright (C) 2003, 2007 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -16,8 +16,8 @@
 
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.  */
+   Foundation, Inc., 51 Franklin Street, Fifth Floor,
+   Boston, MA 02110-1301, USA.  */
 
 #include "defs.h"
 #include "block.h"
@@ -71,7 +71,7 @@ block_function (const struct block *bl)
    is NULL, we don't pass this information back to the caller.  */
 
 struct blockvector *
-blockvector_for_pc_sect (CORE_ADDR pc, struct sec *section,
+blockvector_for_pc_sect (CORE_ADDR pc, struct bfd_section *section,
                         int *pindex, struct symtab *symtab)
 {
   struct block *b;
@@ -136,7 +136,7 @@ blockvector_for_pc (CORE_ADDR pc, int *pindex)
    in the specified section, or 0 if there is none.  */
 
 struct block *
-block_for_pc_sect (CORE_ADDR pc, struct sec *section)
+block_for_pc_sect (CORE_ADDR pc, struct bfd_section *section)
 {
   struct blockvector *bl;
   int index;
@@ -268,3 +268,28 @@ block_global_block (const struct block *block)
 
   return block;
 }
+
+/* Allocate a block on OBSTACK, and initialize its elements to
+   zero/NULL.  This is useful for creating "dummy" blocks that don't
+   correspond to actual source files.
+
+   Warning: it sets the block's BLOCK_DICT to NULL, which isn't a
+   valid value.  If you really don't want the block to have a
+   dictionary, then you should subsequently set its BLOCK_DICT to
+   dict_create_linear (obstack, NULL).  */
+
+struct block *
+allocate_block (struct obstack *obstack)
+{
+  struct block *bl = obstack_alloc (obstack, sizeof (struct block));
+
+  BLOCK_START (bl) = 0;
+  BLOCK_END (bl) = 0;
+  BLOCK_FUNCTION (bl) = NULL;
+  BLOCK_SUPERBLOCK (bl) = NULL;
+  BLOCK_DICT (bl) = NULL;
+  BLOCK_NAMESPACE (bl) = NULL;
+  BLOCK_GCC_COMPILED (bl) = 0;
+
+  return bl;
+}
This page took 0.024482 seconds and 4 git commands to generate.