gdb: add target_ops::supports_displaced_step
[deliverable/binutils-gdb.git] / gdb / memrange.h
index 3a29f7da07a11e3bb59a4b1d9babef1062c06490..a8d4092b46ce20360a72637030b6786370ea0a46 100644 (file)
@@ -1,6 +1,6 @@
 /* The memory range data structure, and associated utilities.
 
-   Copyright (C) 2010-2016 Free Software Foundation, Inc.
+   Copyright (C) 2010-2020 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
 #ifndef MEMRANGE_H
 #define MEMRANGE_H
 
-#include "vec.h"
-
 /* Defines a [START, START + LENGTH) memory range.  */
 
 struct mem_range
 {
+  mem_range () = default;
+
+  mem_range (CORE_ADDR start_, int length_)
+  : start (start_), length (length_)
+  {}
+
+  bool operator< (const mem_range &other) const
+  {
+    return this->start < other.start;
+  }
+
+  bool operator== (const mem_range &other) const
+  {
+    return (this->start == other.start
+           && this->length == other.length);
+  }
+
   /* Lowest address in the range.  */
   CORE_ADDR start;
 
@@ -33,10 +48,6 @@ struct mem_range
   int length;
 };
 
-typedef struct mem_range mem_range_s;
-
-DEF_VEC_O(mem_range_s);
-
 /* Returns true if the ranges defined by [start1, start1+len1) and
    [start2, start2+len2) overlap.  */
 
@@ -51,6 +62,6 @@ extern int address_in_mem_range (CORE_ADDR addr,
 /* Sort ranges by start address, then coalesce contiguous or
    overlapping ranges.  */
 
-extern void normalize_mem_ranges (VEC(mem_range_s) *memory);
+extern void normalize_mem_ranges (std::vector<mem_range> *memory);
 
 #endif
This page took 0.026246 seconds and 4 git commands to generate.