Include the name of the source when extracting classes.dex in memory.
This should make it easier to understand crashes from the log.
Change-Id: Ic1d1214da3b8340aa685431439c16cfac9746029
diff --git a/src/dex_file.cc b/src/dex_file.cc
index e599268..31a7d10 100644
--- a/src/dex_file.cc
+++ b/src/dex_file.cc
@@ -144,10 +144,9 @@
}
uint32_t length = zip_entry->GetUncompressedLength();
- UniquePtr<MemMap> map(MemMap::MapAnonymous("classes.dex extracted in memory",
- NULL,
- length,
- PROT_READ | PROT_WRITE));
+ std::string name("classes.dex extracted in memory from ");
+ name += location;
+ UniquePtr<MemMap> map(MemMap::MapAnonymous(name.c_str(), NULL, length, PROT_READ | PROT_WRITE));
if (map.get() == NULL) {
LOG(ERROR) << "mmap classes.dex for \"" << location << "\" failed";
return NULL;