GDB (API)
|
00001 /* The memory range data structure, and associated utilities. 00002 00003 Copyright (C) 2010-2013 Free Software Foundation, Inc. 00004 00005 This file is part of GDB. 00006 00007 This program is free software; you can redistribute it and/or modify 00008 it under the terms of the GNU General Public License as published by 00009 the Free Software Foundation; either version 3 of the License, or 00010 (at your option) any later version. 00011 00012 This program is distributed in the hope that it will be useful, 00013 but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 GNU General Public License for more details. 00016 00017 You should have received a copy of the GNU General Public License 00018 along with this program. If not, see <http://www.gnu.org/licenses/>. */ 00019 00020 #ifndef MEMRANGE_H 00021 #define MEMRANGE_H 00022 00023 #include "vec.h" 00024 00025 /* Defines a [START, START + LENGTH) memory range. */ 00026 00027 struct mem_range 00028 { 00029 /* Lowest address in the range. */ 00030 CORE_ADDR start; 00031 00032 /* Length of the range. */ 00033 int length; 00034 }; 00035 00036 typedef struct mem_range mem_range_s; 00037 00038 DEF_VEC_O(mem_range_s); 00039 00040 /* Returns true if the ranges defined by [start1, start1+len1) and 00041 [start2, start2+len2) overlap. */ 00042 00043 extern int mem_ranges_overlap (CORE_ADDR start1, int len1, 00044 CORE_ADDR start2, int len2); 00045 00046 /* Sort ranges by start address, then coalesce contiguous or 00047 overlapping ranges. */ 00048 00049 extern void normalize_mem_ranges (VEC(mem_range_s) *memory); 00050 00051 #endif