aboutsummaryrefslogtreecommitdiff
path: root/gdb/block.h
diff options
context:
space:
mode:
authorDoug Evans <xdje42@gmail.com>2014-11-06 22:50:12 -0800
committerDoug Evans <xdje42@gmail.com>2014-11-06 22:50:12 -0800
commit358d6ab39c95691e721820fd54e9780208faf252 (patch)
tree202ffc1baa8eefa831df7e716f707ad08697722c /gdb/block.h
parent16b2eaa164b48aa0529304eec38102f1c60578be (diff)
downloadgdb-358d6ab39c95691e721820fd54e9780208faf252.zip
gdb-358d6ab39c95691e721820fd54e9780208faf252.tar.gz
gdb-358d6ab39c95691e721820fd54e9780208faf252.tar.bz2
New macro ALL_BLOCK_SYMBOLS_WITH_NAME.
gdb/ChangeLog: * block.h (ALL_BLOCK_SYMBOLS_WITH_NAME): New macro. * block.c (block_lookup_symbol): Use it. * cp-support.c (make_symbol_overload_list_block): Use it. * symtab.c (iterate_over_symbols): Use it.
Diffstat (limited to 'gdb/block.h')
-rw-r--r--gdb/block.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/gdb/block.h b/gdb/block.h
index e8d3452..50a7919 100644
--- a/gdb/block.h
+++ b/gdb/block.h
@@ -286,4 +286,13 @@ extern struct symbol *block_lookup_symbol (const struct block *block,
(sym); \
(sym) = block_iterator_next (&(iter)))
+/* Macro to loop through all symbols with name NAME in BLOCK,
+ in no particular order. ITER helps keep track of the iteration, and
+ must be a struct block_iterator. SYM points to the current symbol. */
+
+#define ALL_BLOCK_SYMBOLS_WITH_NAME(block, name, iter, sym) \
+ for ((sym) = block_iter_name_first ((block), (name), &(iter)); \
+ (sym) != NULL; \
+ (sym) = block_iter_name_next ((name), &(iter)))
+
#endif /* BLOCK_H */