diff options
author | Brian Carlstrom <bdc@google.com> | 2013-10-02 10:01:17 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2013-10-02 10:01:17 -0700 |
commit | e8acf91ebd0ebf76535c157500c22d3dfc7a14f3 (patch) | |
tree | 099b8261aa8f6f98732bf7fbc561296b948e9b5b /oatdump/oatdump.cc | |
parent | c68fb2094b562186a571f496fc46ad2b85b02a39 (diff) | |
parent | 334d017c2c66731e545a416a76db7fcd621461e3 (diff) | |
download | art-e8acf91ebd0ebf76535c157500c22d3dfc7a14f3.zip art-e8acf91ebd0ebf76535c157500c22d3dfc7a14f3.tar.gz art-e8acf91ebd0ebf76535c157500c22d3dfc7a14f3.tar.bz2 |
am 334d017c: am a968219b: am 6f277751: Make oatdump support image file generated on device
* commit '334d017c2c66731e545a416a76db7fcd621461e3':
Make oatdump support image file generated on device
Diffstat (limited to 'oatdump/oatdump.cc')
-rw-r--r-- | oatdump/oatdump.cc | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/oatdump/oatdump.cc b/oatdump/oatdump.cc index cc6b5d7..aacbbf5 100644 --- a/oatdump/oatdump.cc +++ b/oatdump/oatdump.cc @@ -777,7 +777,17 @@ class ImageDumper { } os << "STATS:\n" << std::flush; UniquePtr<File> file(OS::OpenFileForReading(image_filename_.c_str())); - stats_.file_bytes = file->GetLength(); + if (file.get() == NULL) { + std::string cache_location(GetDalvikCacheFilenameOrDie(image_filename_)); + file.reset(OS::OpenFileForReading(cache_location.c_str())); + if (file.get() == NULL) { + LOG(WARNING) << "Failed to find image in " << image_filename_ + << " and " << cache_location; + } + } + if (file.get() != NULL) { + stats_.file_bytes = file->GetLength(); + } size_t header_bytes = sizeof(ImageHeader); stats_.header_bytes = header_bytes; size_t alignment_bytes = RoundUp(header_bytes, kObjectAlignment) - header_bytes; |