summaryrefslogtreecommitdiff
path: root/gdb/addrmap.h
diff options
context:
space:
mode:
authorDoug Evans <dje@google.com>2010-10-07 17:02:06 +0000
committerDoug Evans <dje@google.com>2010-10-07 17:02:06 +0000
commit6f62fad7e30dbb269e40bd71957e88e35e4c1d90 (patch)
treec07674aedb731c89c8e1e51a0d60a388c0c41261 /gdb/addrmap.h
parent0e7a75f6f7e3894d9574bb5e3b0fe9ca5e2ea0e6 (diff)
downloadgdb-6f62fad7e30dbb269e40bd71957e88e35e4c1d90.tar.gz
* 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 96d4e08a807..7ec5447ce5e 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 */