diff options
author | Ian Rogers <irogers@google.com> | 2013-11-05 16:12:57 -0800 |
---|---|---|
committer | Ian Rogers <irogers@google.com> | 2013-11-06 12:00:14 -0800 |
commit | fa82427c68b09f4aedbee319dc71579afbfc66f5 (patch) | |
tree | b8ae1c7be4a00dce290887ee857be5e466a0902b /oatdump | |
parent | 6b98c91275d4361d1b74effad36995cc2d687a55 (diff) | |
download | art-fa82427c68b09f4aedbee319dc71579afbfc66f5.zip art-fa82427c68b09f4aedbee319dc71579afbfc66f5.tar.gz art-fa82427c68b09f4aedbee319dc71579afbfc66f5.tar.bz2 |
Fix oatdump and valgrind.
Bug: 11531382
Move allocation instrumentation out of runtime into instrumentation. Don't
attempt to suspend threads in unstarted runtimes.
Make indentation support sputc returning eof, on which it will sync and try
again. A further failure likely means the disk is full.
Move the dump-oat output directory to be art as now there's too much output to
fit all the dump-oat data in our standard /tmp.
Change-Id: I8ea848ace318552c180e2efa46570288ff1ca62c
Diffstat (limited to 'oatdump')
-rw-r--r-- | oatdump/oatdump.cc | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/oatdump/oatdump.cc b/oatdump/oatdump.cc index 3a32ff1..047d985 100644 --- a/oatdump/oatdump.cc +++ b/oatdump/oatdump.cc @@ -712,14 +712,25 @@ class ImageDumper { if (image_root_object->IsObjectArray()) { Indenter indent2_filter(indent1_os.rdbuf(), kIndentChar, kIndentBy1Count); std::ostream indent2_os(&indent2_filter); - // TODO: replace down_cast with AsObjectArray (g++ currently has a problem with this) mirror::ObjectArray<mirror::Object>* image_root_object_array - = down_cast<mirror::ObjectArray<mirror::Object>*>(image_root_object); - // = image_root_object->AsObjectArray<Object>(); + = image_root_object->AsObjectArray<mirror::Object>(); for (int i = 0; i < image_root_object_array->GetLength(); i++) { mirror::Object* value = image_root_object_array->Get(i); + size_t run = 0; + for (int32_t j = i + 1; j < image_root_object_array->GetLength(); j++) { + if (value == image_root_object_array->Get(j)) { + run++; + } else { + break; + } + } + if (run == 0) { + indent2_os << StringPrintf("%d: ", i); + } else { + indent2_os << StringPrintf("%d to %zd: ", i, i + run); + i = i + run; + } if (value != NULL) { - indent2_os << i << ": "; PrettyObjectValue(indent2_os, value->GetClass(), value); } else { indent2_os << i << ": null\n"; |