OSDN Git Service

Automated import from //branches/donutburger/...@140653,140653
authorAndy McFadden <>
Wed, 25 Mar 2009 01:09:28 +0000 (18:09 -0700)
committerThe Android Open Source Project <initial-contribution@android.com>
Wed, 25 Mar 2009 01:09:28 +0000 (18:09 -0700)
vm/Globals.h
vm/alloc/HeapWorker.c

index f68e45d..2ac73ce 100644 (file)
@@ -462,10 +462,13 @@ struct DvmGlobals {
     /*
      * Compute some stats on loaded classes.
      */
-    int             numLoadedClasses;
-    int             numDeclaredMethods;
-    int             numDeclaredInstFields;
-    int             numDeclaredStaticFields;
+    int         numLoadedClasses;
+    int         numDeclaredMethods;
+    int         numDeclaredInstFields;
+    int         numDeclaredStaticFields;
+
+    /* when using a native debugger, set this to suppress watchdog timers */
+    bool        nativeDebuggerActive;
 
     /*
      * JDWP debugger support.
index 0244cca..b4a2d0e 100644 (file)
@@ -111,7 +111,7 @@ void dvmHeapWorkerShutdown(void)
 }
 
 /* Make sure that the HeapWorker thread hasn't spent an inordinate
- * amount of time inside interpreted a finalizer.
+ * amount of time inside a finalizer.
  *
  * Aborts the VM if the thread appears to be wedged.
  *
@@ -132,12 +132,16 @@ void dvmAssertHeapWorkerThreadRunning()
         u8 nowCpu = dvmGetOtherThreadCpuTimeUsec(gDvm.heapWorkerHandle);
         u8 deltaCpu = nowCpu - heapWorkerInterpCpuStartTime;
 
-        if (delta > HEAP_WORKER_WATCHDOG_TIMEOUT && gDvm.debuggerActive) {
+        if (delta > HEAP_WORKER_WATCHDOG_TIMEOUT &&
+            (gDvm.debuggerActive || gDvm.nativeDebuggerActive))
+        {
             /*
              * Debugger suspension can block the thread indefinitely.  For
              * best results we should reset this explicitly whenever the
-             * HeapWorker thread is resumed.  Ignoring the yelp isn't
-             * quite right but will do for a quick fix.
+             * HeapWorker thread is resumed.  Unfortunately this is also
+             * affected by native debuggers, and we have no visibility
+             * into how they're manipulating us.  So, we ignore the
+             * watchdog and just reset the timer.
              */
             LOGI("Debugger is attached -- suppressing HeapWorker watchdog\n");
             heapWorkerInterpStartTime = now;        /* reset timer */