aboutsummaryrefslogtreecommitdiff
path: root/gdb/block.h
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2012-05-10 20:04:00 +0000
committerTom Tromey <tromey@redhat.com>2012-05-10 20:04:00 +0000
commitb5b04b5b7ad009488a07a945e28001edaf5809b5 (patch)
tree5ee1043f1d58f9eff095b23564e3aa4ad9452179 /gdb/block.h
parent84a146c9d3fdfcd4a45b12f88735bd77d4f8d729 (diff)
downloadbinutils-b5b04b5b7ad009488a07a945e28001edaf5809b5.zip
binutils-b5b04b5b7ad009488a07a945e28001edaf5809b5.tar.gz
binutils-b5b04b5b7ad009488a07a945e28001edaf5809b5.tar.bz2
* 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 de674a8..b4f92f3 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;