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;
void dvmDbgRegisterObjectId(ObjectId id)
{
Object* obj = (Object*)(u4) id;
- LOGV("+++ registering %p (%s)", obj, obj->clazz->descriptor);
+ ALOGV("+++ registering %p (%s)", obj, obj->clazz->descriptor);
registerObject(obj, kObjectId, true);
}
{
assert(!gDvm.debuggerConnected);
- LOGV("JDWP has attached");
+ ALOGV("JDWP has attached");
assert(dvmHashTableNumEntries(gDvm.dbgRegistry) == 0);
gDvm.debuggerConnected = true;
}
if (gDvm.debuggerActive)
return;
- LOGI("Debugger is active");
+ ALOGI("Debugger is active");
dvmInitBreakpoints();
gDvm.debuggerActive = true;
dvmEnableAllSubMode(kSubModeDebuggerActive);
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++)
{
// 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();
(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);
case JT_CLASS_LOADER:
return false;
default:
- LOGE("ERROR: unhandled tag '%c'", tag);
+ ALOGE("ERROR: unhandled tag '%c'", tag);
assert(false);
return false;
}
case JT_LONG:
return 8;
default:
- LOGE("ERROR: unhandled tag '%c'", tag);
+ ALOGE("ERROR: unhandled tag '%c'", tag);
assert(false);
return -1;
}
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;
}
pObjects = (Object**) data;
pObjects += firstIndex;
- LOGV(" --> copying %d object IDs", count);
+ ALOGV(" --> copying %d object IDs", count);
//assert(tag == JT_OBJECT); // could be object or "refined" type
for (i = 0; i < count; i++, pObjects++) {
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;
}
if (isTagPrimitive(tag)) {
int width = dvmDbgGetTagWidth(tag);
- LOGV(" --> setting %d '%c' width=%d", count, tag, width);
+ ALOGV(" --> setting %d '%c' width=%d", count, tag, width);
copyValuesFromBE(data + firstIndex*width, buf, count, width);
} else {
pObjects = (Object**) data;
pObjects += firstIndex;
- LOGV(" --> setting %d objects", count);
+ ALOGV(" --> setting %d objects", count);
/* should do array type check here */
for (i = 0; i < count; i++) {
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));
}
}
else if (slot == 0) // always remap slot 0
newSlot = kSlot0Sub;
- LOGV("untweak: %d to %d", slot, newSlot);
+ ALOGV("untweak: %d to %d", slot, newSlot);
return newSlot;
}
newSlot = method->registersSize - method->insSize;
}
- LOGV("untweak: %d to %d", slot, newSlot);
+ ALOGV("untweak: %d to %d", slot, newSlot);
return newSlot;
}
reg = (u2) tweakSlot(reg, name);
- LOGV(" %2d: %d(%d) '%s' '%s' slot=%d",
+ ALOGV(" %2d: %d(%d) '%s' '%s' slot=%d",
pContext->numItems, startAddress, endAddress - startAddress,
name, descriptor, reg);
tag = tagFromObject(objVal);
expandBufAdd1(pReply, tag);
expandBufAddObjectId(pReply, objectToObjectId(objVal));
- LOGV(" --> ifieldId %x --> tag '%c' %p", fieldId, tag, objVal);
+ ALOGV(" --> ifieldId %x --> tag '%c' %p", fieldId, tag, objVal);
} else {
- LOGV(" --> ifieldId %x --> tag '%c'", fieldId, tag);
+ ALOGV(" --> ifieldId %x --> tag '%c'", fieldId, tag);
expandBufAdd1(pReply, tag);
switch (tag) {
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;
}
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;
}
tag = tagFromObject(objVal);
expandBufAdd1(pReply, tag);
expandBufAddObjectId(pReply, objectToObjectId(objVal));
- LOGV(" --> sfieldId %x --> tag '%c' %p", fieldId, tag, objVal);
+ ALOGV(" --> sfieldId %x --> tag '%c' %p", fieldId, tag, objVal);
} else {
JValue value;
- LOGV(" --> sfieldId %x --> tag '%c'", fieldId, tag);
+ ALOGV(" --> sfieldId %x --> tag '%c'", fieldId, tag);
expandBufAdd1(pReply, tag);
switch (tag) {
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;
}
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;
}
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);
}
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);
}
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;
}
/* 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;
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;
set8BE(buf+1, longVal);
break;
default:
- LOGE("ERROR: unhandled tag '%c'", tag);
+ ALOGE("ERROR: unhandled tag '%c'", tag);
assert(false);
break;
}
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;
}
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;
}
* 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);
Thread* self = dvmThreadSelf();
ThreadStatus oldStatus = dvmChangeStatus(self, THREAD_VMWAIT);
- LOGV(" Transferring control to event thread");
+ ALOGV(" Transferring control to event thread");
dvmLockMutex(&targetThread->invokeReq.lock);
if ((options & INVOKE_SINGLE_THREADED) == 0) {
- LOGV(" Resuming all threads");
+ ALOGV(" Resuming all threads");
dvmResumeAllThreads(SUSPEND_FOR_DEBUG_EVENT);
} else {
- LOGV(" Resuming event thread only");
+ ALOGV(" Resuming event thread only");
dvmResumeThread(targetThread);
}
&targetThread->invokeReq.lock);
}
dvmUnlockMutex(&targetThread->invokeReq.lock);
- LOGV(" Control has returned from event thread");
+ ALOGV(" Control has returned from event thread");
/* wait for thread to re-suspend itself */
dvmWaitForSuspend(targetThread);
* so we want to resume the target thread once to keep the books straight.
*/
if ((options & INVOKE_SINGLE_THREADED) == 0) {
- LOGV(" Suspending all threads");
+ ALOGV(" Suspending all threads");
dvmSuspendAllThreads(SUSPEND_FOR_DEBUG_EVENT);
- LOGV(" Resuming event thread to balance the count");
+ ALOGV(" Resuming event thread to balance the count");
dvmResumeThread(targetThread);
}
assert(sizeof(jvalue) == sizeof(u8));
- IF_LOGV() {
+ IF_ALOGV() {
char* desc = dexProtoCopyMethodDescriptor(&meth->prototype);
- LOGV("JDWP invoking method %p/%p %s.%s:%s",
+ ALOGV("JDWP invoking method %p/%p %s.%s:%s",
pReq->method, meth, meth->clazz->descriptor, meth->name, desc);
free(desc);
}
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);
void dvmDbgDdmSendChunkV(int type, const struct iovec* iov, int iovcnt)
{
if (gDvm.jdwpState == NULL) {
- LOGV("Debugger thread not active, ignoring DDM send (t=0x%08x)",
+ ALOGV("Debugger thread not active, ignoring DDM send (t=0x%08x)",
type);
return;
}