From 15e9ad1d028d7f12cb598b075453173532a00d91 Mon Sep 17 00:00:00 2001 From: Jeff Hao Date: Tue, 19 May 2015 20:30:23 -0700 Subject: Intercept JNI invocation of String. methods. libmono uses JNI AllocObject and CallNonvirtualVoidMethod to create and initialize a string instead of using the recommended NewObject. This change adds an intercept to change the String. call to a StringFactory call instead. Then, it uses the object id of the original string object referrer and maps it to the result of the StringFactory. Bug: 21288130 Change-Id: Ib4db402c178bc37188d5c5faf30b6e4fdc747b17 --- runtime/debugger.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'runtime/debugger.cc') diff --git a/runtime/debugger.cc b/runtime/debugger.cc index 852ba49cd2..0eb7f2b855 100644 --- a/runtime/debugger.cc +++ b/runtime/debugger.cc @@ -3974,7 +3974,8 @@ void Dbg::ExecuteMethod(DebugInvokeReq* pReq) { CHECK_EQ(sizeof(jvalue), sizeof(uint64_t)); - JValue result = InvokeWithJValues(soa, pReq->receiver.Read(), soa.EncodeMethod(m.Get()), + ScopedLocalRef ref(soa.Env(), soa.AddLocalReference(pReq->receiver.Read())); + JValue result = InvokeWithJValues(soa, ref.get(), soa.EncodeMethod(m.Get()), reinterpret_cast(pReq->arg_values)); pReq->result_tag = BasicTagFromDescriptor(m.Get()->GetShorty()); -- cgit v1.2.3