OSDN Git Service

Merge "Bug fix for control-flow construction involving nested loops."
[android-x86/dalvik.git] / vm / Debugger.cpp
index 9b5657b..5c44f93 100644 (file)
@@ -223,7 +223,7 @@ static ObjectId registerObject(const Object* obj, RegistryType type, bool reg)
     dvmHashTableLock(gDvm.dbgRegistry);
     if (!gDvm.debuggerConnected) {
         /* debugger has detached while we were doing stuff? */
-        LOGI("ignoring registerObject request in thread=%d",
+        ALOGI("ignoring registerObject request in thread=%d",
             dvmThreadSelf()->threadId);
         //dvmAbort();
         goto bail;
@@ -395,7 +395,7 @@ void dvmDbgActive()
     if (gDvm.debuggerActive)
         return;
 
-    LOGI("Debugger is active");
+    ALOGI("Debugger is active");
     dvmInitBreakpoints();
     gDvm.debuggerActive = true;
     dvmEnableAllSubMode(kSubModeDebuggerActive);
@@ -425,7 +425,7 @@ void dvmDbgDisconnected()
     dvmHashTableLock(gDvm.dbgRegistry);
     gDvm.debuggerConnected = false;
 
-    LOGD("Debugger has detached; object registry had %d entries",
+    ALOGD("Debugger has detached; object registry had %d entries",
         dvmHashTableNumEntries(gDvm.dbgRegistry));
     //int i;
     //for (i = 0; i < gDvm.dbgRegistryNext; i++)
@@ -489,7 +489,7 @@ void dvmDbgExit(int status)
 {
     // TODO? invoke System.exit() to perform exit processing; ends up
     // in System.exitInternal(), which can call JNI exit hook
-    LOGI("GC lifetime allocation: %d bytes", gDvm.allocProf.allocCount);
+    ALOGI("GC lifetime allocation: %d bytes", gDvm.allocProf.allocCount);
     if (CALC_CACHE_STATS) {
         dvmDumpAtomicCacheStats(gDvm.instanceofCache);
         dvmDumpBootClassPath();
@@ -587,7 +587,7 @@ void dvmDbgGetClassList(u4* pNumClasses, RefTypeId** pClassRefBuf)
         (RefTypeId*)malloc(sizeof(RefTypeId) * *pNumClasses);
 
     if (dvmHashForeach(gDvm.loadedClasses, copyRefType, &pRefType) != 0) {
-        LOGW("Warning: problem getting class list");
+        ALOGW("Warning: problem getting class list");
         /* not really expecting this to happen */
     } else {
         assert(pRefType - *pClassRefBuf == (int) *pNumClasses);
@@ -794,7 +794,7 @@ static bool isTagPrimitive(u1 tag)
     case JT_CLASS_LOADER:
         return false;
     default:
-        LOGE("ERROR: unhandled tag '%c'", tag);
+        ALOGE("ERROR: unhandled tag '%c'", tag);
         assert(false);
         return false;
     }
@@ -889,7 +889,7 @@ int dvmDbgGetTagWidth(int tag)
     case JT_LONG:
         return 8;
     default:
-        LOGE("ERROR: unhandled tag '%c'", tag);
+        ALOGE("ERROR: unhandled tag '%c'", tag);
         assert(false);
         return -1;
     }
@@ -996,7 +996,7 @@ bool dvmDbgOutputArray(ObjectId arrayId, int firstIndex, int count,
     assert(dvmIsArray(arrayObj));
 
     if (firstIndex + count > (int)arrayObj->length) {
-        LOGW("Request for index=%d + count=%d excceds length=%d",
+        ALOGW("Request for index=%d + count=%d excceds length=%d",
             firstIndex, count, arrayObj->length);
         return false;
     }
@@ -1047,7 +1047,7 @@ bool dvmDbgSetArrayElements(ObjectId arrayId, int firstIndex, int count,
     assert(dvmIsArray(arrayObj));
 
     if (firstIndex + count > (int)arrayObj->length) {
-        LOGW("Attempt to set index=%d + count=%d excceds length=%d",
+        ALOGW("Attempt to set index=%d + count=%d excceds length=%d",
             firstIndex, count, arrayObj->length);
         return false;
     }
@@ -1264,20 +1264,15 @@ void dvmDbgOutputAllMethods(RefTypeId refTypeId, bool withGeneric,
 void dvmDbgOutputAllInterfaces(RefTypeId refTypeId, ExpandBuf* pReply)
 {
     ClassObject* clazz;
-    int i, start, count;
+    int i, count;
 
     clazz = refTypeIdToClassObject(refTypeId);
     assert(clazz != NULL);
 
-    if (clazz->super == NULL)
-        start = 0;
-    else
-        start = clazz->super->iftableCount;
-
-    count = clazz->iftableCount - start;
+    count = clazz->interfaceCount;
     expandBufAdd4BE(pReply, count);
-    for (i = start; i < clazz->iftableCount; i++) {
-        ClassObject* iface = clazz->iftable[i].clazz;
+    for (i = 0; i < count; i++) {
+        ClassObject* iface = clazz->interfaces[i];
         expandBufAddRefTypeId(pReply, classObjectToRefTypeId(iface));
     }
 }
@@ -1504,7 +1499,7 @@ void dvmDbgGetFieldValue(ObjectId objectId, FieldId fieldId, ExpandBuf* pReply)
             expandBufAdd8BE(pReply, dvmGetFieldLong(obj, ifield->byteOffset));
             break;
         default:
-            LOGE("ERROR: unhandled field type '%s'", ifield->signature);
+            ALOGE("ERROR: unhandled field type '%s'", ifield->signature);
             assert(false);
             break;
         }
@@ -1551,7 +1546,7 @@ void dvmDbgSetFieldValue(ObjectId objectId, FieldId fieldId, u8 value,
         dvmSetFieldLong(obj, field->byteOffset, value);
         break;
     default:
-        LOGE("ERROR: unhandled class type '%s'", field->signature);
+        ALOGE("ERROR: unhandled class type '%s'", field->signature);
         assert(false);
         break;
     }
@@ -1608,7 +1603,7 @@ void dvmDbgGetStaticFieldValue(RefTypeId refTypeId, FieldId fieldId,
             expandBufAdd8BE(pReply, value.j);
             break;
         default:
-            LOGE("ERROR: unhandled field type '%s'", sfield->signature);
+            ALOGE("ERROR: unhandled field type '%s'", sfield->signature);
             assert(false);
             break;
         }
@@ -1667,7 +1662,7 @@ void dvmDbgSetStaticFieldValue(RefTypeId refTypeId, FieldId fieldId,
         dvmSetStaticFieldDouble(sfield, value.d);
         break;
     default:
-        LOGE("ERROR: unhandled class type '%s'", sfield->signature);
+        ALOGE("ERROR: unhandled class type '%s'", sfield->signature);
         assert(false);
         break;
     }
@@ -2159,7 +2154,7 @@ void dvmDbgSuspendThread(ObjectId threadId)
     thread = threadObjToThread(threadObj);
     if (thread == NULL) {
         /* can happen if our ThreadDeath notify crosses in the mail */
-        LOGW("WARNING: threadid=%llx obj=%p no match", threadId, threadObj);
+        ALOGW("WARNING: threadid=%llx obj=%p no match", threadId, threadObj);
     } else {
         dvmSuspendThread(thread);
     }
@@ -2179,7 +2174,7 @@ void dvmDbgResumeThread(ObjectId threadId)
 
     thread = threadObjToThread(threadObj);
     if (thread == NULL) {
-        LOGW("WARNING: threadid=%llx obj=%p no match", threadId, threadObj);
+        ALOGW("WARNING: threadid=%llx obj=%p no match", threadId, threadObj);
     } else {
         dvmResumeThread(thread);
     }
@@ -2226,7 +2221,7 @@ static Object* getThisObject(const u4* framePtr)
         thisObj = (Object*) framePtr[argOffset];
 
     if (thisObj != NULL && !dvmIsHeapAddress(thisObj)) {
-        LOGW("Debugger: invalid 'this' pointer %p in %s.%s; returning NULL",
+        ALOGW("Debugger: invalid 'this' pointer %p in %s.%s; returning NULL",
             framePtr, method->clazz->descriptor, method->name);
         thisObj = NULL;
     }
@@ -2299,7 +2294,7 @@ void dvmDbgGetLocalValue(ObjectId threadId, FrameId frameId, int slot,
             /* convert to "ObjectId" */
             objVal = (Object*)framePtr[slot];
             if (objVal != NULL && !dvmIsHeapAddress(objVal)) {
-                LOGW("JDWP: slot %d expected to hold array, %p invalid",
+                ALOGW("JDWP: slot %d expected to hold array, %p invalid",
                     slot, objVal);
                 dvmAbort();         // DEBUG: make it obvious
                 objVal = NULL;
@@ -2315,7 +2310,7 @@ void dvmDbgGetLocalValue(ObjectId threadId, FrameId frameId, int slot,
             objVal = (Object*)framePtr[slot];
 
             if (objVal != NULL && !dvmIsHeapAddress(objVal)) {
-                LOGW("JDWP: slot %d expected to hold object, %p invalid",
+                ALOGW("JDWP: slot %d expected to hold object, %p invalid",
                     slot, objVal);
                 dvmAbort();         // DEBUG: make it obvious
                 objVal = NULL;
@@ -2331,7 +2326,7 @@ void dvmDbgGetLocalValue(ObjectId threadId, FrameId frameId, int slot,
         set8BE(buf+1, longVal);
         break;
     default:
-        LOGE("ERROR: unhandled tag '%c'", tag);
+        ALOGE("ERROR: unhandled tag '%c'", tag);
         assert(false);
         break;
     }
@@ -2392,7 +2387,7 @@ void dvmDbgSetLocalValue(ObjectId threadId, FrameId frameId, int slot, u1 tag,
     case JT_CLASS_LOADER:
         /* not expecting these from debugger; fall through to failure */
     default:
-        LOGE("ERROR: unhandled tag '%c'", tag);
+        ALOGE("ERROR: unhandled tag '%c'", tag);
         assert(false);
         break;
     }
@@ -2581,11 +2576,11 @@ bool dvmDbgConfigureStep(ObjectId threadId, JdwpStepSize size,
     thread = threadObjToThread(threadObj);
 
     if (thread == NULL) {
-        LOGE("Thread for single-step not found");
+        ALOGE("Thread for single-step not found");
         goto bail;
     }
     if (!dvmIsSuspended(thread)) {
-        LOGE("Thread for single-step not suspended");
+        ALOGE("Thread for single-step not suspended");
         assert(!"non-susp step");      // I want to know if this can happen
         goto bail;
     }
@@ -2651,7 +2646,7 @@ JdwpError dvmDbgInvokeMethod(ObjectId threadId, ObjectId objectId,
      * be stuck waiting on a suspended thread.
      */
     if (targetThread->suspendCount > 1) {
-        LOGW("threadid=%d: suspend count on threadid=%d is %d, too deep "
+        ALOGW("threadid=%d: suspend count on threadid=%d is %d, too deep "
              "for method exec",
             dvmThreadSelf()->threadId, targetThread->threadId,
             targetThread->suspendCount);
@@ -2808,7 +2803,7 @@ void dvmDbgExecuteMethod(DebugInvokeReq* pReq)
     pReq->resultTag = getReturnTypeBasicTag(meth);
     if (pReq->exceptObj != 0) {
         Object* exc = dvmGetException(self);
-        LOGD("  JDWP invocation returning with exceptObj=%p (%s)",
+        ALOGD("  JDWP invocation returning with exceptObj=%p (%s)",
             exc, exc->clazz->descriptor);
         //dvmLogExceptionStackTrace();
         dvmClearException(self);