gdb: fix python/lib/gdb/__init__.py formatting
[deliverable/binutils-gdb.git] / gdb / addrmap.h
index 8fa18732bb5c6627175b84f3ddfca69c446cb6e2..bcefc004a031f6cac839de11476a6303d7694638 100644 (file)
@@ -1,12 +1,12 @@
 /* addrmap.h --- interface to address map data structure.
 
-   Copyright (C) 2007 Free Software Foundation, Inc.
+   Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2 of the License, or
+   the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.
 
    This program is distributed in the hope that it will be useful,
@@ -15,9 +15,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 51 Franklin Street, Fifth Floor,
-   Boston, MA 02110-1301, USA.  */
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #ifndef ADDRMAP_H
 #define ADDRMAP_H
@@ -65,7 +63,7 @@ struct addrmap *addrmap_create_mutable (struct obstack *obstack);
    (and isn't the lexical block for a function's body), we omit it
    from GDB's data structures entirely.
 
-   However, this menas that we don't decide to create a block (and
+   However, this means that we don't decide to create a block (and
    thus record it in the address map) until after we've traversed its
    children.  If we do decide to create the block, we do so at a time
    when all its children have already been recorded in the map.  So
@@ -78,8 +76,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);
@@ -87,10 +85,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 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 */
This page took 0.02589 seconds and 4 git commands to generate.