Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[mc] Remove a ugly special case in LocationListEntry
authorGabriel Corona <gabriel.corona@loria.fr>
Tue, 23 Feb 2016 15:46:35 +0000 (16:46 +0100)
committerGabriel Corona <gabriel.corona@loria.fr>
Tue, 23 Feb 2016 15:46:35 +0000 (16:46 +0100)
src/mc/LocationList.cpp
src/mc/LocationList.hpp

index 7ce1b1e..aabcab5 100644 (file)
@@ -96,7 +96,7 @@ LocationList location_list(
     LocationListEntry::range_type range;
     if (start == 0)
       // If start == 0, this is not a location list:
-      range = {0, 0};
+      range = { 0, UINT64_MAX };
     else
       range =  { base_address + start, base_address + end };
 
index 289a2c1..57326a0 100644 (file)
@@ -32,14 +32,14 @@ public:
   typedef simgrid::xbt::range<std::uint64_t> range_type;
 private:
   DwarfExpression expression_;
-  range_type range_ = {0, 0};
+  range_type range_ = {0, UINT64_MAX};
 public:
   LocationListEntry() {}
   LocationListEntry(DwarfExpression expression, range_type range)
     : expression_(std::move(expression)), range_(range)
   {}
   LocationListEntry(DwarfExpression expression)
-    : expression_(std::move(expression)), range_({0, 0})
+    : expression_(std::move(expression)), range_({0, UINT64_MAX})
   {}
 
   DwarfExpression& expression()
@@ -50,13 +50,9 @@ public:
   {
     return expression_;
   }
-  bool always_valid() const
-  {
-    return range_.begin() == 0 && range_.end() == 0;
-  }
   bool valid_for_ip(unw_word_t ip) const
   {
-    return always_valid() || range_.contain(ip);
+    return range_.contain(ip);
   }
 };