diff options
author | David Carlton <carlton@bactrian.org> | 2003-05-20 01:26:58 +0000 |
---|---|---|
committer | David Carlton <carlton@bactrian.org> | 2003-05-20 01:26:58 +0000 |
commit | 4af17108f2894052611290bd4c7179317ba3d450 (patch) | |
tree | eef2929b985ff79744604a14cbb29c82f4718231 /gdb/block.c | |
parent | 3ab3143f58d91bb07b238c063076b0dd63d441cb (diff) | |
download | gdb-4af17108f2894052611290bd4c7179317ba3d450.tar.gz |
2003-05-19 David Carlton <carlton@bactrian.org>
* block.h: Declare block_static_block.
* block.c (block_static_block): New.
* symtab.c (lookup_symbol_aux): Remove 'static_block' argument to
lookup_symbol_aux_local, calling block_static_block instead.
(lookup_symbol_aux_local): Delete 'static_block' argument.
Diffstat (limited to 'gdb/block.c')
-rw-r--r-- | gdb/block.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/gdb/block.c b/gdb/block.c index 7bfd8663848..1360a1589d0 100644 --- a/gdb/block.c +++ b/gdb/block.c @@ -199,3 +199,18 @@ block_initialize_namespace (struct block *block, struct obstack *obstack) BLOCK_NAMESPACE (block)->using = NULL; } } + +/* Return the static block associated to BLOCK. Return NULL if block + is NULL or if block is a global block. */ + +const struct block * +block_static_block (const struct block *block) +{ + if (block == NULL || BLOCK_SUPERBLOCK (block) == NULL) + return NULL; + + while (BLOCK_SUPERBLOCK (BLOCK_SUPERBLOCK (block)) != NULL) + block = BLOCK_SUPERBLOCK (block); + + return block; +} |