Clean up JVMTI DDMS extension function.
We change it to not return failure (and print a warning) if the chunk
handler returns an empty chunk. This is a surprisingly common result
in real-world code and was causing significant log-spam.
Bug: 70559172
Test: ./test.py --host -j50
Change-Id: I1ba0f43cb2e834b09f51db75ec9100d97e916b62
diff --git a/runtime/debugger.cc b/runtime/debugger.cc
index 13029fb..b8f15af 100644
--- a/runtime/debugger.cc
+++ b/runtime/debugger.cc
@@ -4376,15 +4376,12 @@
replyData.get(),
offset,
length);
- if (length == 0 || replyData.get() == nullptr) {
- return false;
- }
-
out_data->resize(length);
env->GetByteArrayRegion(replyData.get(),
offset,
length,
reinterpret_cast<jbyte*>(out_data->data()));
+
return true;
}
@@ -4418,7 +4415,7 @@
std::vector<uint8_t> out_data;
uint32_t out_type = 0;
request->Skip(request_length);
- if (!DdmHandleChunk(env, type, data, &out_type, &out_data)) {
+ if (!DdmHandleChunk(env, type, data, &out_type, &out_data) || out_data.empty()) {
return false;
}
const uint32_t kDdmHeaderSize = 8;