diff options
| -rw-r--r-- | oatdump/oatdump.cc | 20 | ||||
| -rw-r--r-- | runtime/oat_file.h | 4 |
2 files changed, 23 insertions, 1 deletions
diff --git a/oatdump/oatdump.cc b/oatdump/oatdump.cc index 6ecfc74e8c..d2ab699599 100644 --- a/oatdump/oatdump.cc +++ b/oatdump/oatdump.cc @@ -59,6 +59,7 @@ #include "stack_map.h" #include "ScopedLocalRef.h" #include "thread_list.h" +#include "type_lookup_table.h" #include "verifier/method_verifier.h" #include "well_known_classes.h" @@ -573,8 +574,15 @@ class OatDumper { os << StringPrintf("location: %s\n", oat_dex_file.GetDexFileLocation().c_str()); os << StringPrintf("checksum: 0x%08x\n", oat_dex_file.GetDexFileLocationChecksum()); - // Create the verifier early. + // Print embedded dex file data range. + const uint8_t* const oat_file_begin = oat_dex_file.GetOatFile()->Begin(); + const uint8_t* const dex_file_pointer = oat_dex_file.GetDexFilePointer(); + uint32_t dex_offset = dchecked_integral_cast<uint32_t>(dex_file_pointer - oat_file_begin); + os << StringPrintf("dex-file: 0x%08x..0x%08x\n", + dex_offset, + dchecked_integral_cast<uint32_t>(dex_offset + oat_dex_file.FileSize() - 1)); + // Create the dex file early. A lot of print-out things depend on it. std::string error_msg; const DexFile* const dex_file = OpenDexFile(&oat_dex_file, &error_msg); if (dex_file == nullptr) { @@ -583,6 +591,16 @@ class OatDumper { return false; } + // Print lookup table, if it exists. + if (oat_dex_file.GetLookupTableData() != nullptr) { + uint32_t table_offset = dchecked_integral_cast<uint32_t>( + oat_dex_file.GetLookupTableData() - oat_file_begin); + uint32_t table_size = TypeLookupTable::RawDataLength(*dex_file); + os << StringPrintf("type-table: 0x%08x..0x%08x\n", + table_offset, + table_offset + table_size - 1); + } + VariableIndentationOutputStream vios(&os); ScopedIndentation indent1(&vios); for (size_t class_def_index = 0; diff --git a/runtime/oat_file.h b/runtime/oat_file.h index 11a9d76dad..9470624df8 100644 --- a/runtime/oat_file.h +++ b/runtime/oat_file.h @@ -370,6 +370,10 @@ class OatDexFile FINAL { return lookup_table_data_; } + const uint8_t* GetDexFilePointer() const { + return dex_file_pointer_; + } + ~OatDexFile(); private: |