summaryrefslogtreecommitdiffstats
path: root/vm/Debugger.c
diff options
context:
space:
mode:
authorAndy McFadden <fadden@android.com>2010-10-07 15:11:43 -0700
committerAndy McFadden <fadden@android.com>2010-10-08 10:51:11 -0700
commit50cab51bb381c5da01adfd61954ddca37607f51e (patch)
treefc23276ce8a8773de2d4c3cd31ff374152b73b21 /vm/Debugger.c
parenta7f5f9043f1ec312b3020ddae9b98937c9d462d3 (diff)
downloadandroid_dalvik-50cab51bb381c5da01adfd61954ddca37607f51e.tar.gz
android_dalvik-50cab51bb381c5da01adfd61954ddca37607f51e.tar.bz2
android_dalvik-50cab51bb381c5da01adfd61954ddca37607f51e.zip
Track result from dvmCallMethod
When dvmCallMethod returns an object reference, we need to ensure that the GC doesn't release or relocate the storage. Unless we have a clear view of how the object is used, we need to explicitly track and release it. This adds additional tracking, or comments indicating that explicit tracking is not necessary. On a similar note, clearing/restoring a pending exception requires explicit tracking of that exception, since there's a fair chance that it's no longer in the root set. That needed fixing in a couple of places. Bug 3009076. Change-Id: I39def8c3a5a628f0ee86fc094e34d7c69248c28b
Diffstat (limited to 'vm/Debugger.c')
-rw-r--r--vm/Debugger.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/vm/Debugger.c b/vm/Debugger.c
index 7706efb50..4f392360b 100644
--- a/vm/Debugger.c
+++ b/vm/Debugger.c
@@ -2888,6 +2888,7 @@ void dvmDbgExecuteMethod(DebugInvokeReq* pReq)
* to preserve that across the method invocation.
*/
oldExcept = dvmGetException(self);
+ dvmAddTrackedAlloc(oldExcept, self);
dvmClearException(self);
oldStatus = dvmChangeStatus(self, THREAD_RUNNING);
@@ -2941,6 +2942,7 @@ void dvmDbgExecuteMethod(DebugInvokeReq* pReq)
if (oldExcept != NULL)
dvmSetException(self, oldExcept);
+ dvmReleaseTrackedAlloc(oldExcept, self);
dvmChangeStatus(self, oldStatus);
}