diff options
Diffstat (limited to 'dexdump')
| -rw-r--r-- | dexdump/Android.bp | 1 | ||||
| -rw-r--r-- | dexdump/dexdump.cc | 12 | ||||
| -rw-r--r-- | dexdump/dexdump_main.cc | 9 |
3 files changed, 9 insertions, 13 deletions
diff --git a/dexdump/Android.bp b/dexdump/Android.bp index 1bc6334d1b..da43fbe4f1 100644 --- a/dexdump/Android.bp +++ b/dexdump/Android.bp @@ -69,6 +69,7 @@ art_cc_binary { apex_available: [ "com.android.art", "com.android.art.debug", + "test_broken_com.android.art", ], } diff --git a/dexdump/dexdump.cc b/dexdump/dexdump.cc index 2ab98ec884..7e4c1a68d3 100644 --- a/dexdump/dexdump.cc +++ b/dexdump/dexdump.cc @@ -1962,18 +1962,12 @@ int processFile(const char* fileName) { LOG(ERROR) << "ReadFileToString failed"; return -1; } - const DexFileLoader dex_file_loader; DexFileLoaderErrorCode error_code; std::string error_msg; std::vector<std::unique_ptr<const DexFile>> dex_files; - if (!dex_file_loader.OpenAll(reinterpret_cast<const uint8_t*>(content.data()), - content.size(), - fileName, - kVerify, - kVerifyChecksum, - &error_code, - &error_msg, - &dex_files)) { + DexFileLoader dex_file_loader( + reinterpret_cast<const uint8_t*>(content.data()), content.size(), fileName); + if (!dex_file_loader.Open(kVerify, kVerifyChecksum, &error_code, &error_msg, &dex_files)) { // Display returned error message to user. Note that this error behavior // differs from the error messages shown by the original Dalvik dexdump. LOG(ERROR) << error_msg; diff --git a/dexdump/dexdump_main.cc b/dexdump/dexdump_main.cc index 3afee0db39..fed2ba7282 100644 --- a/dexdump/dexdump_main.cc +++ b/dexdump/dexdump_main.cc @@ -22,13 +22,13 @@ * Also, ODEX files are no longer supported. */ -#include "dexdump.h" - +#include <android-base/logging.h> +#include <base/mem_map.h> #include <stdio.h> #include <string.h> #include <unistd.h> -#include <android-base/logging.h> +#include "dexdump.h" namespace art { @@ -137,7 +137,7 @@ int dexdumpDriver(int argc, char** argv) { // Open alternative output file. if (gOptions.outputFileName) { - gOutFile = fopen(gOptions.outputFileName, "w"); + gOutFile = fopen(gOptions.outputFileName, "we"); if (!gOutFile) { PLOG(ERROR) << "Can't open " << gOptions.outputFileName; return 1; @@ -157,6 +157,7 @@ int dexdumpDriver(int argc, char** argv) { int main(int argc, char** argv) { // Output all logging to stderr. android::base::SetLogger(android::base::StderrLogger); + art::MemMap::Init(); return art::dexdumpDriver(argc, argv); } |