aboutsummaryrefslogtreecommitdiff
path: root/gdb/addrmap.h
diff options
context:
space:
mode:
authorDoug Evans <dje@google.com>2010-10-07 17:02:14 +0000
committerDoug Evans <dje@google.com>2010-10-07 17:02:14 +0000
commit855c153ff2998d1b306a15a8e01ad9ea26e47532 (patch)
tree09f618ea7194ebb38123a53d670a35a9ab60a6ec /gdb/addrmap.h
parent94e482001fa9d7a85e52f0be277cac380243a74e (diff)
downloadbinutils-855c153ff2998d1b306a15a8e01ad9ea26e47532.zip
binutils-855c153ff2998d1b306a15a8e01ad9ea26e47532.tar.gz
binutils-855c153ff2998d1b306a15a8e01ad9ea26e47532.tar.bz2
* addrmap.h (addrmap_foreach_fn): New typedef.
(addrmap_foreach): Declare. * addrmap.c (struct addrmap_funcs): New member foreach. (addrmap_foreach): New function. (addrmap_fixed_foreach): New function. (addrmap_fixed_funcs): Update. (struct mutable_foreach_data): New struct. (addrmap_mutable_foreach_worker): New function. (addrmap_mutable_foreach): New function. (addrmap_mutable_funcs): Update.
Diffstat (limited to 'gdb/addrmap.h')
-rw-r--r--gdb/addrmap.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/gdb/addrmap.h b/gdb/addrmap.h
index 96d4e08..7ec5447 100644
--- a/gdb/addrmap.h
+++ b/gdb/addrmap.h
@@ -91,4 +91,15 @@ struct addrmap *addrmap_create_fixed (struct addrmap *original,
to either mutable or immutable maps.) */
void addrmap_relocate (struct addrmap *map, CORE_ADDR offset);
+/* The type of a function used to iterate over the map.
+ OBJ is NULL for unmapped regions. */
+typedef int (*addrmap_foreach_fn) (void *data, CORE_ADDR start_addr,
+ void *obj);
+
+/* Call FN, passing it DATA, for every address in MAP, following an
+ in-order traversal. If FN ever returns a non-zero value, the
+ iteration ceases immediately, and the value is returned.
+ Otherwise, this function returns 0. */
+int addrmap_foreach (struct addrmap *map, addrmap_foreach_fn fn, void *data);
+
#endif /* ADDRMAP_H */