diff options
author | 2013-05-16 12:01:04 -0700 | |
---|---|---|
committer | 2013-05-16 12:01:04 -0700 | |
commit | e606010a5e5ea803736576b47740a2551e5d0dfc (patch) | |
tree | cc01184f0f2e086642bd741fd71cd447c7a1295f | |
parent | c4ee12e73fc844f28a9812a9141985cf05143a57 (diff) |
Increase logging around bad dex files.
Change-Id: I294aecd401046537004c79dcd0041b61af962892
-rw-r--r-- | src/dex_file.cc | 2 | ||||
-rw-r--r-- | src/utils.cc | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/src/dex_file.cc b/src/dex_file.cc index 11ddcd585b..0f0bed4db9 100644 --- a/src/dex_file.cc +++ b/src/dex_file.cc @@ -71,6 +71,7 @@ bool DexFile::GetChecksum(const std::string& filename, uint32_t& checksum) { } UniquePtr<ZipEntry> zip_entry(zip_archive->Find(kClassesDex)); if (zip_entry.get() == NULL) { + LOG(ERROR) << "Zip archive '" << filename << "' doesn't contain " << kClassesDex; return false; } checksum = zip_entry->GetCrc32(); @@ -84,6 +85,7 @@ bool DexFile::GetChecksum(const std::string& filename, uint32_t& checksum) { checksum = dex_file->GetHeader().checksum_; return true; } + LOG(ERROR) << "Expected valid zip or dex file name: " << filename; return false; } diff --git a/src/utils.cc b/src/utils.cc index 145649524a..94d812c560 100644 --- a/src/utils.cc +++ b/src/utils.cc @@ -1204,7 +1204,9 @@ std::string GetArtCacheOrDie(const char* android_data) { std::string GetArtCacheFilenameOrDie(const std::string& location) { std::string art_cache(GetArtCacheOrDie(GetAndroidData())); - CHECK_EQ(location[0], '/') << location; + if (location[0] != '/') { + LOG(FATAL) << "Expected path in location to be absolute: "<< location; + } std::string cache_file(location, 1); // skip leading slash std::replace(cache_file.begin(), cache_file.end(), '/', '@'); return art_cache + "/" + cache_file; |