oatdump

FROM MAKE:
mm dump-boot-oat

ON HOST:
oatdump --dex-file=$ANDROID_PRODUCT_OUT/system/framework/core.jar --image=$ANDROID_PRODUCT_OUT/system/framework/boot.oat --strip-prefix=$ANDROID_PRODUCT_OUT
oatdump --boot-dex-file=$ANDROID_PRODUCT_OUT/system/framework/core.jar --boot=$ANDROID_PRODUCT_OUT/system/framework/boot.oat --dex-file=$ANDROID_PRODUCT_OUT/system/framework/art-test-dex-HelloWorld.jar --image=$ANDROID_PRODUCT_OUT//system/framework/art-test-dex-HelloWorld.oat --strip-prefix=$ANDROID_PRODUCT_OUT

ON TARGET:
adb shell oatdump --dex-file=/system/framework/core.jar --image=/system/framework/boot.oat
adb shell oatdumpd --boot-dex-file=/system/framework/core.jar --boot=/system/framework/boot.oat --dex-file=/system/framework/art-test-dex-HelloWorld.jar --image=/system/framework/art-test-dex-HelloWorld.oat

Change-Id: Iad2ae40a9cf2dc28799ff5dc5222d50f1bc6b39f
diff --git a/src/image.h b/src/image.h
index 0694630..e3fa35d 100644
--- a/src/image.h
+++ b/src/image.h
@@ -21,7 +21,7 @@
     memcpy(version_, kImageVersion, sizeof(kImageVersion));
   }
 
-  bool IsValid() {
+  bool IsValid() const {
     if (memcmp(magic_, kImageMagic, sizeof(kImageMagic) != 0)) {
       return false;
     }
@@ -31,6 +31,11 @@
     return true;
   }
 
+  const char* GetMagic() const {
+    CHECK(IsValid());
+    return reinterpret_cast<const char*>(magic_);
+  }
+
   byte* GetBaseAddr() const {
     return reinterpret_cast<byte*>(base_addr_);
   }