OSDN Git Service

Rearrange JDWP cleanup.
authorAndy McFadden <fadden@android.com>
Thu, 25 Feb 2010 20:31:04 +0000 (12:31 -0800)
committerAndy McFadden <fadden@android.com>
Thu, 25 Feb 2010 20:32:32 +0000 (12:32 -0800)
This moves the "get rid of the breakpoints" part before the "tell the
rest of the VM that there's no debugger attached" part.  Hitting a
breakpoint when there's no debugger attached is not expected.

For bug 2461667.

vm/jdwp/JdwpMain.c

index 540259d..ef24618 100644 (file)
@@ -148,7 +148,8 @@ fail:
 
 /*
  * Reset all session-related state.  There should not be an active connection
- * to the client at this point (we may be listening for a new one though).
+ * to the client at this point.  The rest of the VM still thinks there is
+ * a debugger attached.
  *
  * This includes freeing up the debugger event list.
  */
@@ -318,14 +319,15 @@ static void* jdwpThreadStart(void* arg)
             dvmDbgThreadWaiting();
         }
 
-        /* interpreter can ignore breakpoints */
+        /* release session state, e.g. remove breakpoint instructions */
+        dvmJdwpResetState(state);
+
+        /* tell the interpreter that the debugger is no longer around */
         dvmDbgDisconnected();
 
-        /* if we had stuff suspended, resume it now */
+        /* if we had threads suspended, resume them now */
         dvmUndoDebuggerSuspensions();
 
-        dvmJdwpResetState(state);
-
         /* if we connected out, this was a one-shot deal */
         if (!state->params.server)
             state->run = false;