summaryrefslogtreecommitdiffstats
path: root/vm/Debugger.c
diff options
context:
space:
mode:
authorThe Android Open Source Project <initial-contribution@android.com>2009-03-18 22:20:24 -0700
committerThe Android Open Source Project <initial-contribution@android.com>2009-03-18 22:20:24 -0700
commit99409883d9c4c0ffb49b070ce307bb33a9dfe9f1 (patch)
tree47fa49e57ca43a07d37839ef5db35b705ec738fe /vm/Debugger.c
parent27e65e506369aa7eaca3e92a77631af63079ebd6 (diff)
downloadandroid_dalvik-99409883d9c4c0ffb49b070ce307bb33a9dfe9f1.tar.gz
android_dalvik-99409883d9c4c0ffb49b070ce307bb33a9dfe9f1.tar.bz2
android_dalvik-99409883d9c4c0ffb49b070ce307bb33a9dfe9f1.zip
auto import //branches/master/...@140412
Diffstat (limited to 'vm/Debugger.c')
-rw-r--r--vm/Debugger.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/vm/Debugger.c b/vm/Debugger.c
index c667893c3..3affa976f 100644
--- a/vm/Debugger.c
+++ b/vm/Debugger.c
@@ -2697,10 +2697,10 @@ JdwpError dvmDbgInvokeMethod(ObjectId threadId, ObjectId objectId,
dvmUnlockThreadList();
/*
- * We change our thread status (which should be THREAD_RUNNING) so the
- * VM can suspend for a GC if the invoke request causes us to run out
- * of memory. It's also a good idea to change it before locking the
- * invokeReq mutex, although that should never be held for long.
+ * We change our (JDWP thread) status, which should be THREAD_RUNNING,
+ * so the VM can suspend for a GC if the invoke request causes us to
+ * run out of memory. It's also a good idea to change it before locking
+ * the invokeReq mutex, although that should never be held for long.
*/
Thread* self = dvmThreadSelf();
int oldStatus = dvmChangeStatus(self, THREAD_VMWAIT);
@@ -2774,18 +2774,25 @@ static u1 resultTagFromSignature(const Method* method)
/*
* Execute the method described by "*pReq".
+ *
+ * We're currently in VMWAIT, because we're stopped on a breakpoint. We
+ * want to switch to RUNNING while we execute.
*/
void dvmDbgExecuteMethod(DebugInvokeReq* pReq)
{
Thread* self = dvmThreadSelf();
const Method* meth;
Object* oldExcept;
+ int oldStatus;
/*
* We can be called while an exception is pending in the VM. We need
* to preserve that across the method invocation.
*/
oldExcept = dvmGetException(self);
+ dvmClearException(self);
+
+ oldStatus = dvmChangeStatus(self, THREAD_RUNNING);
/*
* Translate the method through the vtable, unless we're calling a
@@ -2832,6 +2839,7 @@ void dvmDbgExecuteMethod(DebugInvokeReq* pReq)
if (oldExcept != NULL)
dvmSetException(self, oldExcept);
+ dvmChangeStatus(self, oldStatus);
}
// for dvmAddressSetForLine