summaryrefslogtreecommitdiff
path: root/gdb/block.h
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2012-05-10 20:03:59 +0000
committerTom Tromey <tromey@redhat.com>2012-05-10 20:03:59 +0000
commit231f22020d5c27da9088a0fc9ff8ca9e7a3e1c24 (patch)
treef2b6cbe17cd4e7f08b5666ba956a33da3d2292c2 /gdb/block.h
parentacd8b956f985b1cb4ceec33b64d5be4e4bc2f973 (diff)
downloadgdb-231f22020d5c27da9088a0fc9ff8ca9e7a3e1c24.tar.gz
* symtab.h (struct symtab) <includes, user>: New fields.
* block.h (struct block_iterator) <d, idx, which>: New fields. * block.c (initialize_block_iterator, find_iterator_symtab) (block_iterator_step, block_iter_name_step) (block_iter_match_step): New functions. (block_iterator_first, block_iterator_next) (block_iter_name_first, block_iter_name_next) (block_iter_match_first, block_iter_match_next): Rewrite. (get_block_symtab): New function.
Diffstat (limited to 'gdb/block.h')
-rw-r--r--gdb/block.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/gdb/block.h b/gdb/block.h
index de674a86653..b4f92f3eb62 100644
--- a/gdb/block.h
+++ b/gdb/block.h
@@ -186,6 +186,28 @@ extern void set_block_symtab (struct block *, struct symtab *);
struct block_iterator
{
+ /* If we're iterating over a single block, this holds the block.
+ Otherwise, it holds the canonical symtab. */
+
+ union
+ {
+ struct symtab *symtab;
+ const struct block *block;
+ } d;
+
+ /* If we're iterating over a single block, this is always -1.
+ Otherwise, it holds the index of the current "included" symtab in
+ the canonical symtab (that is, d.symtab->includes[idx]), with -1
+ meaning the canonical symtab itself. */
+
+ int idx;
+
+ /* Which block, either static or global, to iterate over. If this
+ is FIRST_LOCAL_BLOCK, then we are iterating over a single block.
+ This is used to select which field of 'd' is in use. */
+
+ enum block_enum which;
+
/* The underlying dictionary iterator. */
struct dict_iterator dict_iter;