summaryrefslogtreecommitdiff
path: root/runtime/debugger.cc
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/debugger.cc')
-rw-r--r--runtime/debugger.cc17
1 files changed, 10 insertions, 7 deletions
diff --git a/runtime/debugger.cc b/runtime/debugger.cc
index 4cc3583496..b28868fb7b 100644
--- a/runtime/debugger.cc
+++ b/runtime/debugger.cc
@@ -71,6 +71,8 @@
#include "oat_file.h"
#include "obj_ptr-inl.h"
#include "reflection.h"
+#include "reflective_handle.h"
+#include "reflective_handle_scope-inl.h"
#include "runtime-inl.h"
#include "scoped_thread_state_change-inl.h"
#include "stack.h"
@@ -4056,18 +4058,19 @@ void Dbg::ExecuteMethodWithoutPendingException(ScopedObjectAccess& soa, DebugInv
soa.Self()->AssertNoPendingException();
// Translate the method through the vtable, unless the debugger wants to suppress it.
- ArtMethod* m = pReq->method;
+ StackArtMethodHandleScope<2> rhs(soa.Self());
+ MutableReflectiveHandle<ArtMethod> m(rhs.NewHandle(pReq->method));
PointerSize image_pointer_size = Runtime::Current()->GetClassLinker()->GetImagePointerSize();
if ((pReq->options & JDWP::INVOKE_NONVIRTUAL) == 0 && pReq->receiver.Read() != nullptr) {
- ArtMethod* actual_method =
- pReq->klass.Read()->FindVirtualMethodForVirtualOrInterface(m, image_pointer_size);
- if (actual_method != m) {
- VLOG(jdwp) << "ExecuteMethod translated " << ArtMethod::PrettyMethod(m)
- << " to " << ArtMethod::PrettyMethod(actual_method);
+ MutableReflectiveHandle<ArtMethod> actual_method(rhs.NewHandle(
+ pReq->klass.Read()->FindVirtualMethodForVirtualOrInterface(m.Get(), image_pointer_size)));
+ if (actual_method.Get() != m.Get()) {
+ VLOG(jdwp) << "ExecuteMethod translated " << m->PrettyMethod()
+ << " to " << actual_method->PrettyMethod();
m = actual_method;
}
}
- VLOG(jdwp) << "ExecuteMethod " << ArtMethod::PrettyMethod(m)
+ VLOG(jdwp) << "ExecuteMethod " << m->PrettyMethod()
<< " receiver=" << pReq->receiver.Read()
<< " arg_count=" << pReq->arg_count;
CHECK(m != nullptr);