Support using adbconnection and openjdkjvmti without JAVA_DEBUGGABLE

We need to support using a best-effort JDWP when we have the
ENABLE_JDWP attribute without the JAVA_DEBUGGABLE attribute. This is
used on eng and userdebug builds. We do this by making the plugin try
to change the runtime to debuggable if possible and to allow getting
an ArtTiEnv which is a best-effort version of JVMTI by calling GetEnv
with (JVMTI_VERSION_1_2 | 0x4000000). This is needed since if the
runtime isn't debuggable we cannot guarantee compatibility with the
JVMTI specification in all cases due to compiler optimizations such as
inlining. By creating this special version agents are able to
positively signal that they are able to deal with this uncertainty.

We also support using openjdkjvmti without being JAVA_DEBUGGABLE. This
is done by either only allowing the best effort ArtTiEnvs or by
changing the environment to be debuggable if we are loaded early
enough.

Moving the runtime to debuggable state involves deoptimizing the boot
image and throwing out any image files associated with non-debuggable
oat-files.

Bug: 62821960
Test: ./test.py --host -j50
Test: Manual
Test: Build, Test debugging system_server and other processes.
Change-Id: I2233299fceb83c76785e5de09e51eaf18b7922e8
9 files changed