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 | 89a9d1b1639d01840668fbc6937f79c433fad24b (patch) | |
tree | 384a21964db566f0d8280993e06f4bce55d88b7c /gdb/block.c | |
parent | eed3f8ab355ca0aa9a240d1f9eabb4320b959851 (diff) | |
download | gdb-89a9d1b1639d01840668fbc6937f79c433fad24b.zip gdb-89a9d1b1639d01840668fbc6937f79c433fad24b.tar.gz gdb-89a9d1b1639d01840668fbc6937f79c433fad24b.tar.bz2 |
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 7bfd866..1360a15 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; +} |