summaryrefslogtreecommitdiffstats
path: root/runtime/mem_map.cc
diff options
context:
space:
mode:
authorMathieu Chartier <mathieuc@google.com>2013-11-13 13:26:07 -0800
committerMathieu Chartier <mathieuc@google.com>2013-11-13 13:32:42 -0800
commit3b6f0fae76fddf81930a263a075dc87b6039b7fc (patch)
treeaafa3fa3bfa31a2d5f1f3b407e59b704a4180a77 /runtime/mem_map.cc
parent34e82934546bd470283346907bd7b74990797c56 (diff)
downloadart-3b6f0fae76fddf81930a263a075dc87b6039b7fc.tar.gz
art-3b6f0fae76fddf81930a263a075dc87b6039b7fc.tar.bz2
art-3b6f0fae76fddf81930a263a075dc87b6039b7fc.zip
Add more logging when mmap fails.
We now print the reason that the mmap failed. Change-Id: Ie515e4bba117c9ea1f4297abb826d32172bea962
Diffstat (limited to 'runtime/mem_map.cc')
-rw-r--r--runtime/mem_map.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/runtime/mem_map.cc b/runtime/mem_map.cc
index 3afb6065b6..39e838f457 100644
--- a/runtime/mem_map.cc
+++ b/runtime/mem_map.cc
@@ -133,12 +133,13 @@ MemMap* MemMap::MapFileAtAddress(byte* addr, size_t byte_count, int prot, int fl
fd,
page_aligned_offset));
if (actual == MAP_FAILED) {
+ std::string strerr(strerror(errno));
std::string maps;
ReadFileToString("/proc/self/maps", &maps);
- *error_msg = StringPrintf("mmap(%p, %zd, %x, %x, %d, %lld) of file '%s' failed\n%s",
+ *error_msg = StringPrintf("mmap(%p, %zd, %x, %x, %d, %lld) of file '%s' failed: %s\n%s",
page_aligned_addr, page_aligned_byte_count, prot, flags, fd,
- static_cast<int64_t>(page_aligned_offset),
- filename, maps.c_str());
+ static_cast<int64_t>(page_aligned_offset), filename, strerr.c_str(),
+ maps.c_str());
return NULL;
}
return new MemMap("file", actual + page_offset, byte_count, actual, page_aligned_byte_count,