summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cmdline/cmdline.h13
-rw-r--r--imgdiag/imgdiag.cc2
2 files changed, 11 insertions, 4 deletions
diff --git a/cmdline/cmdline.h b/cmdline/cmdline.h
index 18ca944383..c5d3a6b454 100644
--- a/cmdline/cmdline.h
+++ b/cmdline/cmdline.h
@@ -78,6 +78,7 @@ static bool LocationToFilename(const std::string& location, InstructionSet isa,
*filename = cache_filename;
return true;
} else {
+ *filename = system_filename;
return false;
}
}
@@ -217,7 +218,7 @@ struct CmdlineArgs {
// Specified by --boot-image.
const char* boot_image_location_ = nullptr;
// Specified by --instruction-set.
- InstructionSet instruction_set_ = kRuntimeISA;
+ InstructionSet instruction_set_ = InstructionSet::kNone;
// Specified by --output.
std::ostream* os_ = &std::cout;
std::unique_ptr<std::ofstream> out_; // If something besides cout is used
@@ -230,6 +231,10 @@ struct CmdlineArgs {
*error_msg = "--boot-image must be specified";
return false;
}
+ if (instruction_set_ == InstructionSet::kNone) {
+ LOG(WARNING) << "No instruction set given, assuming " << GetInstructionSetString(kRuntimeISA);
+ instruction_set_ = kRuntimeISA;
+ }
DBG_LOG << "boot image location: " << boot_image_location_;
@@ -266,8 +271,10 @@ struct CmdlineArgs {
// Check that the boot image location points to a valid file name.
std::string file_name;
if (!LocationToFilename(boot_image_location, instruction_set_, &file_name)) {
- *error_msg = android::base::StringPrintf("No corresponding file for location '%s' exists",
- boot_image_location.c_str());
+ *error_msg = android::base::StringPrintf(
+ "No corresponding file for location '%s' (filename '%s') exists",
+ boot_image_location.c_str(),
+ file_name.c_str());
return false;
}
diff --git a/imgdiag/imgdiag.cc b/imgdiag/imgdiag.cc
index d3b8ce14a9..f0c9158748 100644
--- a/imgdiag/imgdiag.cc
+++ b/imgdiag/imgdiag.cc
@@ -1715,7 +1715,7 @@ struct ImgDiagArgs : public CmdlineArgs {
*error_msg = StringPrintf("Failed to check process status: %s", strerror(errno));
}
return kParseError;
- } else if (instruction_set_ != kRuntimeISA) {
+ } else if (instruction_set_ != InstructionSet::kNone && instruction_set_ != kRuntimeISA) {
// Don't allow different ISAs since the images are ISA-specific.
// Right now the code assumes both the runtime ISA and the remote ISA are identical.
*error_msg = "Must use the default runtime ISA; changing ISA is not supported.";