summaryrefslogtreecommitdiffstats
path: root/libmemunreachable
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2016-03-04 16:37:02 -0800
committerColin Cross <ccross@android.com>2016-03-07 15:52:39 -0800
commit0f10562b56d40c7d2d895e7dba36492cb43919be (patch)
tree0e03ad3eea9b0cf4efd5e583517236eec3916167 /libmemunreachable
parentc1228c7f2b21c3a21e462a48eb49e3ccfd2290d9 (diff)
downloadcore-0f10562b56d40c7d2d895e7dba36492cb43919be.tar.gz
core-0f10562b56d40c7d2d895e7dba36492cb43919be.tar.bz2
core-0f10562b56d40c7d2d895e7dba36492cb43919be.zip
Add ABI to leak report
Add the ABI to the leak report so that it can be piped through development/scripts/stack. Bug: 27208635 Change-Id: I2e050a377305d48d2f904f34ea921f64e13dd00e (cherry picked from commit 11185af983f955f5c5d59c15e1a96ac610a528be)
Diffstat (limited to 'libmemunreachable')
-rw-r--r--libmemunreachable/MemUnreachable.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/libmemunreachable/MemUnreachable.cpp b/libmemunreachable/MemUnreachable.cpp
index a8be855f9..ac19a6615 100644
--- a/libmemunreachable/MemUnreachable.cpp
+++ b/libmemunreachable/MemUnreachable.cpp
@@ -468,11 +468,30 @@ std::string Leak::ToString(bool log_contents) const {
return oss.str();
}
+// Figure out the abi based on defined macros.
+#if defined(__arm__)
+#define ABI_STRING "arm"
+#elif defined(__aarch64__)
+#define ABI_STRING "arm64"
+#elif defined(__mips__) && !defined(__LP64__)
+#define ABI_STRING "mips"
+#elif defined(__mips__) && defined(__LP64__)
+#define ABI_STRING "mips64"
+#elif defined(__i386__)
+#define ABI_STRING "x86"
+#elif defined(__x86_64__)
+#define ABI_STRING "x86_64"
+#else
+#error "Unsupported ABI"
+#endif
+
std::string UnreachableMemoryInfo::ToString(bool log_contents) const {
std::ostringstream oss;
oss << " " << leak_bytes << " bytes in ";
oss << num_leaks << " unreachable allocation" << plural(num_leaks);
oss << std::endl;
+ oss << " ABI: '" ABI_STRING "'" << std::endl;
+ oss << std::endl;
for (auto it = leaks.begin(); it != leaks.end(); it++) {
oss << it->ToString(log_contents);