diff options
author | Tom Tromey <tom@tromey.com> | 2023-01-19 18:36:17 -0700 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2023-02-19 12:51:06 -0700 |
commit | 0688bf443c618be0a4a22cbc7ffb802dd771801c (patch) | |
tree | 443feb429581ebd8819a0a32dcbde0bd1f0fd443 /gdb/block.h | |
parent | 7bf30a4447713192eb49be43d7f66630d570652b (diff) | |
download | gdb-0688bf443c618be0a4a22cbc7ffb802dd771801c.zip gdb-0688bf443c618be0a4a22cbc7ffb802dd771801c.tar.gz gdb-0688bf443c618be0a4a22cbc7ffb802dd771801c.tar.bz2 |
Store 'name' in block_iterator
This changes the block_iterator to store the 'name' that is used by
block_iter_match_next. This avoids any problem where the name could
be passed inconsistently, and also makes the subsequent patches easier
to understand.
Diffstat (limited to 'gdb/block.h')
-rw-r--r-- | gdb/block.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/gdb/block.h b/gdb/block.h index 9bc8049..5fc41c6 100644 --- a/gdb/block.h +++ b/gdb/block.h @@ -449,6 +449,9 @@ struct block_iterator const struct block *block; } d; + /* If we're trying to match a name, this will be non-NULL. */ + const lookup_name_info *name; + /* 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 @@ -493,10 +496,9 @@ extern struct symbol *block_iter_match_first (const struct block *block, symbols. Don't call this if you've previously received NULL from block_iterator_match_first or block_iterator_match_next on this iteration. And don't call it unless ITERATOR was created by a - previous call to block_iter_match_first with the same NAME. */ + previous call to block_iter_match_first. */ -extern struct symbol *block_iter_match_next - (const lookup_name_info &name, struct block_iterator *iterator); +extern struct symbol *block_iter_match_next (struct block_iterator *iterator); /* Return true if symbol A is the best match possible for DOMAIN. */ @@ -574,7 +576,7 @@ extern int block_find_non_opaque_type_preferred (struct symbol *sym, #define ALL_BLOCK_SYMBOLS_WITH_NAME(block, name, iter, sym) \ for ((sym) = block_iter_match_first ((block), (name), &(iter)); \ (sym) != NULL; \ - (sym) = block_iter_match_next ((name), &(iter))) + (sym) = block_iter_match_next (&(iter))) /* Given a vector of pairs, allocate and build an obstack allocated blockranges struct for a block. */ |