Revert "Improve the location of the input vdex, for debugging."
This reverts commit a9191f06a8cb10cfa6768605dfeff7de58f37980.
Reason for revert: DroidMonitor-triggered revert due to breakage https://android-build.corp.google.com/test_hub/regression/?regression=e76b4d19-62af-4815-a632-9da7bce5aabe, bug 284981749
Change-Id: I0de43729996b3841cb99bb1d3c1e325f7b2e0951
BUG: 284981749
diff --git a/dex2oat/dex2oat.cc b/dex2oat/dex2oat.cc
index acc6267..f4c3e2a 100644
--- a/dex2oat/dex2oat.cc
+++ b/dex2oat/dex2oat.cc
@@ -128,7 +128,6 @@
static constexpr size_t kDefaultMinDexFilesForSwap = 2;
static constexpr size_t kDefaultMinDexFileCumulativeSizeForSwap = 20 * MB;
-static constexpr char kInputVdexPlaceholderName[] = "vdex";
// Compiler filter override for very large apps.
static constexpr CompilerFilter::Filter kLargeAppFilter = CompilerFilter::kVerify;
@@ -696,7 +695,7 @@
}
if ((image_fd_ != -1) && (oat_fd_ == -1)) {
- Usage("--image-fd must be used with --oat-fd and --output-vdex-fd");
+ Usage("--image-fd must be used with --oat_fd and --output_vdex_fd");
}
if (!parser_options->oat_symbols.empty() && oat_fd_ != -1) {
@@ -1337,7 +1336,7 @@
std::string error_msg;
input_vdex_file_ = VdexFile::Open(input_vdex_fd_,
s.st_size,
- kInputVdexPlaceholderName,
+ "vdex",
/* writable */ false,
/* low_4gb */ false,
&error_msg);
@@ -2617,12 +2616,7 @@
TimingLogger::ScopedTiming t2("AddDexFileSources", timings_);
if (input_vdex_file_ != nullptr && input_vdex_file_->HasDexSection()) {
DCHECK_EQ(oat_writers_.size(), 1u);
- const std::string& name =
- input_vdex_file_->GetName() != kInputVdexPlaceholderName ?
- input_vdex_file_->GetName() :
- // We don't strictly know the input vdex location. Use the input
- // dex instead - it's better than nothing.
- "vdex for " + (zip_location_.empty() ? dex_locations_[0] : zip_location_);
+ const std::string& name = zip_location_.empty() ? dex_locations_[0] : zip_location_;
DCHECK(!name.empty());
if (!oat_writers_[0]->AddVdexDexFilesSource(*input_vdex_file_.get(), name.c_str())) {
return false;
diff --git a/dex2oat/linker/oat_writer.cc b/dex2oat/linker/oat_writer.cc
index a552bbd..413d71f 100644
--- a/dex2oat/linker/oat_writer.cc
+++ b/dex2oat/linker/oat_writer.cc
@@ -486,12 +486,12 @@
for (; i < vdex_file.GetNumberOfDexFiles(); ++i) {
current_dex_data = vdex_file.GetNextDexFileData(current_dex_data, i);
if (current_dex_data == nullptr) {
- LOG(ERROR) << "Unexpected number of dex files in " << location;
+ LOG(ERROR) << "Unexpected number of dex files in vdex " << location;
return false;
}
if (!DexFileLoader::IsMagicValid(current_dex_data)) {
- LOG(ERROR) << "Invalid magic in " << location;
+ LOG(ERROR) << "Invalid magic in vdex file created from " << location;
return false;
}
// We used `zipped_dex_file_locations_` to keep the strings in memory.
@@ -505,12 +505,12 @@
}
if (vdex_file.GetNextDexFileData(current_dex_data, i) != nullptr) {
- LOG(ERROR) << "Unexpected number of dex files in " << location;
+ LOG(ERROR) << "Unexpected number of dex files in vdex " << location;
return false;
}
if (oat_dex_files_.empty()) {
- LOG(ERROR) << "No dex files in " << location;
+ LOG(ERROR) << "No dex files in vdex file created from " << location;
return false;
}
return true;