Compile method one-by-one.
Change-Id: Ic56fb397f3bd6dee32372eb875261a3383eaf30c
diff --git a/src/oatdump.cc b/src/oatdump.cc
index b599eaa..a33cd09 100644
--- a/src/oatdump.cc
+++ b/src/oatdump.cc
@@ -57,11 +57,6 @@
" Example: --boot-image=/system/framework/boot.art\n"
"\n");
fprintf(stderr,
- " --extract-elf-to=<file.elf>: provide the prefix of the filename for\n"
- " the output ELF files.\n"
- " Example: --extract-elf-to=output.elf\n"
- "\n");
- fprintf(stderr,
" --host-prefix may be used to translate host paths to target paths during\n"
" cross compilation.\n"
" Example: --host-prefix=out/target/product/crespo\n"
@@ -113,9 +108,6 @@
os << "DEX FILE COUNT:\n";
os << oat_header.GetDexFileCount() << "\n\n";
- os << "ELF IMAGE COUNT:\n";
- os << oat_header.GetElfImageCount() << "\n\n";
-
os << "EXECUTABLE OFFSET:\n";
os << StringPrintf("0x%08x\n\n", oat_header.GetExecutableOffset());
@@ -318,35 +310,17 @@
os << StringPrintf("\t\tgc_map: %p (offset=0x%08x)\n",
oat_method.GetGcMap(), oat_method.GetGcMapOffset());
DumpGcMap(os, oat_method.GetGcMap());
- os << StringPrintf(
-#if defined(ART_USE_LLVM_COMPILER)
- "\t\tCODE: %p (offset=0x%08x size=%d elf_idx=%d elf_func_idx=%d)%s\n",
-#else
- "\t\tCODE: %p (offset=0x%08x size=%d)%s\n",
-#endif
+ os << StringPrintf("\t\tCODE: %p (offset=0x%08x size=%d)%s\n",
oat_method.GetCode(),
oat_method.GetCodeOffset(),
oat_method.GetCodeSize(),
-#if defined(ART_USE_LLVM_COMPILER)
- static_cast<int>(oat_method.GetCodeElfIndex()),
- static_cast<int>(oat_method.GetCodeElfFuncIndex()),
-#endif
oat_method.GetCode() != NULL ? "..." : "");
DumpCode(os, oat_method.GetCode(), oat_method.GetCodeSize(), oat_method.GetMappingTable(),
dex_file, code_item);
- os << StringPrintf(
-#if defined(ART_USE_LLVM_COMPILER)
- "\t\tINVOKE STUB: %p (offset=0x%08x size=%d elf_idx=%d elf_func_idx=%d)%s\n",
-#else
- "\t\tINVOKE STUB: %p (offset=0x%08x size=%d)%s\n",
-#endif
+ os << StringPrintf("\t\tINVOKE STUB: %p (offset=0x%08x size=%d)%s\n",
oat_method.GetInvokeStub(),
oat_method.GetInvokeStubOffset(),
oat_method.GetInvokeStubSize(),
-#if defined(ART_USE_LLVM_COMPILER)
- static_cast<int>(oat_method.GetInvokeStubElfIndex()),
- static_cast<int>(oat_method.GetInvokeStubElfFuncIndex()),
-#endif
oat_method.GetInvokeStub() != NULL ? "..." : "");
DumpCode(os, reinterpret_cast<const void*>(oat_method.GetInvokeStub()),
oat_method.GetInvokeStubSize(), NULL, dex_file, NULL);
@@ -1158,8 +1132,6 @@
image_filename = option.substr(strlen("--image=")).data();
} else if (option.starts_with("--boot-image=")) {
boot_image_filename = option.substr(strlen("--boot-image=")).data();
- } else if (option.starts_with("--extract-elf-to=")) {
- elf_filename_prefix = option.substr(strlen("--extract-elf-to=")).data();
} else if (option.starts_with("--host-prefix=")) {
host_prefix.reset(new std::string(option.substr(strlen("--host-prefix=")).data()));
} else if (option.starts_with("--output=")) {
@@ -1204,25 +1176,6 @@
}
OatDumper oat_dumper(*host_prefix.get(), *oat_file);
oat_dumper.Dump(*os);
-
-#if defined(ART_USE_LLVM_COMPILER)
- if (!elf_filename_prefix.empty()) {
- uint32_t elf_image_count = oat_file->GetOatHeader().GetElfImageCount();
- for (uint32_t i = 0; i < elf_image_count; ++i) {
- const OatFile::OatElfImage* elf_image = oat_file->GetOatElfImage(i);
-
- std::string elf_filename(
- StringPrintf("%s-%u", elf_filename_prefix.c_str(), i));
-
- UniquePtr<File> elf_file(OS::OpenFile(elf_filename.c_str(), true));
-
- if (!elf_file->WriteFully(elf_image->begin(), elf_image->size())) {
- fprintf(stderr, "Failed to write ELF image to: %s\n",
- elf_filename.c_str());
- }
- }
- }
-#endif
return EXIT_SUCCESS;
}