Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(725)

Unified Diff: util/numeric/checked_address_range.cc

Issue 1475023004: Get module versions and types from in-memory images (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: Address review feedback (2) Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « util/numeric/checked_address_range.h ('k') | util/win/module_version.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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>;
« no previous file with comments | « util/numeric/checked_address_range.h ('k') | util/win/module_version.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698