summaryrefslogtreecommitdiff
path: root/gdb/block.h
diff options
context:
space:
mode:
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 e8d34528ecd..50a79198969 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 */