Fix dump-oat-Calculator

also add --host-prefix defaulting to oatdump matching oatexec

Change-Id: I0e82f78510be18dcb09dbb1ec14931fe46173a68
diff --git a/src/oatdump.cc b/src/oatdump.cc
index 44632c0..0dde41f 100644
--- a/src/oatdump.cc
+++ b/src/oatdump.cc
@@ -57,6 +57,7 @@
           "  --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"
+          "      Default: $ANDROID_PRODUCT_OUT\n"
           "\n");
   fprintf(stderr,
           "  --output=<file> may be used to send the output to a file.\n"
@@ -743,6 +744,12 @@
     options.push_back(std::make_pair(image_option.c_str(), reinterpret_cast<void*>(NULL)));
   }
 
+  if (host_prefix.empty()) {
+    const char* android_product_out = getenv("ANDROID_PRODUCT_OUT");
+    if (android_product_out != NULL) {
+        host_prefix = android_product_out;
+    }
+  }
   if (!host_prefix.empty()) {
     options.push_back(std::make_pair("host-prefix", host_prefix.c_str()));
   }