summaryrefslogtreecommitdiff
path: root/test/1964-add-to-dex-classloader-file/src/Main.java
AgeCommit message (Collapse)Author
2019-05-20Revert^2 "Add AddToDexClassloader JVMTI extension functions"Alex Light
This reverts commit 799e536da9733ab638946f56e1ceb62d62cd3c81. It seems that on some of our test devices the kernel does not have an implementation for memfd_create. To work around this I added a basic wrapper that will simulate memfd_create using temp files. This should be sufficient for testing. All actual devices are expected to support the memfd_create syscall natively. Reason for revert: Implemented fallback for memfd_create Bug: 132699522 Bug: 132914283 Test: ./test.py --host Change-Id: I63b36464df24193fff27624c1e2350d65545ad1d
2019-05-17Revert "Add AddToDexClassloader JVMTI extension functions"Alex Light
This reverts commit 92ed90ca3897ae7861b22aa12740065152839649. Reason for revert: Test 1963 fails when run by chrome buildbots. Change-Id: Ia3a7dc64f0372da9feca9bca1a75038d3f9fb01e Test: None Bug: 132699522 Bug: 132914283
2019-05-17Add AddToDexClassloader JVMTI extension functionsAlex Light
It is useful for some agents to be able to add new classes into an already existing classloader. This could be used to, for example, handle new lambdas added during 'edit-and-continue' debugging. This extension should eliminate the need for agents to reach into class-loader internals. These functions are: 'com.android.art.classloader.add_to_dex_class_loader' which has a signature of jvmtiError(jvmtiEnv* env, jobject classloader, const char* segment) and will add the given 'segment' file to the dalvik.system.BaseDexClassLoader 'loader'. 'com.android.art.classloader.add_to_dex_class_loader_in_memory' which has a signature of jvmtiError(jvmtiEnv* env, jobject classloader, const unsigned char* dex, jint dex_size) and will add the dexfile buffer 'dex' to the given dalvik.system.BaseDexClassLoader. ClassLoaders that do not extend dalvik.system.BaseDexClassLoader are not supported. Test: ./test.py --host Bug: 132699522 Bug: 132914283 Change-Id: I3740af4b3b06b9fa64be8ad94238256b7a43536a