summaryrefslogtreecommitdiffstats
path: root/runtime/runtime_callbacks.cc
diff options
context:
space:
mode:
authorAlex Light <allight@google.com>2017-11-09 13:21:01 -0800
committerAlex Light <allight@google.com>2017-11-14 17:09:35 -0800
commit8c2b929696cac235e8fd8bf4cae0ca751603b570 (patch)
treeef280c4ff76d44ba867d65564ec192ba4a90e874 /runtime/runtime_callbacks.cc
parenta16fec549253638268dda3d83e6e34a500cbfc1c (diff)
downloadart-8c2b929696cac235e8fd8bf4cae0ca751603b570.tar.gz
art-8c2b929696cac235e8fd8bf4cae0ca751603b570.tar.bz2
art-8c2b929696cac235e8fd8bf4cae0ca751603b570.zip
Add JVMTI DDMS extension method and event.
Add a new jvmti extension method 'com.android.art.internal.ddm.process_chunk' that can be used to request that the system process a DDMS chunk with a given type and data payload. It returns the processed chunk type and data. Agents can use this to interact with DDMS. Also add a new jvmti extension event 'com.android.art.internal.ddm.publish_chunk' that will be called whenever the system wishes to send an unrequested chunk of data to be processed. This is triggered by code executing 'DdmServer#sendChunk' or by other internal mechanisms. Both of these extensions are provided mainly to aid in the maintenence of backwards compatibility with existing DDMS applications. Generally agents should prefer to use the normal JVMTI events and controls over interpreting DDMS data or calling DDMS functions. Bug: 62821960 Test: ./test.py --host -j50 Test: ./art/tools/run-jdwp-tests.sh --mode=host \ --test org.apache.harmony.jpda.tests.jdwp.DDM.DDMTest Change-Id: I39f22d3d096d12b59713ec7b8b0c08d0d68ff422
Diffstat (limited to 'runtime/runtime_callbacks.cc')
-rw-r--r--runtime/runtime_callbacks.cc14
1 files changed, 14 insertions, 0 deletions
diff --git a/runtime/runtime_callbacks.cc b/runtime/runtime_callbacks.cc
index 339fe822fd..40d7889565 100644
--- a/runtime/runtime_callbacks.cc
+++ b/runtime/runtime_callbacks.cc
@@ -35,6 +35,20 @@ static inline void Remove(T* cb, std::vector<T*>* data) {
}
}
+void RuntimeCallbacks::AddDdmCallback(DdmCallback* cb) {
+ ddm_callbacks_.push_back(cb);
+}
+
+void RuntimeCallbacks::RemoveDdmCallback(DdmCallback* cb) {
+ Remove(cb, &ddm_callbacks_);
+}
+
+void RuntimeCallbacks::DdmPublishChunk(uint32_t type, const ArrayRef<const uint8_t>& data) {
+ for (DdmCallback* cb : ddm_callbacks_) {
+ cb->DdmPublishChunk(type, data);
+ }
+}
+
void RuntimeCallbacks::AddMethodInspectionCallback(MethodInspectionCallback* cb) {
method_inspection_callbacks_.push_back(cb);
}