gdb: fix vfork with multiple threads
[deliverable/binutils-gdb.git] / gdb / addrmap.h
index 96d4e08a807bc9f6c81c4953aede658ad9246c79..4b1a59684b11abc421377ac33c13b62306449a09 100644 (file)
@@ -1,6 +1,6 @@
 /* addrmap.h --- interface to address map data structure.
 
-   Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+   Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -20,6 +20,8 @@
 #ifndef ADDRMAP_H
 #define ADDRMAP_H
 
+#include "gdbsupport/function-view.h"
+
 /* An address map is essentially a table mapping CORE_ADDRs onto GDB
    data structures, like blocks, symtabs, partial symtabs, and so on.
    An address map uses memory proportional to the number of
@@ -76,8 +78,8 @@ struct addrmap *addrmap_create_mutable (struct obstack *obstack);
    implemented efficiently, but doesn't reveal too much of the
    representation.  */
 void addrmap_set_empty (struct addrmap *map,
-                        CORE_ADDR start, CORE_ADDR end_inclusive,
-                        void *obj);
+                       CORE_ADDR start, CORE_ADDR end_inclusive,
+                       void *obj);
 
 /* Return the object associated with ADDR in MAP.  */
 void *addrmap_find (struct addrmap *map, CORE_ADDR addr);
@@ -85,10 +87,21 @@ void *addrmap_find (struct addrmap *map, CORE_ADDR addr);
 /* Create a fixed address map which is a copy of the mutable address
    map ORIGINAL.  Allocate entries in OBSTACK.  */
 struct addrmap *addrmap_create_fixed (struct addrmap *original,
-                                      struct obstack *obstack);
+                                     struct obstack *obstack);
 
 /* Relocate all the addresses in MAP by OFFSET.  (This can be applied
    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 gdb::function_view<int (CORE_ADDR start_addr, void *obj)>
+     addrmap_foreach_fn;
+
+/* Call FN 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);
+
 #endif /* ADDRMAP_H */
This page took 0.025061 seconds and 4 git commands to generate.