X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=gdb%2Fblock.c;h=1360a1589d0f36fa079d7f688f5d7bdff71ebccf;hb=89a9d1b1639d01840668fbc6937f79c433fad24b;hp=7bfd866384860cc6010dedeb8fd8c67c04c2559f;hpb=eed3f8ab355ca0aa9a240d1f9eabb4320b959851;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/block.c b/gdb/block.c index 7bfd866384..1360a1589d 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; +}