diff options
Diffstat (limited to 'adbconnection/adbconnection.cc')
| -rw-r--r-- | adbconnection/adbconnection.cc | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/adbconnection/adbconnection.cc b/adbconnection/adbconnection.cc index 06ded26a2d..ee89717043 100644 --- a/adbconnection/adbconnection.cc +++ b/adbconnection/adbconnection.cc @@ -824,11 +824,21 @@ void AdbConnectionState::PerformHandshake() { } void AdbConnectionState::AttachJdwpAgent(art::Thread* self) { + art::Runtime* runtime = art::Runtime::Current(); + if (runtime->GetJit() == nullptr && !runtime->GetInstrumentation()->IsForcedInterpretOnly()) { + // If we don't have a JIT we should try to start the jit for performance reasons. + runtime->CreateJit(); + if (runtime->GetJit() == nullptr) { + LOG(WARNING) << "Could not start jit for debugging. This process might be quite slow as it " + << "is running entirely in the interpreter. Try running 'setenforce 0' and " + << "starting the debugging session over."; + } + } self->AssertNoPendingException(); - art::Runtime::Current()->AttachAgent(/* JNIEnv */ nullptr, - MakeAgentArg(), - /* classloader */ nullptr, - /*allow_non_debuggable_tooling*/ true); + runtime->AttachAgent(/* JNIEnv */ nullptr, + MakeAgentArg(), + /* classloader */ nullptr, + /*allow_non_debuggable_tooling*/ true); if (self->IsExceptionPending()) { LOG(ERROR) << "Failed to load agent " << agent_name_; art::ScopedObjectAccess soa(self); |