Index: util/numeric/checked_address_range.cc |
diff --git a/util/numeric/checked_address_range.cc b/util/numeric/checked_address_range.cc |
index dcbde23e72ea6f6d9c6f7c687cd77a7e63cf96e5..1d50696f6e3a486490aeba31b6aca63f09bced8e 100644 |
--- a/util/numeric/checked_address_range.cc |
+++ b/util/numeric/checked_address_range.cc |
@@ -14,6 +14,8 @@ |
#include "util/numeric/checked_address_range.h" |
+#include "base/strings/stringprintf.h" |
+ |
#if defined(OS_MACOSX) |
#include <mach/mach.h> |
#elif defined(OS_WIN) |
@@ -109,6 +111,12 @@ bool CheckedAddressRangeGeneric<ValueType, SizeType>::ContainsRange( |
: range_32_.ContainsRange(that.range_32_); |
} |
+template <class ValueType, class SizeType> |
+std::string CheckedAddressRangeGeneric<ValueType, SizeType>::AsString() const { |
+ return base::StringPrintf( |
+ "0x%llx + 0x%llx (%s)", Base(), Size(), Is64Bit() ? "64" : "32"); |
+} |
+ |
// Explicit instantiations for the cases we use. |
#if defined(OS_MACOSX) |
template class CheckedAddressRangeGeneric<mach_vm_address_t, mach_vm_size_t>; |