Revert "Make Art dexdump/list the real utilities."

This reverts commit d10ee1ce1ccd92c003ec49c15edf339e74c13894.


REASON:
win_sdk is not happy with my migration :-(

Change-Id: I2ed196da3f5883112883525f883d25b36e48352a
diff --git a/Android.mk b/Android.mk
index b04c632..ff39d53 100644
--- a/Android.mk
+++ b/Android.mk
@@ -240,7 +240,7 @@
 
 # Dexdump/list regression test.
 .PHONY: test-art-host-dexdump
-test-art-host-dexdump: dexdump dexlist
+test-art-host-dexdump: dexdump2 dexlist2
 	art/test/dexdump/run-all-tests
 
 # Valgrind. Currently only 32b gtests.
diff --git a/build/Android.gtest.mk b/build/Android.gtest.mk
index ccf6d76..0958c64 100644
--- a/build/Android.gtest.mk
+++ b/build/Android.gtest.mk
@@ -94,24 +94,26 @@
 ART_GTEST_proxy_test_HOST_DEPS := $(HOST_CORE_IMAGE_default_no-pic_64) $(HOST_CORE_IMAGE_default_no-pic_32)
 
 # The dexdump test requires an image and the dexdump utility.
+# TODO: rename into dexdump when migration completes
 ART_GTEST_dexdump_test_HOST_DEPS := \
   $(HOST_CORE_IMAGE_default_no-pic_64) \
   $(HOST_CORE_IMAGE_default_no-pic_32) \
-  $(HOST_OUT_EXECUTABLES)/dexdump
+  $(HOST_OUT_EXECUTABLES)/dexdump2
 ART_GTEST_dexdump_test_TARGET_DEPS := \
   $(TARGET_CORE_IMAGE_default_no-pic_64) \
   $(TARGET_CORE_IMAGE_default_no-pic_32) \
-  dexdump
+  dexdump2
 
 # The dexlist test requires an image and the dexlist utility.
+# TODO: rename into dexlist when migration completes
 ART_GTEST_dexlist_test_HOST_DEPS := \
   $(HOST_CORE_IMAGE_default_no-pic_64) \
   $(HOST_CORE_IMAGE_default_no-pic_32) \
-  $(HOST_OUT_EXECUTABLES)/dexlist
+  $(HOST_OUT_EXECUTABLES)/dexlist2
 ART_GTEST_dexlist_test_TARGET_DEPS := \
   $(TARGET_CORE_IMAGE_default_no-pic_64) \
   $(TARGET_CORE_IMAGE_default_no-pic_32) \
-  dexlist
+  dexlist2
 
 # The imgdiag test has dependencies on core.oat since it needs to load it during the test.
 # For the host, also add the installed tool (in the base size, that should suffice). For the
diff --git a/dexdump/Android.mk b/dexdump/Android.mk
index 7d3488f..c6b4d47 100755
--- a/dexdump/Android.mk
+++ b/dexdump/Android.mk
@@ -14,6 +14,8 @@
 
 # TODO(ajcbik): Art-i-fy this makefile
 
+# TODO(ajcbik): rename dexdump2 into dexdump when Dalvik version is removed
+
 LOCAL_PATH:= $(call my-dir)
 
 dexdump_src_files := dexdump_main.cc dexdump.cc
@@ -31,7 +33,7 @@
 LOCAL_C_INCLUDES := $(dexdump_c_includes)
 LOCAL_CFLAGS += -Wall
 LOCAL_SHARED_LIBRARIES += $(dexdump_libraries)
-LOCAL_MODULE := dexdump
+LOCAL_MODULE := dexdump2
 LOCAL_MODULE_TAGS := optional
 LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES)
 include $(BUILD_EXECUTABLE)
@@ -47,6 +49,6 @@
 LOCAL_C_INCLUDES := $(dexdump_c_includes)
 LOCAL_CFLAGS += -Wall
 LOCAL_SHARED_LIBRARIES += $(dexdump_libraries)
-LOCAL_MODULE := dexdump
+LOCAL_MODULE := dexdump2
 LOCAL_MODULE_TAGS := optional
 include $(BUILD_HOST_EXECUTABLE)
diff --git a/dexdump/dexdump.cc b/dexdump/dexdump.cc
index d26b8b5..f55dccd 100644
--- a/dexdump/dexdump.cc
+++ b/dexdump/dexdump.cc
@@ -52,7 +52,7 @@
 struct Options gOptions;
 
 /*
- * Output file. Defaults to stdout.
+ * Output file. Defaults to stdout, but tests can modify.
  */
 FILE* gOutFile = stdout;
 
@@ -63,6 +63,8 @@
 typedef uint16_t u2;
 typedef uint32_t u4;
 typedef uint64_t u8;
+typedef int8_t   s1;
+typedef int16_t  s2;
 typedef int32_t  s4;
 typedef int64_t  s8;
 
diff --git a/dexdump/dexdump_main.cc b/dexdump/dexdump_main.cc
index 9be0922..756f879 100644
--- a/dexdump/dexdump_main.cc
+++ b/dexdump/dexdump_main.cc
@@ -108,8 +108,8 @@
       default:
         wantUsage = true;
         break;
-    }  // switch
-  }  // while
+    }
+  }
 
   // Detect early problems.
   if (optind == argc) {
@@ -138,7 +138,7 @@
   int result = 0;
   while (optind < argc) {
     result |= processFile(argv[optind++]);
-  }  // while
+  }
   return result != 0;
 }
 
diff --git a/dexdump/dexdump_test.cc b/dexdump/dexdump_test.cc
index 9ae5d20..d9b210d 100644
--- a/dexdump/dexdump_test.cc
+++ b/dexdump/dexdump_test.cc
@@ -42,11 +42,12 @@
 
   // Runs test with given arguments.
   bool Exec(const std::vector<std::string>& args, std::string* error_msg) {
+    // TODO(ajcbik): dexdump2 -> dexdump
     std::string file_path = GetTestAndroidRoot();
     if (IsHost()) {
-      file_path += "/bin/dexdump";
+      file_path += "/bin/dexdump2";
     } else {
-      file_path += "/xbin/dexdump";
+      file_path += "/xbin/dexdump2";
     }
     EXPECT_TRUE(OS::FileExists(file_path.c_str())) << file_path << " should be a valid file path";
     std::vector<std::string> exec_argv = { file_path };
diff --git a/dexlist/Android.mk b/dexlist/Android.mk
index 037ac0e..988fe03 100755
--- a/dexlist/Android.mk
+++ b/dexlist/Android.mk
@@ -14,6 +14,8 @@
 
 # TODO(ajcbik): Art-i-fy this makefile
 
+# TODO(ajcbik): rename dexlist2 into dexlist when Dalvik version is removed
+
 LOCAL_PATH:= $(call my-dir)
 
 dexlist_src_files := dexlist.cc
@@ -31,7 +33,7 @@
 LOCAL_C_INCLUDES := $(dexlist_c_includes)
 LOCAL_CFLAGS += -Wall
 LOCAL_SHARED_LIBRARIES += $(dexlist_libraries)
-LOCAL_MODULE := dexlist
+LOCAL_MODULE := dexlist2
 LOCAL_MODULE_TAGS := optional
 LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES)
 include $(BUILD_EXECUTABLE)
@@ -47,6 +49,6 @@
 LOCAL_C_INCLUDES := $(dexlist_c_includes)
 LOCAL_CFLAGS += -Wall
 LOCAL_SHARED_LIBRARIES += $(dexlist_libraries)
-LOCAL_MODULE := dexlist
+LOCAL_MODULE := dexlist2
 LOCAL_MODULE_TAGS := optional
 include $(BUILD_HOST_EXECUTABLE)
diff --git a/dexlist/dexlist.cc b/dexlist/dexlist.cc
index c611fbd..d7c0e4c 100644
--- a/dexlist/dexlist.cc
+++ b/dexlist/dexlist.cc
@@ -51,8 +51,11 @@
  * Data types that match the definitions in the VM specification.
  */
 typedef uint8_t  u1;
+typedef uint16_t u2;
 typedef uint32_t u4;
 typedef uint64_t u8;
+typedef int32_t  s4;
+typedef int64_t  s8;
 
 /*
  * Returns a newly-allocated string for the "dot version" of the class
@@ -243,7 +246,7 @@
         gOptions.outputFileName = optarg;
         break;
       case 'm':
-        // If -m p.c.m is given, then find all instances of the
+        // If -m X.Y.Z is given, then find all instances of the
         // fully-qualified method name. This isn't really what
         // dexlist is for, but it's easy to do it here.
         {
diff --git a/dexlist/dexlist_test.cc b/dexlist/dexlist_test.cc
index 82179de..7b1b63d 100644
--- a/dexlist/dexlist_test.cc
+++ b/dexlist/dexlist_test.cc
@@ -42,11 +42,12 @@
 
   // Runs test with given arguments.
   bool Exec(const std::vector<std::string>& args, std::string* error_msg) {
+    // TODO(ajcbik): dexlist2 -> dexlist
     std::string file_path = GetTestAndroidRoot();
     if (IsHost()) {
-      file_path += "/bin/dexlist";
+      file_path += "/bin/dexlist2";
     } else {
-      file_path += "/xbin/dexlist";
+      file_path += "/xbin/dexlist2";
     }
     EXPECT_TRUE(OS::FileExists(file_path.c_str())) << file_path << " should be a valid file path";
     std::vector<std::string> exec_argv = { file_path };
diff --git a/test/dexdump/run-all-tests b/test/dexdump/run-all-tests
index c0fbb1d..d9f1e96 100755
--- a/test/dexdump/run-all-tests
+++ b/test/dexdump/run-all-tests
@@ -38,12 +38,12 @@
 mkdir ${tmpdir}
 
 # Set up dexdump binary and flags to test.
-DEXD="${ANDROID_HOST_OUT}/bin/dexdump"
+DEXD="${ANDROID_HOST_OUT}/bin/dexdump2"
 DEXDFLAGS1="-dfh"
 DEXDFLAGS2="-l xml"
 
 # Set up dexlist binary and flags to test.
-DEXL="${ANDROID_HOST_OUT}/bin/dexlist"
+DEXL="${ANDROID_HOST_OUT}/bin/dexlist2"
 DEXLFLAGS=""
 
 # Run the tests.