aboutsummaryrefslogtreecommitdiff
path: root/gdb/block.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2012-05-10 19:59:12 +0000
committerTom Tromey <tromey@redhat.com>2012-05-10 19:59:12 +0000
commit84a146c9d3fdfcd4a45b12f88735bd77d4f8d729 (patch)
tree1af7348130cfb4bd51a0f2f3cf6955c4de6688fe /gdb/block.c
parent9439a077bef75279f4881cabc3adbe61cf057504 (diff)
downloadgdb-84a146c9d3fdfcd4a45b12f88735bd77d4f8d729.zip
gdb-84a146c9d3fdfcd4a45b12f88735bd77d4f8d729.tar.gz
gdb-84a146c9d3fdfcd4a45b12f88735bd77d4f8d729.tar.bz2
* jv-lang.c (get_java_class_symtab): Use allocate_global_block,
set_block_symtab. * jit.c (finalize_symtab): Use allocate_global_block, set_block_symtab. * buildsym.c (finish_block_internal): New function, from old finish_block. (finish_block): Rewrite. (end_symtab): Use finish_block_internal, set_block_symtab. * block.h (struct global_block): New. (allocate_global_block, set_block_symtab): Declare. * block.c (allocate_global_block, set_block_symtab): New functions.
Diffstat (limited to 'gdb/block.c')
-rw-r--r--gdb/block.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/gdb/block.c b/gdb/block.c
index 3318cb4..d3bc5ea 100644
--- a/gdb/block.c
+++ b/gdb/block.c
@@ -370,6 +370,29 @@ allocate_block (struct obstack *obstack)
return bl;
}
+/* Allocate a global block. */
+
+struct block *
+allocate_global_block (struct obstack *obstack)
+{
+ struct global_block *bl = OBSTACK_ZALLOC (obstack, struct global_block);
+
+ return &bl->block;
+}
+
+/* Set the symtab of the global block. */
+
+void
+set_block_symtab (struct block *block, struct symtab *symtab)
+{
+ struct global_block *gb;
+
+ gdb_assert (BLOCK_SUPERBLOCK (block) == NULL);
+ gb = (struct global_block *) block;
+ gdb_assert (gb->symtab == NULL);
+ gb->symtab = symtab;
+}
+
/* See block.h. */