gdb/memrange.h - gdb

Global variables defined

Data types defined

Macros defined

Source code

  1. /* The memory range data structure, and associated utilities.

  2.    Copyright (C) 2010-2015 Free Software Foundation, Inc.

  3.    This file is part of GDB.

  4.    This program is free software; you can redistribute it and/or modify
  5.    it under the terms of the GNU General Public License as published by
  6.    the Free Software Foundation; either version 3 of the License, or
  7.    (at your option) any later version.

  8.    This program is distributed in the hope that it will be useful,
  9.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  10.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  11.    GNU General Public License for more details.

  12.    You should have received a copy of the GNU General Public License
  13.    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */

  14. #ifndef MEMRANGE_H
  15. #define MEMRANGE_H

  16. #include "vec.h"

  17. /* Defines a [START, START + LENGTH) memory range.  */

  18. struct mem_range
  19. {
  20.   /* Lowest address in the range.  */
  21.   CORE_ADDR start;

  22.   /* Length of the range.  */
  23.   int length;
  24. };

  25. typedef struct mem_range mem_range_s;

  26. DEF_VEC_O(mem_range_s);

  27. /* Returns true if the ranges defined by [start1, start1+len1) and
  28.    [start2, start2+len2) overlap.  */

  29. extern int mem_ranges_overlap (CORE_ADDR start1, int len1,
  30.                                CORE_ADDR start2, int len2);

  31. /* Returns true if ADDR is in RANGE.  */

  32. extern int address_in_mem_range (CORE_ADDR addr,
  33.                                  const struct mem_range *range);

  34. /* Sort ranges by start address, then coalesce contiguous or
  35.    overlapping ranges.  */

  36. extern void normalize_mem_ranges (VEC(mem_range_s) *memory);

  37. #endif