From 1c52e6d208b0455be1880e50a2fdb2c2206ec3f7 Mon Sep 17 00:00:00 2001 From: Ben Cheng Date: Fri, 2 Jul 2010 13:00:39 -0700 Subject: [PATCH] Properly set the entry point for the dbg > mterp transition. Bug: 2810533 Change-Id: I511543a9ae3ea3abc358a7982c0e5b4ab79bf58a --- vm/interp/Jit.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/vm/interp/Jit.c b/vm/interp/Jit.c index e920cfc1b..0665dcddb 100644 --- a/vm/interp/Jit.c +++ b/vm/interp/Jit.c @@ -659,6 +659,14 @@ int dvmCheckJit(const u2* pc, Thread* self, InterpState* interpState) int switchInterp = false; bool debugOrProfile = dvmDebuggerOrProfilerActive(); + /* + * Bug 2710533 - dalvik crash when disconnecting debugger + * + * Reset the entry point to the default value. If needed it will be set to a + * specific value in the corresponding case statement (eg kJitSingleStepEnd) + */ + interpState->entryPoint = kInterpEntryInstr; + /* Prepare to handle last PC and stage the current PC */ const u2 *lastPC = interpState->lastPC; interpState->lastPC = pc; @@ -836,16 +844,8 @@ int dvmCheckJit(const u2* pc, Thread* self, InterpState* interpState) } break; #endif - /* - * If the debug interpreter was entered for non-JIT reasons, check if - * the original reason still holds. If not, we have to force the - * interpreter switch here and use dvmDebuggerOrProfilerActive instead - * of dvmJitDebuggerOrProfilerActive since the latter will alwasy - * return true when the debugger/profiler is already detached and the - * JIT profiling table is restored. - */ case kJitNot: - switchInterp = !dvmDebuggerOrProfilerActive(); + switchInterp = !debugOrProfile; break; default: LOGE("Unexpected JIT state: %d entry point: %d", -- 2.11.0