1# dumpjvmti
2
3dumpjvmti is a JVMTI agent designed for helping debug the working of the openjdkjvmti plugin. It
4allows one to use SIGQUIT to dump information about the current JVMTI state to logcat. It does
5this by calling the com.android.art.misc.get_plugin_internal_state extension function.
6
7# Usage
8### Build
9>    `m libdumpjvmti`
10
11The libraries will be built for 32-bit, 64-bit, host and target. Below examples
12assume you want to use the 64-bit version.
13
14#### ART
15>    `art -Xplugin:$ANDROID_HOST_OUT/lib64/libopenjdkjvmti.so '-agentpath:libdumpjvmti.so' -cp tmp/java/helloworld.dex -Xint helloworld`
16>    `kill -3 <pid>`
17
18* `-Xplugin` and `-agentpath` need to be used, otherwise the agent will fail during init.
19* If using `libartd.so`, make sure to use the debug version of jvmti.
20
21>    `adb shell setenforce 0`
22>
23>    `adb push $ANDROID_PRODUCT_OUT/system/lib64/libdumpjvmti.so /data/local/tmp/`
24>
25>    `adb shell am start-activity --attach-agent /data/local/tmp/libdumpjvmti.so some.debuggable.apps/.the.app.MainActivity`
26>
27>    `adb shell kill -3 $(adb shell pidof some.debuggable.apps)`
28