diff options
author | 2022-08-01 14:31:25 +0000 | |
---|---|---|
committer | 2022-08-10 04:18:09 +0000 | |
commit | 6ecfa91a040bb1a58e57ad99ab2765cd911e845a (patch) | |
tree | 1c61a33ffbd6516c9ab7438a0c045fb542a46f0d /openjdkjvmti/OpenjdkJvmTi.cc | |
parent | e22aa32240589cf31d341e0f59bf0bf522b4a239 (diff) |
Update instrumentation support for non-java debuggable runtimes
Support for debugger features wasn't consistent in non-debuggable
runtimes earlier. This CL unifies the support for debuggable /
non-debuggable runtimes and support debugger features more consistently
in non-debuggable runtime. Debug features are still supported on a best
effort basis for any methods on the stack when the debugger was
attached. Certain features like redefinition are still not supported.
This CL:
1. Replaces is_debuggable boolean with an enum with three states:
NonJavaDebuggable, JavaDebuggable, JavaDebuggableAtInit
2. Adds support to switch between NonJavaDebuggable -> JavaDebuggable
and vice versa.
3. Updates the checks for IsJavaDebuggable to check for
JavaDebuggableAtInit or JavaDebuggable as required.
Test: art/test.py
Bug: 206029744
Change-Id: I1d072d8a1d215b70f3d2425b458b836a22af6812
Diffstat (limited to 'openjdkjvmti/OpenjdkJvmTi.cc')
-rw-r--r-- | openjdkjvmti/OpenjdkJvmTi.cc | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/openjdkjvmti/OpenjdkJvmTi.cc b/openjdkjvmti/OpenjdkJvmTi.cc index 09900e1f73..d7db3d2168 100644 --- a/openjdkjvmti/OpenjdkJvmTi.cc +++ b/openjdkjvmti/OpenjdkJvmTi.cc @@ -89,12 +89,6 @@ AllocationManager* gAllocManager; } \ } while (false) -// Returns whether we are able to use all jvmti features. -static bool IsFullJvmtiAvailable() { - art::Runtime* runtime = art::Runtime::Current(); - return runtime->GetInstrumentation()->IsForcedInterpretOnly() || runtime->IsJavaDebuggable(); -} - class JvmtiFunctions { private: static jvmtiError getEnvironmentError(jvmtiEnv* env) { @@ -1474,13 +1468,7 @@ extern "C" bool ArtPlugin_Initialize() { FieldUtil::Register(gEventHandler); BreakpointUtil::Register(gEventHandler); Transformer::Register(gEventHandler); - - { - // Make sure we can deopt anything we need to. - art::ScopedSuspendAll ssa(__FUNCTION__); - gDeoptManager->FinishSetup(); - } - + gDeoptManager->FinishSetup(); runtime->GetJavaVM()->AddEnvironmentHook(GetEnvHandler); return true; |