summaryrefslogtreecommitdiffstats
path: root/lldb/source/Core/VMRange.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Core/VMRange.cpp')
-rw-r--r--lldb/source/Core/VMRange.cpp135
1 files changed, 60 insertions, 75 deletions
diff --git a/lldb/source/Core/VMRange.cpp b/lldb/source/Core/VMRange.cpp
index 902489e1ff3..8d21f4b1273 100644
--- a/lldb/source/Core/VMRange.cpp
+++ b/lldb/source/Core/VMRange.cpp
@@ -16,97 +16,82 @@
using namespace lldb;
using namespace lldb_private;
-bool
-VMRange::ContainsValue(const VMRange::collection& coll, lldb::addr_t value)
-{
- ValueInRangeUnaryPredicate in_range_predicate(value);
- VMRange::const_iterator pos;
- VMRange::const_iterator end = coll.end();
- pos = std::find_if( coll.begin(), end, in_range_predicate );
- if (pos != end)
- return true;
- return false;
+bool VMRange::ContainsValue(const VMRange::collection &coll,
+ lldb::addr_t value) {
+ ValueInRangeUnaryPredicate in_range_predicate(value);
+ VMRange::const_iterator pos;
+ VMRange::const_iterator end = coll.end();
+ pos = std::find_if(coll.begin(), end, in_range_predicate);
+ if (pos != end)
+ return true;
+ return false;
}
-bool
-VMRange::ContainsRange(const VMRange::collection& coll, const VMRange& range)
-{
- RangeInRangeUnaryPredicate in_range_predicate(range);
- VMRange::const_iterator pos;
- VMRange::const_iterator end = coll.end();
- pos = std::find_if( coll.begin(), end, in_range_predicate );
- if (pos != end)
- return true;
- return false;
+bool VMRange::ContainsRange(const VMRange::collection &coll,
+ const VMRange &range) {
+ RangeInRangeUnaryPredicate in_range_predicate(range);
+ VMRange::const_iterator pos;
+ VMRange::const_iterator end = coll.end();
+ pos = std::find_if(coll.begin(), end, in_range_predicate);
+ if (pos != end)
+ return true;
+ return false;
}
-size_t
-VMRange::FindRangeIndexThatContainsValue (const VMRange::collection& coll, lldb::addr_t value)
-{
- ValueInRangeUnaryPredicate in_range_predicate(value);
- VMRange::const_iterator begin = coll.begin();
- VMRange::const_iterator end = coll.end();
- VMRange::const_iterator pos = std::find_if (begin, end, in_range_predicate);
- if (pos != end)
- return std::distance (begin, pos);
- return UINT32_MAX;
+size_t VMRange::FindRangeIndexThatContainsValue(const VMRange::collection &coll,
+ lldb::addr_t value) {
+ ValueInRangeUnaryPredicate in_range_predicate(value);
+ VMRange::const_iterator begin = coll.begin();
+ VMRange::const_iterator end = coll.end();
+ VMRange::const_iterator pos = std::find_if(begin, end, in_range_predicate);
+ if (pos != end)
+ return std::distance(begin, pos);
+ return UINT32_MAX;
}
-void
-VMRange::Dump(Stream *s, lldb::addr_t offset, uint32_t addr_width) const
-{
- s->AddressRange(offset + GetBaseAddress(), offset + GetEndAddress(), addr_width);
+void VMRange::Dump(Stream *s, lldb::addr_t offset, uint32_t addr_width) const {
+ s->AddressRange(offset + GetBaseAddress(), offset + GetEndAddress(),
+ addr_width);
}
-bool
-lldb_private::operator== (const VMRange& lhs, const VMRange& rhs)
-{
- return lhs.GetBaseAddress() == rhs.GetBaseAddress() && lhs.GetEndAddress() == rhs.GetEndAddress();
+bool lldb_private::operator==(const VMRange &lhs, const VMRange &rhs) {
+ return lhs.GetBaseAddress() == rhs.GetBaseAddress() &&
+ lhs.GetEndAddress() == rhs.GetEndAddress();
}
-bool
-lldb_private::operator!= (const VMRange& lhs, const VMRange& rhs)
-{
- return lhs.GetBaseAddress() != rhs.GetBaseAddress() || lhs.GetEndAddress() != rhs.GetEndAddress();
+bool lldb_private::operator!=(const VMRange &lhs, const VMRange &rhs) {
+ return lhs.GetBaseAddress() != rhs.GetBaseAddress() ||
+ lhs.GetEndAddress() != rhs.GetEndAddress();
}
-bool
-lldb_private::operator< (const VMRange& lhs, const VMRange& rhs)
-{
- if (lhs.GetBaseAddress() < rhs.GetBaseAddress())
- return true;
- else if (lhs.GetBaseAddress() > rhs.GetBaseAddress())
- return false;
- return lhs.GetEndAddress() < rhs.GetEndAddress();
+bool lldb_private::operator<(const VMRange &lhs, const VMRange &rhs) {
+ if (lhs.GetBaseAddress() < rhs.GetBaseAddress())
+ return true;
+ else if (lhs.GetBaseAddress() > rhs.GetBaseAddress())
+ return false;
+ return lhs.GetEndAddress() < rhs.GetEndAddress();
}
-bool
-lldb_private::operator<= (const VMRange& lhs, const VMRange& rhs)
-{
- if (lhs.GetBaseAddress() < rhs.GetBaseAddress())
- return true;
- else if (lhs.GetBaseAddress() > rhs.GetBaseAddress())
- return false;
- return lhs.GetEndAddress() <= rhs.GetEndAddress();
+bool lldb_private::operator<=(const VMRange &lhs, const VMRange &rhs) {
+ if (lhs.GetBaseAddress() < rhs.GetBaseAddress())
+ return true;
+ else if (lhs.GetBaseAddress() > rhs.GetBaseAddress())
+ return false;
+ return lhs.GetEndAddress() <= rhs.GetEndAddress();
}
-bool
-lldb_private::operator> (const VMRange& lhs, const VMRange& rhs)
-{
- if (lhs.GetBaseAddress() > rhs.GetBaseAddress())
- return true;
- else if (lhs.GetBaseAddress() < rhs.GetBaseAddress())
- return false;
- return lhs.GetEndAddress() > rhs.GetEndAddress();
+bool lldb_private::operator>(const VMRange &lhs, const VMRange &rhs) {
+ if (lhs.GetBaseAddress() > rhs.GetBaseAddress())
+ return true;
+ else if (lhs.GetBaseAddress() < rhs.GetBaseAddress())
+ return false;
+ return lhs.GetEndAddress() > rhs.GetEndAddress();
}
-bool
-lldb_private::operator>= (const VMRange& lhs, const VMRange& rhs)
-{
- if (lhs.GetBaseAddress() > rhs.GetBaseAddress())
- return true;
- else if (lhs.GetBaseAddress() < rhs.GetBaseAddress())
- return false;
- return lhs.GetEndAddress() >= rhs.GetEndAddress();
+bool lldb_private::operator>=(const VMRange &lhs, const VMRange &rhs) {
+ if (lhs.GetBaseAddress() > rhs.GetBaseAddress())
+ return true;
+ else if (lhs.GetBaseAddress() < rhs.GetBaseAddress())
+ return false;
+ return lhs.GetEndAddress() >= rhs.GetEndAddress();
}
-
OpenPOWER on IntegriCloud