summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Bornstein <danfuzz@android.com>2011-05-26 10:11:58 -0700
committerDan Bornstein <danfuzz@android.com>2011-05-26 10:11:58 -0700
commit60fc806b679a3655c228b4093058c59941a49cfe (patch)
tree06b08460aa3a4c5a56b553b6cb90a0f607beef18
parentd9d1a8685a394c7fd67d87aa52e826b88c981994 (diff)
downloadandroid_dalvik-60fc806b679a3655c228b4093058c59941a49cfe.tar.gz
android_dalvik-60fc806b679a3655c228b4093058c59941a49cfe.tar.bz2
android_dalvik-60fc806b679a3655c228b4093058c59941a49cfe.zip
Further conservation of newlines.
Friends don't let friends end LOG() strings with newlines. Change-Id: I5a18c766c90c4ab5f03caa6acd601d34d91beb00
-rw-r--r--dexopt/OptMain.cpp40
-rw-r--r--vm/AllocTracker.cpp20
-rw-r--r--vm/AtomicCache.cpp2
-rw-r--r--vm/BitVector.cpp6
-rw-r--r--vm/CheckJni.cpp4
-rw-r--r--vm/Common.h2
-rw-r--r--vm/Ddm.cpp26
-rw-r--r--vm/Debugger.cpp96
-rw-r--r--vm/DvmDex.cpp30
-rw-r--r--vm/Exception.cpp60
-rw-r--r--vm/Hash.cpp16
-rw-r--r--vm/IndirectRefTable.cpp40
-rw-r--r--vm/Init.cpp72
-rw-r--r--vm/InitRefs.cpp18
-rw-r--r--vm/InlineNative.cpp16
-rw-r--r--vm/JarFile.cpp36
-rw-r--r--vm/LinearAlloc.cpp62
-rw-r--r--vm/Misc.cpp26
-rw-r--r--vm/Native.cpp56
-rw-r--r--vm/PointerSet.cpp12
-rw-r--r--vm/Profile.cpp38
-rw-r--r--vm/RawDexFile.cpp4
-rw-r--r--vm/ReferenceTable.cpp32
-rw-r--r--vm/SignalCatcher.cpp20
-rw-r--r--vm/StdioConverter.cpp24
-rw-r--r--vm/Sync.cpp6
-rw-r--r--vm/Thread.cpp196
-rw-r--r--vm/UtfString.cpp2
-rw-r--r--vm/alloc/Alloc.cpp12
-rw-r--r--vm/alloc/Copying.cpp38
-rw-r--r--vm/alloc/DdmHeap.cpp18
-rw-r--r--vm/alloc/Heap.cpp14
-rw-r--r--vm/alloc/HeapSource.cpp26
-rw-r--r--vm/analysis/CodeVerify.cpp356
-rw-r--r--vm/analysis/DexPrepare.cpp186
-rw-r--r--vm/analysis/DexVerify.cpp60
-rw-r--r--vm/analysis/Liveness.cpp10
-rw-r--r--vm/analysis/Optimize.cpp82
-rw-r--r--vm/analysis/RegisterMap.cpp132
-rw-r--r--vm/analysis/VerifySubs.cpp4
-rw-r--r--vm/analysis/VfyBasicBlock.cpp14
-rw-r--r--vm/arch/generic/Call.cpp4
-rw-r--r--vm/compiler/Compiler.cpp14
-rw-r--r--vm/compiler/Frontend.cpp4
-rw-r--r--vm/compiler/Utility.cpp8
-rw-r--r--vm/compiler/codegen/arm/ArchUtility.cpp54
-rw-r--r--vm/compiler/codegen/arm/Assemble.cpp8
-rw-r--r--vm/compiler/codegen/arm/CodegenDriver.cpp10
-rw-r--r--vm/compiler/codegen/arm/armv7-a-neon/MethodCodegenDriver.cpp2
-rw-r--r--vm/hprof/Hprof.cpp12
-rw-r--r--vm/hprof/HprofOutput.cpp2
-rw-r--r--vm/interp/Interp.cpp72
-rw-r--r--vm/interp/Stack.cpp58
-rw-r--r--vm/jdwp/ExpandBuf.cpp2
-rw-r--r--vm/jdwp/JdwpAdb.cpp60
-rw-r--r--vm/jdwp/JdwpEvent.cpp68
-rw-r--r--vm/jdwp/JdwpHandler.cpp156
-rw-r--r--vm/jdwp/JdwpMain.cpp30
-rw-r--r--vm/jdwp/JdwpSocket.cpp84
-rw-r--r--vm/mterp/Mterp.cpp12
-rw-r--r--vm/mterp/c/OP_APUT_OBJECT.cpp2
-rw-r--r--vm/mterp/c/OP_BREAKPOINT.cpp2
-rw-r--r--vm/mterp/c/OP_MONITOR_ENTER.cpp2
-rw-r--r--vm/mterp/c/OP_MONITOR_EXIT.cpp2
-rw-r--r--vm/mterp/c/OP_PACKED_SWITCH.cpp2
-rw-r--r--vm/mterp/c/OP_SPARSE_SWITCH.cpp2
-rw-r--r--vm/mterp/c/OP_THROW.cpp2
-rw-r--r--vm/mterp/c/OP_UNUSED_F1FF.cpp2
-rw-r--r--vm/mterp/c/gotoTargets.cpp40
-rw-r--r--vm/mterp/c/header.cpp16
-rw-r--r--vm/mterp/c/opcommon.cpp10
-rw-r--r--vm/mterp/common/asm-constants.h6
-rw-r--r--vm/mterp/cstubs/entry.cpp4
-rw-r--r--vm/mterp/out/InterpC-allstubs.cpp86
-rw-r--r--vm/mterp/out/InterpC-armv5te-vfp.cpp26
-rw-r--r--vm/mterp/out/InterpC-armv5te.cpp26
-rw-r--r--vm/mterp/out/InterpC-armv7-a-neon.cpp26
-rw-r--r--vm/mterp/out/InterpC-armv7-a.cpp26
-rw-r--r--vm/mterp/out/InterpC-portable.cpp84
-rw-r--r--vm/mterp/out/InterpC-x86-atom.cpp68
-rw-r--r--vm/mterp/out/InterpC-x86.cpp66
-rw-r--r--vm/mterp/portable/entry.cpp2
-rw-r--r--vm/native/InternalNative.cpp10
-rw-r--r--vm/native/dalvik_system_DexFile.cpp32
-rw-r--r--vm/native/dalvik_system_VMDebug.cpp16
-rw-r--r--vm/native/dalvik_system_VMStack.cpp2
-rw-r--r--vm/native/dalvik_system_Zygote.cpp16
-rw-r--r--vm/native/java_lang_Class.cpp26
-rw-r--r--vm/native/java_lang_Runtime.cpp4
-rw-r--r--vm/native/java_lang_System.cpp8
-rw-r--r--vm/native/java_lang_Throwable.cpp2
-rw-r--r--vm/native/java_lang_VMClassLoader.cpp6
-rw-r--r--vm/native/java_lang_VMThread.cpp2
-rw-r--r--vm/native/java_lang_reflect_Array.cpp10
-rw-r--r--vm/native/java_lang_reflect_Constructor.cpp2
-rw-r--r--vm/native/java_lang_reflect_Field.cpp12
-rw-r--r--vm/native/java_lang_reflect_Method.cpp2
-rw-r--r--vm/native/org_apache_harmony_dalvik_ddmc_DdmVmInternal.cpp2
-rw-r--r--vm/oo/AccessCheck.cpp2
-rw-r--r--vm/oo/Array.cpp26
-rw-r--r--vm/oo/Class.cpp302
-rw-r--r--vm/oo/Object.cpp2
-rw-r--r--vm/oo/Resolve.cpp28
-rw-r--r--vm/reflect/Annotation.cpp78
-rw-r--r--vm/reflect/Proxy.cpp38
-rw-r--r--vm/reflect/Reflect.cpp30
-rw-r--r--vm/test/TestHash.cpp18
-rw-r--r--vm/test/TestIndirectRefTable.cpp98
108 files changed, 1925 insertions, 1925 deletions
diff --git a/dexopt/OptMain.cpp b/dexopt/OptMain.cpp
index a7a898d9a..630ca384b 100644
--- a/dexopt/OptMain.cpp
+++ b/dexopt/OptMain.cpp
@@ -73,7 +73,7 @@ static int extractAndProcessZip(int zipFd, int cacheFd,
/* make sure we're still at the start of an empty file */
if (lseek(cacheFd, 0, SEEK_END) != 0) {
- LOGE("DexOptZ: new cache file '%s' is not empty\n", debugFileName);
+ LOGE("DexOptZ: new cache file '%s' is not empty", debugFileName);
goto bail;
}
@@ -94,13 +94,13 @@ static int extractAndProcessZip(int zipFd, int cacheFd,
* Open the zip archive, find the DEX entry.
*/
if (dexZipPrepArchive(zipFd, debugFileName, &zippy) != 0) {
- LOGW("DexOptZ: unable to open zip archive '%s'\n", debugFileName);
+ LOGW("DexOptZ: unable to open zip archive '%s'", debugFileName);
goto bail;
}
zipEntry = dexZipFindEntry(&zippy, kClassesDex);
if (zipEntry == NULL) {
- LOGW("DexOptZ: zip archive '%s' does not include %s\n",
+ LOGW("DexOptZ: zip archive '%s' does not include %s",
debugFileName, kClassesDex);
goto bail;
}
@@ -111,7 +111,7 @@ static int extractAndProcessZip(int zipFd, int cacheFd,
if (dexZipGetEntryInfo(&zippy, zipEntry, NULL, &uncompLen, NULL, NULL,
&modWhen, &crc32) != 0)
{
- LOGW("DexOptZ: zip archive GetEntryInfo failed on %s\n", debugFileName);
+ LOGW("DexOptZ: zip archive GetEntryInfo failed on %s", debugFileName);
goto bail;
}
@@ -123,7 +123,7 @@ static int extractAndProcessZip(int zipFd, int cacheFd,
* Extract the DEX data into the cache file at the current offset.
*/
if (dexZipExtractEntryToFile(&zippy, zipEntry, cacheFd) != 0) {
- LOGW("DexOptZ: extraction of %s from %s failed\n",
+ LOGW("DexOptZ: extraction of %s from %s failed",
kClassesDex, debugFileName);
goto bail;
}
@@ -176,7 +176,7 @@ static int extractAndProcessZip(int zipFd, int cacheFd,
if (dvmPrepForDexOpt(bootClassPath, dexOptMode, verifyMode,
dexoptFlags) != 0)
{
- LOGE("DexOptZ: VM init failed\n");
+ LOGE("DexOptZ: VM init failed");
goto bail;
}
@@ -186,7 +186,7 @@ static int extractAndProcessZip(int zipFd, int cacheFd,
if (!dvmContinueOptimization(cacheFd, dexOffset, uncompLen, debugFileName,
modWhen, crc32, isBootstrap))
{
- LOGE("Optimization failed\n");
+ LOGE("Optimization failed");
goto bail;
}
@@ -214,7 +214,7 @@ static int processZipFile(int zipFd, int cacheFd, const char* zipName,
*/
const char* bcp = getenv("BOOTCLASSPATH");
if (bcp == NULL) {
- LOGE("DexOptZ: BOOTCLASSPATH not set\n");
+ LOGE("DexOptZ: BOOTCLASSPATH not set");
return -1;
}
@@ -235,13 +235,13 @@ static int processZipFile(int zipFd, int cacheFd, const char* zipName,
int matchOffset = match - bcp;
if (matchOffset > 0 && bcp[matchOffset-1] == ':')
matchOffset--;
- LOGV("DexOptZ: found '%s' in bootclasspath, cutting off at %d\n",
+ LOGV("DexOptZ: found '%s' in bootclasspath, cutting off at %d",
zipName, matchOffset);
bcpCopy = strdup(bcp);
bcpCopy[matchOffset] = '\0';
bcp = bcpCopy;
- LOGD("DexOptZ: truncated BOOTCLASSPATH to '%s'\n", bcp);
+ LOGD("DexOptZ: truncated BOOTCLASSPATH to '%s'", bcp);
isBootstrap = true;
}
@@ -292,7 +292,7 @@ static int fromZip(int argc, char* const argv[])
const char* dexoptFlags;
if (argc != 6) {
- LOGE("Wrong number of args for --zip (found %d)\n", argc);
+ LOGE("Wrong number of args for --zip (found %d)", argc);
goto bail;
}
@@ -429,7 +429,7 @@ static int fromDex(int argc, char* const argv[])
if (argc < 10) {
/* don't have all mandatory args */
- LOGE("Not enough arguments for --dex (found %d)\n", argc);
+ LOGE("Not enough arguments for --dex (found %d)", argc);
goto bail;
}
@@ -442,7 +442,7 @@ static int fromDex(int argc, char* const argv[])
*/
GET_ARG(vmBuildVersion, strtol, "bad vm build");
if (vmBuildVersion != DALVIK_VM_BUILD) {
- LOGE("DexOpt: build rev does not match VM: %d vs %d\n",
+ LOGE("DexOpt: build rev does not match VM: %d vs %d",
vmBuildVersion, DALVIK_VM_BUILD);
goto bail;
}
@@ -455,7 +455,7 @@ static int fromDex(int argc, char* const argv[])
GET_ARG(crc, strtoul, "bad crc");
GET_ARG(flags, strtol, "bad flags");
- LOGV("Args: fd=%d off=%ld len=%ld name='%s' mod=0x%x crc=0x%x flg=%d (argc=%d)\n",
+ LOGV("Args: fd=%d off=%ld len=%ld name='%s' mod=0x%x crc=0x%x flg=%d (argc=%d)",
fd, offset, length, debugFileName, modWhen, crc, flags, argc);
assert(argc > 0);
@@ -469,7 +469,7 @@ static int fromDex(int argc, char* const argv[])
bcpLen = 0;
for (i = 0, argp = argv; i < argc; i++) {
++argp;
- LOGV("DEP: '%s'\n", *argp);
+ LOGV("DEP: '%s'", *argp);
bcpLen += strlen(*argp) + 1;
}
@@ -488,7 +488,7 @@ static int fromDex(int argc, char* const argv[])
assert((int) strlen(bootClassPath) == bcpLen-1);
}
- LOGV(" bootclasspath is '%s'\n", bootClassPath);
+ LOGV(" bootclasspath is '%s'", bootClassPath);
/* start the VM partway */
@@ -511,7 +511,7 @@ static int fromDex(int argc, char* const argv[])
}
if (dvmPrepForDexOpt(bootClassPath, dexOptMode, verifyMode, flags) != 0) {
- LOGE("VM init failed\n");
+ LOGE("VM init failed");
goto bail;
}
@@ -521,7 +521,7 @@ static int fromDex(int argc, char* const argv[])
if (!dvmContinueOptimization(fd, offset, length, debugFileName,
modWhen, crc, (flags & DEXOPT_IS_BOOTSTRAP) != 0))
{
- LOGE("Optimization failed\n");
+ LOGE("Optimization failed");
goto bail;
}
@@ -541,13 +541,13 @@ bail:
*/
#if 0
if (vmStarted) {
- LOGI("DexOpt shutting down, result=%d\n", result);
+ LOGI("DexOpt shutting down, result=%d", result);
dvmShutdown();
}
#endif
free(bootClassPath);
- LOGV("DexOpt command complete (result=%d)\n", result);
+ LOGV("DexOpt command complete (result=%d)", result);
return result;
}
diff --git a/vm/AllocTracker.cpp b/vm/AllocTracker.cpp
index 34e0b3f8d..a9c764431 100644
--- a/vm/AllocTracker.cpp
+++ b/vm/AllocTracker.cpp
@@ -111,7 +111,7 @@ bool dvmEnableAllocTracker()
dvmLockMutex(&gDvm.allocTrackerLock);
if (gDvm.allocRecords == NULL) {
- LOGI("Enabling alloc tracker (%d entries, %d frames --> %d bytes)\n",
+ LOGI("Enabling alloc tracker (%d entries, %d frames --> %d bytes)",
kNumAllocRecords, kMaxAllocRecordStackDepth,
sizeof(AllocRecord) * kNumAllocRecords);
gDvm.allocRecordHead = gDvm.allocRecordCount = 0;
@@ -188,7 +188,7 @@ void dvmDoTrackAllocation(ClassObject* clazz, size_t size)
{
Thread* self = dvmThreadSelf();
if (self == NULL) {
- LOGW("alloc tracker: no thread\n");
+ LOGW("alloc tracker: no thread");
return;
}
@@ -351,7 +351,7 @@ static bool populateStringTables(PointerSet* classNames,
idx = (idx + 1) & (kNumAllocRecords-1);
}
- LOGI("class %d/%d, method %d/%d, file %d/%d\n",
+ LOGI("class %d/%d, method %d/%d, file %d/%d",
dvmPointerSetGetCount(classNames), classCount,
dvmPointerSetGetCount(methodNames), methodCount,
dvmPointerSetGetCount(fileNames), fileCount);
@@ -527,7 +527,7 @@ bool dvmGenerateTrackedAllocationReport(u1** pData, size_t* pDataLen)
methodNames = dvmPointerSetAlloc(128);
fileNames = dvmPointerSetAlloc(128);
if (classNames == NULL || methodNames == NULL || fileNames == NULL) {
- LOGE("Failed allocating pointer sets\n");
+ LOGE("Failed allocating pointer sets");
goto bail;
}
@@ -555,7 +555,7 @@ bool dvmGenerateTrackedAllocationReport(u1** pData, size_t* pDataLen)
totalSize += computeStringTableSize(classNames);
totalSize += computeStringTableSize(methodNames);
totalSize += computeStringTableSize(fileNames);
- LOGI("Generated AT, size is %zd/%zd\n", baseSize, totalSize);
+ LOGI("Generated AT, size is %zd/%zd", baseSize, totalSize);
/*
* Part 3: allocate a buffer and generate the output.
@@ -569,7 +569,7 @@ bool dvmGenerateTrackedAllocationReport(u1** pData, size_t* pDataLen)
strPtr += outputStringTable(methodNames, strPtr);
strPtr += outputStringTable(fileNames, strPtr);
if (strPtr - buffer != (int)totalSize) {
- LOGE("size mismatch (%d vs %zd)\n", strPtr - buffer, totalSize);
+ LOGE("size mismatch (%d vs %zd)", strPtr - buffer, totalSize);
dvmAbort();
}
//dvmPrintHexDump(buffer, totalSize);
@@ -613,11 +613,11 @@ void dvmDumpTrackedAllocations(bool enable)
int idx = headIndex();
int count = gDvm.allocRecordCount;
- LOGI("Tracked allocations, (head=%d count=%d)\n",
+ LOGI("Tracked allocations, (head=%d count=%d)",
gDvm.allocRecordHead, count);
while (count--) {
AllocRecord* pRec = &gDvm.allocRecords[idx];
- LOGI(" T=%-2d %6d %s\n",
+ LOGI(" T=%-2d %6d %s",
pRec->threadId, pRec->size, pRec->clazz->descriptor);
if (true) {
@@ -627,10 +627,10 @@ void dvmDumpTrackedAllocations(bool enable)
const Method* method = pRec->stackElem[i].method;
if (dvmIsNativeMethod(method)) {
- LOGI(" %s.%s (Native)\n",
+ LOGI(" %s.%s (Native)",
method->clazz->descriptor, method->name);
} else {
- LOGI(" %s.%s +%d\n",
+ LOGI(" %s.%s +%d",
method->clazz->descriptor, method->name,
pRec->stackElem[i].pc);
}
diff --git a/vm/AtomicCache.cpp b/vm/AtomicCache.cpp
index a6f48c2c7..28fcbfef0 100644
--- a/vm/AtomicCache.cpp
+++ b/vm/AtomicCache.cpp
@@ -156,7 +156,7 @@ void dvmUpdateAtomicCache(u4 key1, u4 key2, u4 value, AtomicCacheEntry* pEntry,
newVersion, newVersion & ~ATOMIC_LOCK_FLAG,
(volatile s4*) &pEntry->version) != 0)
{
- //LOGE("unable to reset the instanceof cache ownership\n");
+ //LOGE("unable to reset the instanceof cache ownership");
dvmAbort();
}
}
diff --git a/vm/BitVector.cpp b/vm/BitVector.cpp
index 4e9a1cb72..0ef6f6041 100644
--- a/vm/BitVector.cpp
+++ b/vm/BitVector.cpp
@@ -104,7 +104,7 @@ void dvmSetBit(BitVector* pBits, unsigned int num)
{
if (num >= pBits->storageSize * sizeof(u4) * 8) {
if (!pBits->expandable) {
- LOGE("Attempt to set bit outside valid range (%d, limit is %d)\n",
+ LOGE("Attempt to set bit outside valid range (%d, limit is %d)",
num, pBits->storageSize * sizeof(u4) * 8);
dvmAbort();
}
@@ -114,7 +114,7 @@ void dvmSetBit(BitVector* pBits, unsigned int num)
assert(newSize > pBits->storageSize);
pBits->storage = (u4*)realloc(pBits->storage, newSize * sizeof(u4));
if (pBits->storage == NULL) {
- LOGE("BitVector expansion to %d failed\n", newSize * sizeof(u4));
+ LOGE("BitVector expansion to %d failed", newSize * sizeof(u4));
dvmAbort();
}
memset(&pBits->storage[pBits->storageSize], 0x00,
@@ -206,7 +206,7 @@ int dvmCountSetBits(const BitVector* pBits)
static void checkSizes(const BitVector* bv1, const BitVector* bv2)
{
if (bv1->storageSize != bv2->storageSize) {
- LOGE("Mismatched vector sizes (%d, %d)\n",
+ LOGE("Mismatched vector sizes (%d, %d)",
bv1->storageSize, bv2->storageSize);
dvmAbort();
}
diff --git a/vm/CheckJni.cpp b/vm/CheckJni.cpp
index 21f4ed402..0830be504 100644
--- a/vm/CheckJni.cpp
+++ b/vm/CheckJni.cpp
@@ -984,10 +984,10 @@ private:
// TODO: we could mprotect instead, and keep the allocation around for a while.
// This would be even more expensive, but it might catch more errors.
// if (mprotect(fullBuf, totalByteCount, PROT_NONE) != 0) {
- // LOGW("mprotect(PROT_NONE) failed: %s\n", strerror(errno));
+ // LOGW("mprotect(PROT_NONE) failed: %s", strerror(errno));
// }
if (munmap(fullBuf, totalByteCount) != 0) {
- LOGW("munmap failed: %s\n", strerror(errno));
+ LOGW("munmap failed: %s", strerror(errno));
dvmAbort();
}
}
diff --git a/vm/Common.h b/vm/Common.h
index c0da8327a..01587b2ec 100644
--- a/vm/Common.h
+++ b/vm/Common.h
@@ -45,7 +45,7 @@
#if !defined(NDEBUG) && defined(WITH_DALVIK_ASSERT)
# undef assert
# define assert(x) \
- ((x) ? ((void)0) : (LOGE("ASSERT FAILED (%s:%d): %s\n", \
+ ((x) ? ((void)0) : (LOGE("ASSERT FAILED (%s:%d): %s", \
__FILE__, __LINE__, #x), *(int*)39=39, (void)0) )
#endif
diff --git a/vm/Ddm.cpp b/vm/Ddm.cpp
index 4bb2bb1c1..ff853e53a 100644
--- a/vm/Ddm.cpp
+++ b/vm/Ddm.cpp
@@ -61,7 +61,7 @@ bool dvmDdmHandlePacket(const u1* buf, int dataLen, u1** pReplyBuf,
*/
dataArray = dvmAllocPrimitiveArray('B', dataLen, ALLOC_DEFAULT);
if (dataArray == NULL) {
- LOGW("array alloc failed (%d)\n", dataLen);
+ LOGW("array alloc failed (%d)", dataLen);
dvmClearException(self);
goto bail;
}
@@ -75,7 +75,7 @@ bool dvmDdmHandlePacket(const u1* buf, int dataLen, u1** pReplyBuf,
length = get4BE((u1*)dataArray->contents + 4);
offset = kChunkHdrLen;
if (offset+length > (unsigned int) dataLen) {
- LOGW("WARNING: bad chunk found (len=%u pktLen=%d)\n", length, dataLen);
+ LOGW("WARNING: bad chunk found (len=%u pktLen=%d)", length, dataLen);
goto bail;
}
@@ -86,7 +86,7 @@ bool dvmDdmHandlePacket(const u1* buf, int dataLen, u1** pReplyBuf,
dvmCallMethod(self, gDvm.methDalvikDdmcServer_dispatch, NULL, &callRes,
type, dataArray, offset, length);
if (dvmCheckException(self)) {
- LOGI("Exception thrown by dispatcher for 0x%08x\n", type);
+ LOGI("Exception thrown by dispatcher for 0x%08x", type);
dvmLogExceptionStackTrace();
dvmClearException(self);
goto bail;
@@ -118,13 +118,13 @@ bool dvmDdmHandlePacket(const u1* buf, int dataLen, u1** pReplyBuf,
offset = dvmGetFieldInt(chunk, gDvm.offDalvikDdmcChunk_offset);
length = dvmGetFieldInt(chunk, gDvm.offDalvikDdmcChunk_length);
- LOGV("DDM reply: type=0x%08x data=%p offset=%d length=%d\n",
+ LOGV("DDM reply: type=0x%08x data=%p offset=%d length=%d",
type, replyData, offset, length);
if (length == 0 || replyData == NULL)
goto bail;
if (offset + length > replyData->length) {
- LOGW("WARNING: chunk off=%d len=%d exceeds reply array len %d\n",
+ LOGW("WARNING: chunk off=%d len=%d exceeds reply array len %d",
offset, length, replyData->length);
goto bail;
}
@@ -132,7 +132,7 @@ bool dvmDdmHandlePacket(const u1* buf, int dataLen, u1** pReplyBuf,
u1* reply;
reply = (u1*) malloc(length + kChunkHdrLen);
if (reply == NULL) {
- LOGW("malloc %d failed\n", length+kChunkHdrLen);
+ LOGW("malloc %d failed", length+kChunkHdrLen);
goto bail;
}
set4BE(reply + 0, type);
@@ -143,7 +143,7 @@ bool dvmDdmHandlePacket(const u1* buf, int dataLen, u1** pReplyBuf,
*pReplyLen = length + kChunkHdrLen;
result = true;
- LOGV("dvmHandleDdm returning type=%.4s buf=%p len=%d\n",
+ LOGV("dvmHandleDdm returning type=%.4s buf=%p len=%d",
(char*) reply, reply, length);
bail:
@@ -164,7 +164,7 @@ static void broadcast(int event)
Thread* self = dvmThreadSelf();
if (self->status != THREAD_RUNNING) {
- LOGE("ERROR: DDM broadcast with thread status=%d\n", self->status);
+ LOGE("ERROR: DDM broadcast with thread status=%d", self->status);
/* try anyway? */
}
@@ -180,7 +180,7 @@ static void broadcast(int event)
dvmCallMethod(self, gDvm.methDalvikDdmcServer_broadcast, NULL, &unused,
event);
if (dvmCheckException(self)) {
- LOGI("Exception thrown by broadcast(%d)\n", event);
+ LOGI("Exception thrown by broadcast(%d)", event);
dvmLogExceptionStackTrace();
dvmClearException(self);
return;
@@ -196,7 +196,7 @@ void dvmDdmConnected()
{
// TODO: any init
- LOGV("Broadcasting DDM connect\n");
+ LOGV("Broadcasting DDM connect");
broadcast(CONNECTED);
}
@@ -207,7 +207,7 @@ void dvmDdmConnected()
*/
void dvmDdmDisconnected()
{
- LOGV("Broadcasting DDM disconnect\n");
+ LOGV("Broadcasting DDM disconnect");
broadcast(DISCONNECTED);
gDvm.ddmThreadNotification = false;
@@ -230,7 +230,7 @@ void dvmDdmSetThreadNotification(bool enable)
if (enable) {
Thread* thread;
for (thread = gDvm.threadList; thread != NULL; thread = thread->next) {
- //LOGW("notify %d\n", thread->threadId);
+ //LOGW("notify %d", thread->threadId);
dvmDdmSendThreadNotification(thread, true);
}
}
@@ -431,7 +431,7 @@ ArrayObject* dvmDdmGetStackTraceById(u4 threadId)
break;
}
if (thread == NULL) {
- LOGI("dvmDdmGetStackTraceById: threadid=%d not found\n", threadId);
+ LOGI("dvmDdmGetStackTraceById: threadid=%d not found", threadId);
dvmUnlockThreadList();
return NULL;
}
diff --git a/vm/Debugger.cpp b/vm/Debugger.cpp
index 56b65f780..d4c1eb0bd 100644
--- a/vm/Debugger.cpp
+++ b/vm/Debugger.cpp
@@ -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\n",
+ LOGI("ignoring registerObject request in thread=%d",
dvmThreadSelf()->threadId);
//dvmAbort();
goto bail;
@@ -310,7 +310,7 @@ static Object* objectIdToObject(ObjectId id)
void dvmDbgRegisterObjectId(ObjectId id)
{
Object* obj = (Object*)(u4) id;
- LOGV("+++ registering %p (%s)\n", obj, obj->clazz->descriptor);
+ LOGV("+++ registering %p (%s)", obj, obj->clazz->descriptor);
registerObject(obj, kObjectId, true);
}
@@ -378,7 +378,7 @@ void dvmDbgConnected()
{
assert(!gDvm.debuggerConnected);
- LOGV("JDWP has attached\n");
+ LOGV("JDWP has attached");
assert(dvmHashTableNumEntries(gDvm.dbgRegistry) == 0);
gDvm.debuggerConnected = true;
}
@@ -395,7 +395,7 @@ void dvmDbgActive()
if (gDvm.debuggerActive)
return;
- LOGI("Debugger is active\n");
+ LOGI("Debugger is active");
dvmInitBreakpoints();
gDvm.debuggerActive = true;
dvmEnableAllSubMode(kSubModeDebuggerActive);
@@ -425,11 +425,11 @@ void dvmDbgDisconnected()
dvmHashTableLock(gDvm.dbgRegistry);
gDvm.debuggerConnected = false;
- LOGD("Debugger has detached; object registry had %d entries\n",
+ LOGD("Debugger has detached; object registry had %d entries",
dvmHashTableNumEntries(gDvm.dbgRegistry));
//int i;
//for (i = 0; i < gDvm.dbgRegistryNext; i++)
- // LOGVV("%4d: 0x%llx\n", i, gDvm.dbgRegistryTable[i]);
+ // LOGVV("%4d: 0x%llx", i, gDvm.dbgRegistryTable[i]);
dvmHashTableClear(gDvm.dbgRegistry);
dvmHashTableUnlock(gDvm.dbgRegistry);
@@ -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\n", gDvm.allocProf.allocCount);
+ LOGI("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\n");
+ LOGW("Warning: problem getting class list");
/* not really expecting this to happen */
} else {
assert(pRefType - *pClassRefBuf == (int) *pNumClasses);
@@ -612,7 +612,7 @@ void dvmDbgGetVisibleClassList(ObjectId classLoaderId, u4* pNumClasses,
classLoader = objectIdToObject(classLoaderId);
// I don't think classLoader can be NULL, but the spec doesn't say
- LOGVV("GetVisibleList: comparing to %p\n", classLoader);
+ LOGVV("GetVisibleList: comparing to %p", classLoader);
dvmHashTableLock(gDvm.loadedClasses);
@@ -632,7 +632,7 @@ void dvmDbgGetVisibleClassList(ObjectId classLoaderId, u4* pNumClasses,
if (clazz->classLoader == classLoader ||
dvmLoaderInInitiatingList(clazz, classLoader))
{
- LOGVV(" match '%s'\n", clazz->descriptor);
+ LOGVV(" match '%s'", clazz->descriptor);
(*pClassRefBuf)[numClasses++] = classObjectToRefTypeId(clazz);
}
}
@@ -794,7 +794,7 @@ static bool isTagPrimitive(u1 tag)
case JT_CLASS_LOADER:
return false;
default:
- LOGE("ERROR: unhandled tag '%c'\n", tag);
+ LOGE("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'\n", tag);
+ LOGE("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\n",
+ LOGW("Request for index=%d + count=%d excceds length=%d",
firstIndex, count, arrayObj->length);
return false;
}
@@ -1017,7 +1017,7 @@ bool dvmDbgOutputArray(ObjectId arrayId, int firstIndex, int count,
pObjects = (Object**) data;
pObjects += firstIndex;
- LOGV(" --> copying %d object IDs\n", count);
+ LOGV(" --> copying %d object IDs", count);
//assert(tag == JT_OBJECT); // could be object or "refined" type
for (i = 0; i < count; i++, pObjects++) {
@@ -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\n",
+ LOGW("Attempt to set index=%d + count=%d excceds length=%d",
firstIndex, count, arrayObj->length);
return false;
}
@@ -1057,7 +1057,7 @@ bool dvmDbgSetArrayElements(ObjectId arrayId, int firstIndex, int count,
if (isTagPrimitive(tag)) {
int width = dvmDbgGetTagWidth(tag);
- LOGV(" --> setting %d '%c' width=%d\n", count, tag, width);
+ LOGV(" --> setting %d '%c' width=%d", count, tag, width);
copyValuesFromBE(data + firstIndex*width, buf, count, width);
} else {
@@ -1360,7 +1360,7 @@ static int tweakSlot(int slot, const char* name)
else if (slot == 0) // always remap slot 0
newSlot = kSlot0Sub;
- LOGV("untweak: %d to %d\n", slot, newSlot);
+ LOGV("untweak: %d to %d", slot, newSlot);
return newSlot;
}
@@ -1379,7 +1379,7 @@ static int untweakSlot(int slot, const void* framePtr)
newSlot = method->registersSize - method->insSize;
}
- LOGV("untweak: %d to %d\n", slot, newSlot);
+ LOGV("untweak: %d to %d", slot, newSlot);
return newSlot;
}
@@ -1391,7 +1391,7 @@ static void variableTableCb (void *cnxt, u2 reg, u4 startAddress,
reg = (u2) tweakSlot(reg, name);
- LOGV(" %2d: %d(%d) '%s' '%s' slot=%d\n",
+ LOGV(" %2d: %d(%d) '%s' '%s' slot=%d",
pContext->numItems, startAddress, endAddress - startAddress,
name, descriptor, reg);
@@ -1477,11 +1477,11 @@ void dvmDbgGetFieldValue(ObjectId objectId, FieldId fieldId, ExpandBuf* pReply)
tag = tagFromObject(objVal);
expandBufAdd1(pReply, tag);
expandBufAddObjectId(pReply, objectToObjectId(objVal));
- LOGV(" --> ifieldId %x --> tag '%c' %p\n", fieldId, tag, objVal);
+ LOGV(" --> ifieldId %x --> tag '%c' %p", fieldId, tag, objVal);
} else {
JValue value;
- LOGV(" --> ifieldId %x --> tag '%c'\n", fieldId, tag);
+ LOGV(" --> ifieldId %x --> tag '%c'", fieldId, tag);
expandBufAdd1(pReply, tag);
switch (tag) {
@@ -1512,7 +1512,7 @@ void dvmDbgGetFieldValue(ObjectId objectId, FieldId fieldId, ExpandBuf* pReply)
expandBufAdd8BE(pReply, value.j);
break;
default:
- LOGE("ERROR: unhandled field type '%s'\n", ifield->signature);
+ LOGE("ERROR: unhandled field type '%s'", ifield->signature);
assert(false);
break;
}
@@ -1559,7 +1559,7 @@ void dvmDbgSetFieldValue(ObjectId objectId, FieldId fieldId, u8 value,
dvmSetFieldLong(obj, field->byteOffset, value);
break;
default:
- LOGE("ERROR: unhandled class type '%s'\n", field->signature);
+ LOGE("ERROR: unhandled class type '%s'", field->signature);
assert(false);
break;
}
@@ -1581,11 +1581,11 @@ void dvmDbgGetStaticFieldValue(RefTypeId refTypeId, FieldId fieldId,
tag = tagFromObject(objVal);
expandBufAdd1(pReply, tag);
expandBufAddObjectId(pReply, objectToObjectId(objVal));
- LOGV(" --> sfieldId %x --> tag '%c' %p\n", fieldId, tag, objVal);
+ LOGV(" --> sfieldId %x --> tag '%c' %p", fieldId, tag, objVal);
} else {
JValue value;
- LOGV(" --> sfieldId %x --> tag '%c'\n", fieldId, tag);
+ LOGV(" --> sfieldId %x --> tag '%c'", fieldId, tag);
expandBufAdd1(pReply, tag);
switch (tag) {
@@ -1616,7 +1616,7 @@ void dvmDbgGetStaticFieldValue(RefTypeId refTypeId, FieldId fieldId,
expandBufAdd8BE(pReply, value.j);
break;
default:
- LOGE("ERROR: unhandled field type '%s'\n", sfield->signature);
+ LOGE("ERROR: unhandled field type '%s'", sfield->signature);
assert(false);
break;
}
@@ -1675,7 +1675,7 @@ void dvmDbgSetStaticFieldValue(RefTypeId refTypeId, FieldId fieldId,
dvmSetStaticFieldDouble(sfield, value.d);
break;
default:
- LOGE("ERROR: unhandled class type '%s'\n", sfield->signature);
+ LOGE("ERROR: unhandled class type '%s'", sfield->signature);
assert(false);
break;
}
@@ -2167,7 +2167,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\n", threadId, threadObj);
+ LOGW("WARNING: threadid=%llx obj=%p no match", threadId, threadObj);
} else {
dvmSuspendThread(thread);
}
@@ -2187,7 +2187,7 @@ void dvmDbgResumeThread(ObjectId threadId)
thread = threadObjToThread(threadObj);
if (thread == NULL) {
- LOGW("WARNING: threadid=%llx obj=%p no match\n", threadId, threadObj);
+ LOGW("WARNING: threadid=%llx obj=%p no match", threadId, threadObj);
} else {
dvmResumeThread(thread);
}
@@ -2219,8 +2219,8 @@ static Object* getThisObject(const u4* framePtr)
return NULL;
}
- LOGVV(" Pulling this object for frame at %p\n", framePtr);
- LOGVV(" Method='%s' native=%d static=%d this=%p\n",
+ LOGVV(" Pulling this object for frame at %p", framePtr);
+ LOGVV(" Method='%s' native=%d static=%d this=%p",
method->name, dvmIsNativeMethod(method),
dvmIsStaticMethod(method), (Object*) framePtr[argOffset]);
@@ -2234,7 +2234,7 @@ static Object* getThisObject(const u4* framePtr)
thisObj = (Object*) framePtr[argOffset];
if (thisObj != NULL && !dvmIsValidObject(thisObj)) {
- LOGW("Debugger: invalid 'this' pointer %p in %s.%s; returning NULL\n",
+ LOGW("Debugger: invalid 'this' pointer %p in %s.%s; returning NULL",
framePtr, method->clazz->descriptor, method->name);
thisObj = NULL;
}
@@ -2307,7 +2307,7 @@ void dvmDbgGetLocalValue(ObjectId threadId, FrameId frameId, int slot,
/* convert to "ObjectId" */
objVal = (Object*)framePtr[slot];
if (objVal != NULL && !dvmIsValidObject(objVal)) {
- LOGW("JDWP: slot %d expected to hold array, %p invalid\n",
+ LOGW("JDWP: slot %d expected to hold array, %p invalid",
slot, objVal);
dvmAbort(); // DEBUG: make it obvious
objVal = NULL;
@@ -2323,7 +2323,7 @@ void dvmDbgGetLocalValue(ObjectId threadId, FrameId frameId, int slot,
objVal = (Object*)framePtr[slot];
if (objVal != NULL && !dvmIsValidObject(objVal)) {
- LOGW("JDWP: slot %d expected to hold object, %p invalid\n",
+ LOGW("JDWP: slot %d expected to hold object, %p invalid",
slot, objVal);
dvmAbort(); // DEBUG: make it obvious
objVal = NULL;
@@ -2339,7 +2339,7 @@ void dvmDbgGetLocalValue(ObjectId threadId, FrameId frameId, int slot,
set8BE(buf+1, longVal);
break;
default:
- LOGE("ERROR: unhandled tag '%c'\n", tag);
+ LOGE("ERROR: unhandled tag '%c'", tag);
assert(false);
break;
}
@@ -2400,7 +2400,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'\n", tag);
+ LOGE("ERROR: unhandled tag '%c'", tag);
assert(false);
break;
}
@@ -2589,11 +2589,11 @@ bool dvmDbgConfigureStep(ObjectId threadId, JdwpStepSize size,
thread = threadObjToThread(threadObj);
if (thread == NULL) {
- LOGE("Thread for single-step not found\n");
+ LOGE("Thread for single-step not found");
goto bail;
}
if (!dvmIsSuspended(thread)) {
- LOGE("Thread for single-step not suspended\n");
+ LOGE("Thread for single-step not suspended");
assert(!"non-susp step"); // I want to know if this can happen
goto bail;
}
@@ -2697,14 +2697,14 @@ JdwpError dvmDbgInvokeMethod(ObjectId threadId, ObjectId objectId,
Thread* self = dvmThreadSelf();
ThreadStatus oldStatus = dvmChangeStatus(self, THREAD_VMWAIT);
- LOGV(" Transferring control to event thread\n");
+ LOGV(" Transferring control to event thread");
dvmLockMutex(&targetThread->invokeReq.lock);
if ((options & INVOKE_SINGLE_THREADED) == 0) {
- LOGV(" Resuming all threads\n");
+ LOGV(" Resuming all threads");
dvmResumeAllThreads(SUSPEND_FOR_DEBUG_EVENT);
} else {
- LOGV(" Resuming event thread only\n");
+ LOGV(" Resuming event thread only");
dvmResumeThread(targetThread);
}
@@ -2716,7 +2716,7 @@ JdwpError dvmDbgInvokeMethod(ObjectId threadId, ObjectId objectId,
&targetThread->invokeReq.lock);
}
dvmUnlockMutex(&targetThread->invokeReq.lock);
- LOGV(" Control has returned from event thread\n");
+ LOGV(" Control has returned from event thread");
/* wait for thread to re-suspend itself */
dvmWaitForSuspend(targetThread);
@@ -2734,9 +2734,9 @@ JdwpError dvmDbgInvokeMethod(ObjectId threadId, ObjectId objectId,
* so we want to resume the target thread once to keep the books straight.
*/
if ((options & INVOKE_SINGLE_THREADED) == 0) {
- LOGV(" Suspending all threads\n");
+ LOGV(" Suspending all threads");
dvmSuspendAllThreads(SUSPEND_FOR_DEBUG_EVENT);
- LOGV(" Resuming event thread to balance the count\n");
+ LOGV(" Resuming event thread to balance the count");
dvmResumeThread(targetThread);
}
@@ -2805,7 +2805,7 @@ void dvmDbgExecuteMethod(DebugInvokeReq* pReq)
IF_LOGV() {
char* desc = dexProtoCopyMethodDescriptor(&meth->prototype);
- LOGV("JDWP invoking method %p/%p %s.%s:%s\n",
+ LOGV("JDWP invoking method %p/%p %s.%s:%s",
pReq->method, meth, meth->clazz->descriptor, meth->name, desc);
free(desc);
}
@@ -2816,7 +2816,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)\n",
+ LOGD(" JDWP invocation returning with exceptObj=%p (%s)",
exc, exc->clazz->descriptor);
//dvmLogExceptionStackTrace();
dvmClearException(self);
@@ -2829,7 +2829,7 @@ void dvmDbgExecuteMethod(DebugInvokeReq* pReq)
/* if no exception thrown, examine object result more closely */
u1 newTag = tagFromObject((Object*)pReq->resultValue.l);
if (newTag != pReq->resultTag) {
- LOGVV(" JDWP promoted result from %d to %d\n",
+ LOGVV(" JDWP promoted result from %d to %d",
pReq->resultTag, newTag);
pReq->resultTag = newTag;
}
@@ -2971,7 +2971,7 @@ void dvmDbgDdmSendChunk(int type, size_t len, const u1* buf)
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)\n",
+ LOGV("Debugger thread not active, ignoring DDM send (t=0x%08x)",
type);
return;
}
diff --git a/vm/DvmDex.cpp b/vm/DvmDex.cpp
index c5790e5a6..aa78c7a49 100644
--- a/vm/DvmDex.cpp
+++ b/vm/DvmDex.cpp
@@ -69,7 +69,7 @@ static DvmDex* allocateAuxStructures(DexFile* pDexFile)
pDvmDex->pResFields = (struct Field**)
calloc(fieldCount, sizeof(struct Field*));
- LOGV("+++ DEX %p: allocateAux %d+%d+%d+%d * 4 = %d bytes\n",
+ LOGV("+++ DEX %p: allocateAux %d+%d+%d+%d * 4 = %d bytes",
pDvmDex, stringCount, classCount, methodCount, fieldCount,
(stringCount + classCount + methodCount + fieldCount) * 4);
@@ -81,7 +81,7 @@ static DvmDex* allocateAuxStructures(DexFile* pDexFile)
pDvmDex->pResFields == NULL ||
pDvmDex->pInterfaceCache == NULL)
{
- LOGE("Alloc failure in allocateAuxStructures\n");
+ LOGE("Alloc failure in allocateAuxStructures");
free(pDvmDex->pResStrings);
free(pDvmDex->pResClasses);
free(pDvmDex->pResMethods);
@@ -112,18 +112,18 @@ int dvmDexFileOpenFromFd(int fd, DvmDex** ppDvmDex)
parseFlags |= kDexParseVerifyChecksum;
if (lseek(fd, 0, SEEK_SET) < 0) {
- LOGE("lseek rewind failed\n");
+ LOGE("lseek rewind failed");
goto bail;
}
if (sysMapFileInShmemWritableReadOnly(fd, &memMap) != 0) {
- LOGE("Unable to map file\n");
+ LOGE("Unable to map file");
goto bail;
}
pDexFile = dexFileParse((u1*)memMap.addr, memMap.length, parseFlags);
if (pDexFile == NULL) {
- LOGE("DEX parse failed\n");
+ LOGE("DEX parse failed");
sysReleaseShmem(&memMap);
goto bail;
}
@@ -167,7 +167,7 @@ int dvmDexFileOpenPartial(const void* addr, int len, DvmDex** ppDvmDex)
pDexFile = dexFileParse((u1*)addr, len, parseFlags);
if (pDexFile == NULL) {
- LOGE("DEX parse failed\n");
+ LOGE("DEX parse failed");
goto bail;
}
pDvmDex = allocateAuxStructures(pDexFile);
@@ -196,7 +196,7 @@ void dvmDexFileFree(DvmDex* pDvmDex)
dexFileFree(pDvmDex->pDexFile);
- LOGV("+++ DEX %p: freeing aux structs\n", pDvmDex);
+ LOGV("+++ DEX %p: freeing aux structs", pDvmDex);
free(pDvmDex->pResStrings);
free(pDvmDex->pResClasses);
free(pDvmDex->pResMethods);
@@ -232,7 +232,7 @@ void dvmDexFileFree(DvmDex* pDvmDex)
bool dvmDexChangeDex1(DvmDex* pDvmDex, u1* addr, u1 newVal)
{
if (*addr == newVal) {
- LOGV("+++ byte at %p is already 0x%02x\n", addr, newVal);
+ LOGV("+++ byte at %p is already 0x%02x", addr, newVal);
return true;
}
@@ -242,16 +242,16 @@ bool dvmDexChangeDex1(DvmDex* pDvmDex, u1* addr, u1 newVal)
*/
dvmLockMutex(&pDvmDex->modLock);
- LOGV("+++ change byte at %p from 0x%02x to 0x%02x\n", addr, *addr, newVal);
+ LOGV("+++ change byte at %p from 0x%02x to 0x%02x", addr, *addr, newVal);
if (sysChangeMapAccess(addr, 1, true, &pDvmDex->memMap) != 0) {
- LOGD("NOTE: DEX page access change (->RW) failed\n");
+ LOGD("NOTE: DEX page access change (->RW) failed");
/* expected on files mounted from FAT; keep going (may crash) */
}
*addr = newVal;
if (sysChangeMapAccess(addr, 1, false, &pDvmDex->memMap) != 0) {
- LOGD("NOTE: DEX page access change (->RO) failed\n");
+ LOGD("NOTE: DEX page access change (->RO) failed");
/* expected on files mounted from FAT; keep going */
}
@@ -269,7 +269,7 @@ bool dvmDexChangeDex1(DvmDex* pDvmDex, u1* addr, u1 newVal)
bool dvmDexChangeDex2(DvmDex* pDvmDex, u2* addr, u2 newVal)
{
if (*addr == newVal) {
- LOGV("+++ value at %p is already 0x%04x\n", addr, newVal);
+ LOGV("+++ value at %p is already 0x%04x", addr, newVal);
return true;
}
@@ -279,16 +279,16 @@ bool dvmDexChangeDex2(DvmDex* pDvmDex, u2* addr, u2 newVal)
*/
dvmLockMutex(&pDvmDex->modLock);
- LOGV("+++ change 2byte at %p from 0x%04x to 0x%04x\n", addr, *addr, newVal);
+ LOGV("+++ change 2byte at %p from 0x%04x to 0x%04x", addr, *addr, newVal);
if (sysChangeMapAccess(addr, 2, true, &pDvmDex->memMap) != 0) {
- LOGD("NOTE: DEX page access change (->RW) failed\n");
+ LOGD("NOTE: DEX page access change (->RW) failed");
/* expected on files mounted from FAT; keep going (may crash) */
}
*addr = newVal;
if (sysChangeMapAccess(addr, 2, false, &pDvmDex->memMap) != 0) {
- LOGD("NOTE: DEX page access change (->RO) failed\n");
+ LOGD("NOTE: DEX page access change (->RO) failed");
/* expected on files mounted from FAT; keep going */
}
diff --git a/vm/Exception.cpp b/vm/Exception.cpp
index 30796c29c..4f5cba20b 100644
--- a/vm/Exception.cpp
+++ b/vm/Exception.cpp
@@ -120,13 +120,13 @@ void dvmThrowChainedException(ClassObject* excepClass, const char* msg,
* early on in VM initialization. There's nothing better to do
* than just log the message as an error and abort.
*/
- LOGE("Fatal error: %s\n", msg);
+ LOGE("Fatal error: %s", msg);
dvmAbort();
}
/* make sure the exception is initialized */
if (!dvmIsClassInitialized(excepClass) && !dvmInitClass(excepClass)) {
- LOGE("ERROR: unable to initialize exception class '%s'\n",
+ LOGE("ERROR: unable to initialize exception class '%s'",
excepClass->descriptor);
if (strcmp(excepClass->descriptor, "Ljava/lang/InternalError;") == 0)
dvmAbort();
@@ -147,7 +147,7 @@ void dvmThrowChainedException(ClassObject* excepClass, const char* msg,
*/
if (dvmCheckException(self))
goto bail;
- LOGE("FATAL: unable to allocate exception '%s' '%s'\n",
+ LOGE("FATAL: unable to allocate exception '%s' '%s'",
excepClass->descriptor, msg != NULL ? msg : "(no msg)");
dvmAbort();
}
@@ -157,7 +157,7 @@ void dvmThrowChainedException(ClassObject* excepClass, const char* msg,
*/
if (gDvm.optimizing) {
/* need the exception object, but can't invoke interpreted code */
- LOGV("Skipping init of exception %s '%s'\n",
+ LOGV("Skipping init of exception %s '%s'",
excepClass->descriptor, msg);
} else {
assert(excepClass == exception->clazz);
@@ -278,7 +278,7 @@ static bool initException(Object* exception, const char* msg, Object* cause,
if (cause != NULL) {
if (!dvmInstanceof(cause->clazz, gDvm.exThrowable)) {
- LOGE("Tried to init exception with cause '%s'\n",
+ LOGE("Tried to init exception with cause '%s'",
cause->clazz->descriptor);
dvmAbort();
}
@@ -382,11 +382,11 @@ static bool initException(Object* exception, const char* msg, Object* cause,
JValue unused;
switch (initKind) {
case kInitNoarg:
- LOGVV("+++ exc noarg (ic=%d)\n", needInitCause);
+ LOGVV("+++ exc noarg (ic=%d)", needInitCause);
dvmCallMethod(self, initMethod, exception, &unused);
break;
case kInitMsg:
- LOGVV("+++ exc msg (ic=%d)\n", needInitCause);
+ LOGVV("+++ exc msg (ic=%d)", needInitCause);
dvmCallMethod(self, initMethod, exception, &unused, msgStr);
break;
case kInitThrow:
@@ -409,7 +409,7 @@ static bool initException(Object* exception, const char* msg, Object* cause,
* return an error and let our caller deal with it.
*/
if (self->exception != NULL) {
- LOGW("Exception thrown (%s) while throwing internal exception (%s)\n",
+ LOGW("Exception thrown (%s) while throwing internal exception (%s)",
self->exception->clazz->descriptor, exception->clazz->descriptor);
goto bail;
}
@@ -436,7 +436,7 @@ static bool initException(Object* exception, const char* msg, Object* cause,
goto bail;
}
} else {
- LOGW("WARNING: couldn't find initCause in '%s'\n",
+ LOGW("WARNING: couldn't find initCause in '%s'",
excepClass->descriptor);
}
}
@@ -539,7 +539,7 @@ void dvmWrapException(const char* newExcepStr)
Object* dvmGetExceptionCause(const Object* exception)
{
if (!dvmInstanceof(exception->clazz, gDvm.exThrowable)) {
- LOGE("Tried to get cause from object of type '%s'\n",
+ LOGE("Tried to get cause from object of type '%s'",
exception->clazz->descriptor);
dvmAbort();
}
@@ -579,12 +579,12 @@ void dvmPrintExceptionStackTrace()
JValue unused;
dvmCallMethod(self, printMethod, exception, &unused);
} else {
- LOGW("WARNING: could not find printStackTrace in %s\n",
+ LOGW("WARNING: could not find printStackTrace in %s",
exception->clazz->descriptor);
}
if (self->exception != NULL) {
- LOGW("NOTE: exception thrown while printing stack trace: %s\n",
+ LOGW("NOTE: exception thrown while printing stack trace: %s",
self->exception->clazz->descriptor);
}
@@ -607,7 +607,7 @@ static int findCatchInMethod(Thread* self, const Method* method, int relPc,
assert(!dvmCheckException(self));
assert(!dvmIsNativeMethod(method));
- LOGVV("findCatchInMethod %s.%s excep=%s depth=%d\n",
+ LOGVV("findCatchInMethod %s.%s excep=%s depth=%d",
method->clazz->descriptor, method->name, excepClass->descriptor,
dvmComputeExactFrameDepth(self->interpSave.curFrame));
@@ -625,7 +625,7 @@ static int findCatchInMethod(Thread* self, const Method* method, int relPc,
if (handler->typeIdx == kDexNoIndex) {
/* catch-all */
- LOGV("Match on catch-all block at 0x%02x in %s.%s for %s\n",
+ LOGV("Match on catch-all block at 0x%02x in %s.%s for %s",
relPc, method->clazz->descriptor,
method->name, excepClass->descriptor);
return handler->address;
@@ -681,11 +681,11 @@ static int findCatchInMethod(Thread* self, const Method* method, int relPc,
}
}
- //LOGD("ADDR MATCH, check %s instanceof %s\n",
+ //LOGD("ADDR MATCH, check %s instanceof %s",
// excepClass->descriptor, pEntry->excepClass->descriptor);
if (dvmInstanceof(excepClass, throwable)) {
- LOGV("Match on catch block at 0x%02x in %s.%s for %s\n",
+ LOGV("Match on catch block at 0x%02x in %s.%s for %s",
relPc, method->clazz->descriptor,
method->name, excepClass->descriptor);
return handler->address;
@@ -693,7 +693,7 @@ static int findCatchInMethod(Thread* self, const Method* method, int relPc,
}
}
- LOGV("No matching catch block at 0x%02x in %s for %s\n",
+ LOGV("No matching catch block at 0x%02x in %s for %s",
relPc, method->name, excepClass->descriptor);
return -1;
}
@@ -853,7 +853,7 @@ void* dvmFillInStackTraceInternal(Thread* thread, bool wantObject, size_t* pCoun
break;
if (!dvmInstanceof(method->clazz, gDvm.exThrowable))
break;
- //LOGD("EXCEP: ignoring %s.%s\n",
+ //LOGD("EXCEP: ignoring %s.%s",
// method->clazz->descriptor, method->name);
fp = saveArea->prevFrame;
}
@@ -872,7 +872,7 @@ void* dvmFillInStackTraceInternal(Thread* thread, bool wantObject, size_t* pCoun
assert(fp != saveArea->prevFrame);
fp = saveArea->prevFrame;
}
- //LOGD("EXCEP: stack depth is %d\n", stackDepth);
+ //LOGD("EXCEP: stack depth is %d", stackDepth);
if (!stackDepth)
goto bail;
@@ -908,7 +908,7 @@ void* dvmFillInStackTraceInternal(Thread* thread, bool wantObject, size_t* pCoun
const Method* method = saveArea->method;
if (!dvmIsBreakFrame((u4*)fp)) {
- //LOGD("EXCEP keeping %s.%s\n", method->clazz->descriptor,
+ //LOGD("EXCEP keeping %s.%s", method->clazz->descriptor,
// method->name);
*intPtr++ = (int) method;
@@ -1075,9 +1075,9 @@ void dvmLogRawStackTrace(const int* intVals, int stackDepth)
dotName = dvmHumanReadableDescriptor(meth->clazz->descriptor);
if (dvmIsNativeMethod(meth)) {
- LOGI("\tat %s.%s(Native Method)\n", dotName, meth->name);
+ LOGI("\tat %s.%s(Native Method)", dotName, meth->name);
} else {
- LOGI("\tat %s.%s(%s:%d)\n",
+ LOGI("\tat %s.%s(%s:%d)",
dotName, meth->name, dvmGetMethodSourceFile(meth),
dvmLineNumFromPC(meth, pc));
}
@@ -1128,12 +1128,12 @@ static StringObject* getExceptionMessage(Object* exception)
dvmChangeStatus(self, oldStatus);
} else {
- LOGW("WARNING: could not find getMessage in %s\n",
+ LOGW("WARNING: could not find getMessage in %s",
exception->clazz->descriptor);
}
if (dvmGetException(self) != NULL) {
- LOGW("NOTE: exception thrown while retrieving exception message: %s\n",
+ LOGW("NOTE: exception thrown while retrieving exception message: %s",
dvmGetException(self)->clazz->descriptor);
/* will be overwritten below */
}
@@ -1163,10 +1163,10 @@ static void logStackTraceOf(Object* exception)
dvmReleaseTrackedAlloc((Object*) messageStr, dvmThreadSelf());
messageStr = NULL;
- LOGI("%s: %s\n", className, cp);
+ LOGI("%s: %s", className, cp);
free(cp);
} else {
- LOGI("%s:\n", className);
+ LOGI("%s:", className);
}
free(className);
@@ -1179,7 +1179,7 @@ static void logStackTraceOf(Object* exception)
stackData = (const ArrayObject*) dvmGetFieldObject(exception,
gDvm.offJavaLangThrowable_stackState);
if (stackData == NULL) {
- LOGI(" (raw stack trace not found)\n");
+ LOGI(" (raw stack trace not found)");
return;
}
@@ -1201,7 +1201,7 @@ void dvmLogExceptionStackTrace()
Object* cause;
if (exception == NULL) {
- LOGW("tried to log a null exception?\n");
+ LOGW("tried to log a null exception?");
return;
}
@@ -1211,7 +1211,7 @@ void dvmLogExceptionStackTrace()
if (cause == NULL) {
break;
}
- LOGI("Caused by:\n");
+ LOGI("Caused by:");
exception = cause;
}
}
@@ -1330,7 +1330,7 @@ void dvmThrowExceptionInInitializerError()
* anything fancier, we just abort here with a blatant
* message.
*/
- LOGE("Fatal error during early class initialization:\n");
+ LOGE("Fatal error during early class initialization:");
dvmLogExceptionStackTrace();
dvmAbort();
}
diff --git a/vm/Hash.cpp b/vm/Hash.cpp
index 7bdd92f20..39d9d8622 100644
--- a/vm/Hash.cpp
+++ b/vm/Hash.cpp
@@ -136,7 +136,7 @@ static bool resizeHash(HashTable* pHashTable, int newSize)
int i;
assert(countTombStones(pHashTable) == pHashTable->numDeadEntries);
- //LOGI("before: dead=%d\n", pHashTable->numDeadEntries);
+ //LOGI("before: dead=%d", pHashTable->numDeadEntries);
pNewEntries = (HashEntry*) calloc(newSize, sizeof(HashEntry));
if (pNewEntries == NULL)
@@ -192,7 +192,7 @@ void* dvmHashTableLookup(HashTable* pHashTable, u4 itemHash, void* item,
(*cmpFunc)(pEntry->data, item) == 0)
{
/* match */
- //LOGD("+++ match on entry %d\n", pEntry - pHashTable->pEntries);
+ //LOGD("+++ match on entry %d", pEntry - pHashTable->pEntries);
break;
}
@@ -203,7 +203,7 @@ void* dvmHashTableLookup(HashTable* pHashTable, u4 itemHash, void* item,
pEntry = pHashTable->pEntries;
}
- //LOGI("+++ look probing %d...\n", pEntry - pHashTable->pEntries);
+ //LOGI("+++ look probing %d...", pEntry - pHashTable->pEntries);
}
if (pEntry->data == NULL) {
@@ -220,12 +220,12 @@ void* dvmHashTableLookup(HashTable* pHashTable, u4 itemHash, void* item,
{
if (!resizeHash(pHashTable, pHashTable->tableSize * 2)) {
/* don't really have a way to indicate failure */
- LOGE("Dalvik hash resize failure\n");
+ LOGE("Dalvik hash resize failure");
dvmAbort();
}
/* note "pEntry" is now invalid */
} else {
- //LOGW("okay %d/%d/%d\n",
+ //LOGW("okay %d/%d/%d",
// pHashTable->numEntries, pHashTable->tableSize,
// (pHashTable->tableSize * LOAD_NUMER) / LOAD_DENOM);
}
@@ -260,7 +260,7 @@ bool dvmHashTableRemove(HashTable* pHashTable, u4 itemHash, void* item)
pEnd = &pHashTable->pEntries[pHashTable->tableSize];
while (pEntry->data != NULL) {
if (pEntry->data == item) {
- //LOGI("+++ stepping on entry %d\n", pEntry - pHashTable->pEntries);
+ //LOGI("+++ stepping on entry %d", pEntry - pHashTable->pEntries);
pEntry->data = HASH_TOMBSTONE;
pHashTable->numEntries--;
pHashTable->numDeadEntries++;
@@ -274,7 +274,7 @@ bool dvmHashTableRemove(HashTable* pHashTable, u4 itemHash, void* item)
pEntry = pHashTable->pEntries;
}
- //LOGI("+++ del probing %d...\n", pEntry - pHashTable->pEntries);
+ //LOGI("+++ del probing %d...", pEntry - pHashTable->pEntries);
}
return false;
@@ -412,7 +412,7 @@ void dvmHashTableProbeCount(HashTable* pHashTable, HashCalcFunc calcFunc,
totalProbe += count;
}
- LOGI("Probe: min=%d max=%d, total=%d in %d (%d), avg=%.3f\n",
+ LOGI("Probe: min=%d max=%d, total=%d in %d (%d), avg=%.3f",
minProbe, maxProbe, totalProbe, numEntries, pHashTable->tableSize,
(float) totalProbe / (float) numEntries);
}
diff --git a/vm/IndirectRefTable.cpp b/vm/IndirectRefTable.cpp
index 819b15d2e..225d8c20e 100644
--- a/vm/IndirectRefTable.cpp
+++ b/vm/IndirectRefTable.cpp
@@ -76,17 +76,17 @@ bool dvmPopIndirectRefTableSegmentCheck(IndirectRefTable* pRef, u4 cookie)
*/
sst.all = cookie;
if (sst.parts.topIndex > pRef->segmentState.parts.topIndex) {
- LOGE("Attempt to expand table with segment pop (%d to %d)\n",
+ LOGE("Attempt to expand table with segment pop (%d to %d)",
pRef->segmentState.parts.topIndex, sst.parts.topIndex);
return false;
}
if (sst.parts.numHoles >= sst.parts.topIndex) {
- LOGE("Absurd numHoles in cookie (%d bi=%d)\n",
+ LOGE("Absurd numHoles in cookie (%d bi=%d)",
sst.parts.numHoles, sst.parts.topIndex);
return false;
}
- LOGV("IRT %p[%d]: pop, top=%d holes=%d\n",
+ LOGV("IRT %p[%d]: pop, top=%d holes=%d",
pRef, pRef->kind, sst.parts.topIndex, sst.parts.numHoles);
return true;
@@ -100,7 +100,7 @@ static bool checkEntry(IndirectRefTable* pRef, IndirectRef iref, int idx)
Object* obj = pRef->table[idx];
IndirectRef checkRef = dvmObjectToIndirectRef(pRef, obj, idx, pRef->kind);
if (checkRef != iref) {
- LOGW("IRT %p[%d]: iref mismatch (req=%p vs cur=%p)\n",
+ LOGW("IRT %p[%d]: iref mismatch (req=%p vs cur=%p)",
pRef, pRef->kind, iref, checkRef);
return false;
}
@@ -118,7 +118,7 @@ static inline void updateSlotAdd(IndirectRefTable* pRef, Object* obj, int slot)
if (pRef->slotData != NULL) {
IndirectRefSlot* pSlot = &pRef->slotData[slot];
pSlot->serial++;
- //LOGI("+++ add [%d] slot %d (%p->%p), serial=%d\n",
+ //LOGI("+++ add [%d] slot %d (%p->%p), serial=%d",
// pRef->kind, slot, obj, iref, pSlot->serial);
pSlot->previous[pSlot->serial % kIRTPrevCount] = obj;
}
@@ -131,7 +131,7 @@ static inline void updateSlotRemove(IndirectRefTable* pRef, int slot)
{
if (pRef->slotData != NULL) {
//IndirectRefSlot* pSlot = &pRef->slotData[slot];
- //LOGI("+++ remove [%d] slot %d, serial now %d\n",
+ //LOGI("+++ remove [%d] slot %d, serial now %d",
// pRef->kind, slot, pSlot->serial);
}
}
@@ -155,7 +155,7 @@ IndirectRef dvmAddToIndirectRefTable(IndirectRefTable* pRef, u4 cookie,
if (topIndex == pRef->allocEntries) {
/* reached end of allocated space; did we hit buffer max? */
if (topIndex == pRef->maxEntries) {
- LOGW("IndirectRefTable overflow (max=%d)\n", pRef->maxEntries);
+ LOGW("IndirectRefTable overflow (max=%d)", pRef->maxEntries);
return NULL;
}
@@ -169,11 +169,11 @@ IndirectRef dvmAddToIndirectRefTable(IndirectRefTable* pRef, u4 cookie,
newTable = (Object**) realloc(pRef->table, newSize * sizeof(Object*));
if (newTable == NULL) {
- LOGE("Unable to expand iref table (from %d to %d, max=%d)\n",
+ LOGE("Unable to expand iref table (from %d to %d, max=%d)",
pRef->allocEntries, newSize, pRef->maxEntries);
return false;
}
- LOGV("Growing ireftab %p from %d to %d (max=%d)\n",
+ LOGV("Growing ireftab %p from %d to %d (max=%d)",
pRef, pRef->allocEntries, newSize, pRef->maxEntries);
/* update entries; adjust "nextEntry" in case memory moved */
@@ -222,7 +222,7 @@ IndirectRef dvmAddToIndirectRefTable(IndirectRefTable* pRef, u4 cookie,
bool dvmGetFromIndirectRefTableCheck(IndirectRefTable* pRef, IndirectRef iref)
{
if (dvmGetIndirectRefType(iref) == kIndirectKindInvalid) {
- LOGW("Invalid indirect reference 0x%08x\n", (u4) iref);
+ LOGW("Invalid indirect reference 0x%08x", (u4) iref);
return false;
}
@@ -230,19 +230,19 @@ bool dvmGetFromIndirectRefTableCheck(IndirectRefTable* pRef, IndirectRef iref)
int idx = dvmIndirectRefToIndex(iref);
if (iref == NULL) {
- LOGD("Attempt to look up NULL iref\n");
+ LOGD("Attempt to look up NULL iref");
return false;
}
if (idx >= topIndex) {
/* bad -- stale reference? */
- LOGD("Attempt to access invalid index %d (top=%d)\n",
+ LOGD("Attempt to access invalid index %d (top=%d)",
idx, topIndex);
return false;
}
Object* obj = pRef->table[idx];
if (obj == NULL) {
- LOGD("Attempt to read from hole, iref=%p\n", iref);
+ LOGD("Attempt to read from hole, iref=%p", iref);
return false;
}
if (!checkEntry(pRef, iref, idx))
@@ -279,13 +279,13 @@ bool dvmRemoveFromIndirectRefTable(IndirectRefTable* pRef, u4 cookie,
int idx = dvmIndirectRefToIndex(iref);
if (idx < bottomIndex) {
/* wrong segment */
- LOGV("Attempt to remove index outside index area (%d vs %d-%d)\n",
+ LOGV("Attempt to remove index outside index area (%d vs %d-%d)",
idx, bottomIndex, topIndex);
return false;
}
if (idx >= topIndex) {
/* bad -- stale reference? */
- LOGD("Attempt to remove invalid index %d (bottom=%d top=%d)\n",
+ LOGD("Attempt to remove invalid index %d (bottom=%d top=%d)",
idx, bottomIndex, topIndex);
return false;
}
@@ -307,11 +307,11 @@ bool dvmRemoveFromIndirectRefTable(IndirectRefTable* pRef, u4 cookie,
pRef->segmentState.parts.numHoles - prevState.parts.numHoles;
if (numHoles != 0) {
while (--topIndex > bottomIndex && numHoles != 0) {
- LOGV("+++ checking for hole at %d (cookie=0x%08x) val=%p\n",
+ LOGV("+++ checking for hole at %d (cookie=0x%08x) val=%p",
topIndex-1, cookie, pRef->table[topIndex-1]);
if (pRef->table[topIndex-1] != NULL)
break;
- LOGV("+++ ate hole at %d\n", topIndex-1);
+ LOGV("+++ ate hole at %d", topIndex-1);
numHoles--;
}
pRef->segmentState.parts.numHoles =
@@ -319,7 +319,7 @@ bool dvmRemoveFromIndirectRefTable(IndirectRefTable* pRef, u4 cookie,
pRef->segmentState.parts.topIndex = topIndex;
} else {
pRef->segmentState.parts.topIndex = topIndex-1;
- LOGV("+++ ate last entry %d\n", topIndex-1);
+ LOGV("+++ ate last entry %d", topIndex-1);
}
} else {
/*
@@ -328,7 +328,7 @@ bool dvmRemoveFromIndirectRefTable(IndirectRefTable* pRef, u4 cookie,
* the hole count.
*/
if (pRef->table[idx] == NULL) {
- LOGV("--- WEIRD: removing null entry %d\n", idx);
+ LOGV("--- WEIRD: removing null entry %d", idx);
return false;
}
if (!checkEntry(pRef, iref, idx))
@@ -337,7 +337,7 @@ bool dvmRemoveFromIndirectRefTable(IndirectRefTable* pRef, u4 cookie,
pRef->table[idx] = NULL;
pRef->segmentState.parts.numHoles++;
- LOGV("+++ left hole at %d, holes=%d\n",
+ LOGV("+++ left hole at %d, holes=%d",
idx, pRef->segmentState.parts.numHoles);
}
diff --git a/vm/Init.cpp b/vm/Init.cpp
index 82395d1d6..bf7543476 100644
--- a/vm/Init.cpp
+++ b/vm/Init.cpp
@@ -324,7 +324,7 @@ static bool handleJdwpOption(const char* name, const char* value)
} else if (strcmp(value, "dt_android_adb") == 0) {
gDvm.jdwpTransport = kJdwpTransportAndroidAdb;
} else {
- LOGE("JDWP transport '%s' not supported\n", value);
+ LOGE("JDWP transport '%s' not supported", value);
return false;
}
} else if (strcmp(name, "server") == 0) {
@@ -333,7 +333,7 @@ static bool handleJdwpOption(const char* name, const char* value)
else if (*value == 'y')
gDvm.jdwpServer = true;
else {
- LOGE("JDWP option 'server' must be 'y' or 'n'\n");
+ LOGE("JDWP option 'server' must be 'y' or 'n'");
return false;
}
} else if (strcmp(name, "suspend") == 0) {
@@ -342,7 +342,7 @@ static bool handleJdwpOption(const char* name, const char* value)
else if (*value == 'y')
gDvm.jdwpSuspend = true;
else {
- LOGE("JDWP option 'suspend' must be 'y' or 'n'\n");
+ LOGE("JDWP option 'suspend' must be 'y' or 'n'");
return false;
}
} else if (strcmp(name, "address") == 0) {
@@ -359,12 +359,12 @@ static bool handleJdwpOption(const char* name, const char* value)
value = colon + 1;
}
if (*value == '\0') {
- LOGE("JDWP address missing port\n");
+ LOGE("JDWP address missing port");
return false;
}
port = strtol(value, &end, 10);
if (*end != '\0') {
- LOGE("JDWP address has junk in port field '%s'\n", value);
+ LOGE("JDWP address has junk in port field '%s'", value);
return false;
}
gDvm.jdwpPort = port;
@@ -374,9 +374,9 @@ static bool handleJdwpOption(const char* name, const char* value)
strcmp(name, "timeout") == 0)
{
/* valid but unsupported */
- LOGI("Ignoring JDWP option '%s'='%s'\n", name, value);
+ LOGI("Ignoring JDWP option '%s'='%s'", name, value);
} else {
- LOGI("Ignoring unrecognized JDWP option '%s'='%s'\n", name, value);
+ LOGI("Ignoring unrecognized JDWP option '%s'='%s'", name, value);
}
return true;
@@ -401,14 +401,14 @@ static bool parseJdwpOptions(const char* str)
value = strchr(name, '=');
if (value == NULL) {
- LOGE("JDWP opts: garbage at '%s'\n", name);
+ LOGE("JDWP opts: garbage at '%s'", name);
goto bail;
}
comma = strchr(name, ','); // use name, not value, for safety
if (comma != NULL) {
if (comma < value) {
- LOGE("JDWP opts: found comma before '=' in '%s'\n", mangle);
+ LOGE("JDWP opts: found comma before '=' in '%s'", mangle);
goto bail;
}
*comma = '\0';
@@ -430,11 +430,11 @@ static bool parseJdwpOptions(const char* str)
* Make sure the combination of arguments makes sense.
*/
if (gDvm.jdwpTransport == kJdwpTransportUnknown) {
- LOGE("JDWP opts: must specify transport\n");
+ LOGE("JDWP opts: must specify transport");
goto bail;
}
if (!gDvm.jdwpServer && (gDvm.jdwpHost == NULL || gDvm.jdwpPort == 0)) {
- LOGE("JDWP opts: when server=n, must specify host and port\n");
+ LOGE("JDWP opts: when server=n, must specify host and port");
goto bail;
}
// transport mandatory
@@ -481,7 +481,7 @@ static bool enableAssertions(const char* pkgOrClass, bool enable)
pCtrl->pkgOrClass = dvmDotToSlash(pkgOrClass+1); // skip ':'
if (pCtrl->pkgOrClass == NULL) {
/* can happen if class name includes an illegal '/' */
- LOGW("Unable to process assertion arg '%s'\n", pkgOrClass);
+ LOGW("Unable to process assertion arg '%s'", pkgOrClass);
return false;
}
@@ -518,13 +518,13 @@ static bool enableAssertions(const char* pkgOrClass, bool enable)
void dvmLateEnableAssertions()
{
if (gDvm.assertionCtrl == NULL) {
- LOGD("Not late-enabling assertions: no assertionCtrl array\n");
+ LOGD("Not late-enabling assertions: no assertionCtrl array");
return;
} else if (gDvm.assertionCtrlCount != 0) {
- LOGD("Not late-enabling assertions: some asserts already configured\n");
+ LOGD("Not late-enabling assertions: some asserts already configured");
return;
}
- LOGD("Late-enabling assertions\n");
+ LOGD("Late-enabling assertions");
/* global enable for all but system */
AssertionControl* pCtrl = gDvm.assertionCtrl;
@@ -655,9 +655,9 @@ static int processOptions(int argc, const char* const argv[],
{
int i;
- LOGV("VM options (%d):\n", argc);
+ LOGV("VM options (%d):", argc);
for (i = 0; i < argc; i++)
- LOGV(" %d: '%s'\n", i, argv[i]);
+ LOGV(" %d: '%s'", i, argv[i]);
/*
* Over-allocate AssertionControl array for convenience. If allocated,
@@ -1009,7 +1009,7 @@ static int processOptions(int argc, const char* const argv[],
dvmFprintf(stderr, "Bad value for -Xgc");
return -1;
}
- LOGV("Precise GC configured %s\n", gDvm.preciseGc ? "ON" : "OFF");
+ LOGV("Precise GC configured %s", gDvm.preciseGc ? "ON" : "OFF");
} else if (strcmp(argv[i], "-Xcheckdexsum") == 0) {
gDvm.verifyDexChecksum = true;
@@ -1099,7 +1099,7 @@ static void busCatcher(int signum, siginfo_t* info, void* context)
{
void* addr = info->si_addr;
- LOGE("Caught a SIGBUS (%d), addr=%p\n", signum, addr);
+ LOGE("Caught a SIGBUS (%d), addr=%p", signum, addr);
/*
* If we return at this point the SIGBUS just keeps happening, so we
@@ -1155,9 +1155,9 @@ int dvmStartup(int argc, const char* const argv[], bool ignoreUnrecognized,
assert(gDvm.initializing);
- LOGV("VM init args (%d):\n", argc);
+ LOGV("VM init args (%d):", argc);
for (i = 0; i < argc; i++)
- LOGV(" %d: '%s'\n", i, argv[i]);
+ LOGV(" %d: '%s'", i, argv[i]);
/* prep properties storage */
if (!dvmPropertiesStartup())
@@ -1180,7 +1180,7 @@ int dvmStartup(int argc, const char* const argv[], bool ignoreUnrecognized,
#if WITH_EXTRA_GC_CHECKS > 1
/* only "portable" interp has the extra goodies */
if (gDvm.executionMode != kExecutionModeInterpPortable) {
- LOGI("Switching to 'portable' interpreter for GC checks\n");
+ LOGI("Switching to 'portable' interpreter for GC checks");
gDvm.executionMode = kExecutionModeInterpPortable;
}
#endif
@@ -1199,13 +1199,13 @@ int dvmStartup(int argc, const char* const argv[], bool ignoreUnrecognized,
/* verify system page size */
if (sysconf(_SC_PAGESIZE) != SYSTEM_PAGE_SIZE) {
- LOGE("ERROR: expected page size %d, got %d\n",
+ LOGE("ERROR: expected page size %d, got %d",
SYSTEM_PAGE_SIZE, (int) sysconf(_SC_PAGESIZE));
goto fail;
}
/* mterp setup */
- LOGV("Using executionMode %d\n", gDvm.executionMode);
+ LOGV("Using executionMode %d", gDvm.executionMode);
dvmCheckAsmConstants();
/*
@@ -1304,7 +1304,7 @@ int dvmStartup(int argc, const char* const argv[], bool ignoreUnrecognized,
*/
if (dvmReferenceTableEntries(&dvmThreadSelf()->internalLocalRefTable) != 0)
{
- LOGW("Warning: tracked references remain post-initialization\n");
+ LOGW("Warning: tracked references remain post-initialization");
dvmDumpReferenceTable(&dvmThreadSelf()->internalLocalRefTable, "MAIN");
}
@@ -1330,13 +1330,13 @@ int dvmStartup(int argc, const char* const argv[], bool ignoreUnrecognized,
#ifndef NDEBUG
if (!dvmTestHash())
- LOGE("dvmTestHash FAILED\n");
+ LOGE("dvmTestHash FAILED");
if (false /*noisy!*/ && !dvmTestIndirectRefTable())
- LOGE("dvmTestIndirectRefTable FAILED\n");
+ LOGE("dvmTestIndirectRefTable FAILED");
#endif
if (dvmCheckException(dvmThreadSelf())) {
- LOGE("Exception pending at end of VM initialization\n");
+ LOGE("Exception pending at end of VM initialization");
dvmLogExceptionStackTrace();
goto fail;
}
@@ -1435,12 +1435,12 @@ bool dvmInitAfterZygote()
* come last.
*/
if (!initJdwp()) {
- LOGD("JDWP init failed; continuing anyway\n");
+ LOGD("JDWP init failed; continuing anyway");
}
endJdwp = dvmGetRelativeTimeUsec();
- LOGV("thread-start heap=%d quit=%d jdwp=%d total=%d usec\n",
+ LOGV("thread-start heap=%d quit=%d jdwp=%d total=%d usec",
(int)(endHeap-startHeap), (int)(endQuit-startQuit),
(int)(endJdwp-startJdwp), (int)(endJdwp-startHeap));
@@ -1487,7 +1487,7 @@ static bool initJdwp()
if (gDvm.jdwpHost != NULL) {
if (strlen(gDvm.jdwpHost) >= sizeof(params.host)-1) {
- LOGE("ERROR: hostname too long: '%s'\n", gDvm.jdwpHost);
+ LOGE("ERROR: hostname too long: '%s'", gDvm.jdwpHost);
return false;
}
strcpy(params.host, gDvm.jdwpHost);
@@ -1501,7 +1501,7 @@ static bool initJdwp()
gDvm.jdwpState = dvmJdwpStartup(&params);
if (gDvm.jdwpState == NULL) {
- LOGW("WARNING: debugger thread failed to initialize\n");
+ LOGW("WARNING: debugger thread failed to initialize");
/* TODO: ignore? fail? need to mimic "expected" behavior */
}
}
@@ -1513,7 +1513,7 @@ static bool initJdwp()
if (dvmJdwpIsActive(gDvm.jdwpState)) {
//dvmChangeStatus(NULL, THREAD_RUNNING);
if (!dvmJdwpPostVMStart(gDvm.jdwpState, gDvm.jdwpSuspend)) {
- LOGW("WARNING: failed to post 'start' message to debugger\n");
+ LOGW("WARNING: failed to post 'start' message to debugger");
/* keep going */
}
//dvmChangeStatus(NULL, THREAD_NATIVE);
@@ -1613,7 +1613,7 @@ fail:
*/
void dvmShutdown()
{
- LOGV("VM shutting down\n");
+ LOGV("VM shutting down");
if (CALC_CACHE_STATS)
dvmDumpAtomicCacheStats(gDvm.instanceofCache);
@@ -1653,7 +1653,7 @@ void dvmShutdown()
dvmSlayDaemons();
if (gDvm.verboseShutdown)
- LOGD("VM cleaning up\n");
+ LOGD("VM cleaning up");
dvmDebuggerShutdown();
dvmProfilingShutdown();
@@ -1751,7 +1751,7 @@ void dvmPrintNativeBackTrace() {
*/
void dvmAbort()
{
- LOGE("VM aborting\n");
+ LOGE("VM aborting");
fflush(NULL); // flush all open file buffers
diff --git a/vm/InitRefs.cpp b/vm/InitRefs.cpp
index 2b998500b..6fddf9a2f 100644
--- a/vm/InitRefs.cpp
+++ b/vm/InitRefs.cpp
@@ -33,7 +33,7 @@ static bool initClassReference(ClassObject** pClass, const char* name) {
}
if (result == NULL) {
- LOGE("Could not find essential class %s\n", name);
+ LOGE("Could not find essential class %s", name);
return false;
}
@@ -156,7 +156,7 @@ static bool initFieldOffset(ClassObject* clazz, int *pOffset,
const char* name, const char* type) {
int offset = dvmFindFieldOffset(clazz, name, type);
if (offset < 0) {
- LOGE("Could not find essential field %s.%s of type %s\n", clazz->descriptor, name, type);
+ LOGE("Could not find essential field %s.%s of type %s", clazz->descriptor, name, type);
return false;
}
@@ -279,7 +279,7 @@ static bool initFieldOffsets() {
const struct FieldInfo* fields = classes[i].fields;
if (clazz == NULL) {
- LOGE("Could not find essential class %s for field lookup\n", className);
+ LOGE("Could not find essential class %s for field lookup", className);
return false;
}
@@ -299,7 +299,7 @@ static bool initDirectMethodReferenceByClass(Method** pMethod, ClassObject* claz
Method* method = dvmFindDirectMethodByDescriptor(clazz, name, descriptor);
if (method == NULL) {
- LOGE("Could not find essential direct method %s.%s with descriptor %s\n",
+ LOGE("Could not find essential direct method %s.%s with descriptor %s",
clazz->descriptor, name, descriptor);
return false;
}
@@ -313,7 +313,7 @@ static bool initDirectMethodReference(Method** pMethod, const char* className,
ClassObject* clazz = dvmFindSystemClassNoInit(className);
if (clazz == NULL) {
- LOGE("Could not find essential class %s for direct method lookup\n", className);
+ LOGE("Could not find essential class %s for direct method lookup", className);
return false;
}
@@ -396,14 +396,14 @@ static bool initVirtualMethodOffset(int* pOffset, const char* className,
ClassObject* clazz = dvmFindSystemClassNoInit(className);
if (clazz == NULL) {
- LOGE("Could not find essential class %s for virtual method lookup\n", className);
+ LOGE("Could not find essential class %s for virtual method lookup", className);
return false;
}
Method* method = dvmFindVirtualMethodByDescriptor(clazz, name, descriptor);
if (method == NULL) {
- LOGE("Could not find essential virtual method %s.%s with descriptor %s\n",
+ LOGE("Could not find essential virtual method %s.%s with descriptor %s",
clazz->descriptor, name, descriptor);
return false;
}
@@ -452,7 +452,7 @@ static bool initFinalizerReference()
static bool verifyStringOffset(const char* name, int actual, int expected) {
if (actual != expected) {
- LOGE("InitRefs: String.%s offset = %d; expected %d\n", name, actual, expected);
+ LOGE("InitRefs: String.%s offset = %d; expected %d", name, actual, expected);
return false;
}
@@ -497,7 +497,7 @@ bool dvmFindRequiredClassesAndMembers() {
/* (documented in header) */
bool dvmFindReferenceMembers(ClassObject* classReference) {
if (strcmp(classReference->descriptor, "Ljava/lang/ref/Reference;") != 0) {
- LOGE("Attempt to set up the wrong class as Reference\n");
+ LOGE("Attempt to set up the wrong class as Reference");
return false;
}
return initFieldOffset(classReference, &gDvm.offJavaLangRefReference_pendingNext,
diff --git a/vm/InlineNative.cpp b/vm/InlineNative.cpp
index f4f4e8cf7..124031dac 100644
--- a/vm/InlineNative.cpp
+++ b/vm/InlineNative.cpp
@@ -136,7 +136,7 @@ bool javaLangString_charAt(u4 arg0, u4 arg1, u4 arg2, u4 arg3,
return false;
}
- //LOGI("String.charAt this=0x%08x index=%d\n", arg0, arg1);
+ //LOGI("String.charAt this=0x%08x index=%d", arg0, arg1);
count = dvmGetFieldInt((Object*) arg0, STRING_FIELDOFF_COUNT);
if ((s4) arg1 < 0 || (s4) arg1 >= count) {
dvmThrowStringIndexOutOfBoundsExceptionWithIndex(count, arg1);
@@ -180,9 +180,9 @@ static void badMatch(StringObject* thisStrObj, StringObject* compStrObj,
thisStr = dvmCreateCstrFromString(thisStrObj);
compStr = dvmCreateCstrFromString(compStrObj);
- LOGE("%s expected %d got %d\n", compareType, expectResult, newResult);
- LOGE(" this (o=%d l=%d) '%s'\n", thisOffset, thisCount, thisStr);
- LOGE(" comp (o=%d l=%d) '%s'\n", compOffset, compCount, compStr);
+ LOGE("%s expected %d got %d", compareType, expectResult, newResult);
+ LOGE(" this (o=%d l=%d) '%s'", thisOffset, thisCount, thisStr);
+ LOGE(" comp (o=%d l=%d) '%s'", compOffset, compCount, compStr);
dvmPrintHexDumpEx(ANDROID_LOG_INFO, LOG_TAG,
((const u2*) thisArray->contents) + thisOffset, thisCount*2,
kHexDumpLocal);
@@ -403,7 +403,7 @@ bool javaLangString_equals(u4 arg0, u4 arg1, u4 arg2, u4 arg3,
bool javaLangString_length(u4 arg0, u4 arg1, u4 arg2, u4 arg3,
JValue* pResult)
{
- //LOGI("String.length this=0x%08x pResult=%p\n", arg0, pResult);
+ //LOGI("String.length this=0x%08x pResult=%p", arg0, pResult);
/* null reference check on "this" */
if ((Object*) arg0 == NULL) {
@@ -421,7 +421,7 @@ bool javaLangString_length(u4 arg0, u4 arg1, u4 arg2, u4 arg3,
bool javaLangString_isEmpty(u4 arg0, u4 arg1, u4 arg2, u4 arg3,
JValue* pResult)
{
- //LOGI("String.isEmpty this=0x%08x pResult=%p\n", arg0, pResult);
+ //LOGI("String.isEmpty this=0x%08x pResult=%p", arg0, pResult);
/* null reference check on "this" */
if ((Object*) arg0 == NULL) {
@@ -455,7 +455,7 @@ static inline int indexOfCommon(Object* strObj, int ch, int start)
const u2* chars = (const u2*)(void*)charArray->contents;
int offset = dvmGetFieldInt(strObj, STRING_FIELDOFF_OFFSET);
int count = dvmGetFieldInt(strObj, STRING_FIELDOFF_COUNT);
- //LOGI("String.indexOf(0x%08x, 0x%04x, %d) off=%d count=%d\n",
+ //LOGI("String.indexOf(0x%08x, 0x%04x, %d) off=%d count=%d",
// (u4) strObj, ch, start, offset, count);
/* factor out the offset */
@@ -893,7 +893,7 @@ Method* dvmResolveInlineNative(int opIndex)
gDvm.inlinedMethods[opIndex] = method;
IF_LOGV() {
char* desc = dexProtoCopyMethodDescriptor(&method->prototype);
- LOGV("Registered for profile: %s.%s %s\n",
+ LOGV("Registered for profile: %s.%s %s",
method->clazz->descriptor, method->name, desc);
free(desc);
}
diff --git a/vm/JarFile.cpp b/vm/JarFile.cpp
index 0288fef6a..05042771f 100644
--- a/vm/JarFile.cpp
+++ b/vm/JarFile.cpp
@@ -73,7 +73,7 @@ static int openAlternateSuffix(const char *fileName, const char *suffix,
*pCachedName = buf;
return fd;
}
- LOGV("Couldn't open %s: %s\n", buf, strerror(errno));
+ LOGV("Couldn't open %s: %s", buf, strerror(errno));
bail:
free(buf);
return -1;
@@ -116,7 +116,7 @@ DexCacheStatus dvmDexCacheStatus(const char *fileName)
* See if there's an up-to-date copy of the optimized dex
* in the cache, but don't create one if there isn't.
*/
- LOGV("dvmDexCacheStatus: Checking cache for %s\n", fileName);
+ LOGV("dvmDexCacheStatus: Checking cache for %s", fileName);
cachedName = dexOptGenerateCacheFileName(fileName, kDexInJarName);
if (cachedName == NULL)
return DEX_CACHE_BAD_ARCHIVE;
@@ -125,7 +125,7 @@ DexCacheStatus dvmDexCacheStatus(const char *fileName)
dexGetZipEntryModTime(&archive, entry),
dexGetZipEntryCrc32(&archive, entry),
/*isBootstrap=*/false, &newFile, /*createIfMissing=*/false);
- LOGV("dvmOpenCachedDexFile returned fd %d\n", fd);
+ LOGV("dvmOpenCachedDexFile returned fd %d", fd);
if (fd < 0) {
result = DEX_CACHE_STALE;
goto bail;
@@ -136,7 +136,7 @@ DexCacheStatus dvmDexCacheStatus(const char *fileName)
*/
if (!dvmUnlockCachedDexFile(fd)) {
/* uh oh -- this process needs to exit or we'll wedge the system */
- LOGE("Unable to unlock DEX file\n");
+ LOGE("Unable to unlock DEX file");
goto bail;
}
@@ -156,14 +156,14 @@ DexCacheStatus dvmDexCacheStatus(const char *fileName)
goto bail;
}
- LOGV("Using alternate file (odex) for %s ...\n", fileName);
+ LOGV("Using alternate file (odex) for %s ...", fileName);
if (!dvmCheckOptHeaderAndDependencies(fd, false, 0, 0, true, true)) {
- LOGE("%s odex has stale dependencies\n", fileName);
- LOGE("odex source not available -- failing\n");
+ LOGE("%s odex has stale dependencies", fileName);
+ LOGE("odex source not available -- failing");
result = DEX_CACHE_STALE_ODEX;
goto bail;
} else {
- LOGV("%s odex has good dependencies\n", fileName);
+ LOGV("%s odex has good dependencies", fileName);
}
}
result = DEX_CACHE_OK;
@@ -217,16 +217,16 @@ int dvmJarFileOpen(const char* fileName, const char* odexOutputName,
*/
fd = openAlternateSuffix(fileName, "odex", O_RDONLY, &cachedName);
if (fd >= 0) {
- LOGV("Using alternate file (odex) for %s ...\n", fileName);
+ LOGV("Using alternate file (odex) for %s ...", fileName);
if (!dvmCheckOptHeaderAndDependencies(fd, false, 0, 0, true, true)) {
- LOGE("%s odex has stale dependencies\n", fileName);
+ LOGE("%s odex has stale dependencies", fileName);
free(cachedName);
cachedName = NULL;
close(fd);
fd = -1;
goto tryArchive;
} else {
- LOGV("%s odex has good dependencies\n", fileName);
+ LOGV("%s odex has good dependencies", fileName);
//TODO: make sure that the .odex actually corresponds
// to the classes.dex inside the archive (if present).
// For typical use there will be no classes.dex.
@@ -262,14 +262,14 @@ tryArchive:
} else {
cachedName = strdup(odexOutputName);
}
- LOGV("dvmJarFileOpen: Checking cache for %s (%s)\n",
+ LOGV("dvmJarFileOpen: Checking cache for %s (%s)",
fileName, cachedName);
fd = dvmOpenCachedDexFile(fileName, cachedName,
dexGetZipEntryModTime(&archive, entry),
dexGetZipEntryCrc32(&archive, entry),
isBootstrap, &newFile, /*createIfMissing=*/true);
if (fd < 0) {
- LOGI("Unable to open or create cache for %s (%s)\n",
+ LOGI("Unable to open or create cache for %s (%s)",
fileName, cachedName);
goto bail;
}
@@ -304,13 +304,13 @@ tryArchive:
}
if (!result) {
- LOGE("Unable to extract+optimize DEX from '%s'\n",
+ LOGE("Unable to extract+optimize DEX from '%s'",
fileName);
goto bail;
}
endWhen = dvmGetRelativeTimeUsec();
- LOGD("DEX prep '%s': unzip in %dms, rewrite %dms\n",
+ LOGD("DEX prep '%s': unzip in %dms, rewrite %dms",
fileName,
(int) (extractWhen - startWhen) / 1000,
(int) (endWhen - extractWhen) / 1000);
@@ -327,7 +327,7 @@ tryArchive:
* doesn't have to be seeked anywhere in particular.
*/
if (dvmDexFileOpenFromFd(fd, &pDvmDex) != 0) {
- LOGI("Unable to map %s in %s\n", kDexInJarName, fileName);
+ LOGI("Unable to map %s in %s", kDexInJarName, fileName);
goto bail;
}
@@ -335,13 +335,13 @@ tryArchive:
/* unlock the fd */
if (!dvmUnlockCachedDexFile(fd)) {
/* uh oh -- this process needs to exit or we'll wedge the system */
- LOGE("Unable to unlock DEX file\n");
+ LOGE("Unable to unlock DEX file");
goto bail;
}
locked = false;
}
- LOGV("Successfully opened '%s' in '%s'\n", kDexInJarName, fileName);
+ LOGV("Successfully opened '%s' in '%s'", kDexInJarName, fileName);
*ppJarFile = (JarFile*) calloc(1, sizeof(JarFile));
(*ppJarFile)->archive = archive;
diff --git a/vm/LinearAlloc.cpp b/vm/LinearAlloc.cpp
index dc937593c..5a99e6d05 100644
--- a/vm/LinearAlloc.cpp
+++ b/vm/LinearAlloc.cpp
@@ -142,7 +142,7 @@ LinearAllocHdr* dvmLinearAllocCreate(Object* classLoader)
pHdr->mapAddr = (char*)mmap(NULL, pHdr->mapLength, PROT_READ | PROT_WRITE,
MAP_PRIVATE, fd, 0);
if (pHdr->mapAddr == MAP_FAILED) {
- LOGE("LinearAlloc mmap(%d) failed: %s\n", pHdr->mapLength,
+ LOGE("LinearAlloc mmap(%d) failed: %s", pHdr->mapLength,
strerror(errno));
free(pHdr);
close(fd);
@@ -156,7 +156,7 @@ LinearAllocHdr* dvmLinearAllocCreate(Object* classLoader)
pHdr->mapAddr = mmap(NULL, pHdr->mapLength, PROT_READ | PROT_WRITE,
MAP_PRIVATE | MAP_ANON, -1, 0);
if (pHdr->mapAddr == MAP_FAILED) {
- LOGE("LinearAlloc mmap(%d) failed: %s\n", pHdr->mapLength,
+ LOGE("LinearAlloc mmap(%d) failed: %s", pHdr->mapLength,
strerror(errno));
free(pHdr);
return NULL;
@@ -187,14 +187,14 @@ LinearAllocHdr* dvmLinearAllocCreate(Object* classLoader)
* the extra page now that we have ashmem?]
*/
if (mprotect(pHdr->mapAddr, pHdr->mapLength, PROT_NONE) != 0) {
- LOGW("LinearAlloc init mprotect failed: %s\n", strerror(errno));
+ LOGW("LinearAlloc init mprotect failed: %s", strerror(errno));
free(pHdr);
return NULL;
}
if (mprotect(pHdr->mapAddr + SYSTEM_PAGE_SIZE, SYSTEM_PAGE_SIZE,
ENFORCE_READ_ONLY ? PROT_READ : PROT_READ|PROT_WRITE) != 0)
{
- LOGW("LinearAlloc init mprotect #2 failed: %s\n", strerror(errno));
+ LOGW("LinearAlloc init mprotect #2 failed: %s", strerror(errno));
free(pHdr);
return NULL;
}
@@ -211,7 +211,7 @@ LinearAllocHdr* dvmLinearAllocCreate(Object* classLoader)
dvmInitMutex(&pHdr->lock);
- LOGV("LinearAlloc: created region at %p-%p\n",
+ LOGV("LinearAlloc: created region at %p-%p",
pHdr->mapAddr, pHdr->mapAddr + pHdr->mapLength-1);
return pHdr;
@@ -237,14 +237,14 @@ void dvmLinearAllocDestroy(Object* classLoader)
//dvmLinearAllocDump(classLoader);
if (gDvm.verboseShutdown) {
- LOGV("Unmapping linear allocator base=%p\n", pHdr->mapAddr);
- LOGD("LinearAlloc %p used %d of %d (%d%%)\n",
+ LOGV("Unmapping linear allocator base=%p", pHdr->mapAddr);
+ LOGD("LinearAlloc %p used %d of %d (%d%%)",
classLoader, pHdr->curOffset, pHdr->mapLength,
(pHdr->curOffset * 100) / pHdr->mapLength);
}
if (munmap(pHdr->mapAddr, pHdr->mapLength) != 0) {
- LOGW("LinearAlloc munmap(%p, %d) failed: %s\n",
+ LOGW("LinearAlloc munmap(%p, %d) failed: %s",
pHdr->mapAddr, pHdr->mapLength, strerror(errno));
}
free(pHdr);
@@ -272,7 +272,7 @@ void* dvmLinearAlloc(Object* classLoader, size_t size)
return calloc(1, size);
#endif
- LOGVV("--- LinearAlloc(%p, %d)\n", classLoader, size);
+ LOGVV("--- LinearAlloc(%p, %d)", classLoader, size);
/*
* What we'd like to do is just determine the new end-of-alloc size
@@ -303,7 +303,7 @@ void* dvmLinearAlloc(Object* classLoader, size_t size)
*/
nextOffset = ((startOffset + HEADER_EXTRA*2 + size + (BLOCK_ALIGN-1))
& ~(BLOCK_ALIGN-1)) - HEADER_EXTRA;
- LOGVV("--- old=%d size=%d new=%d\n", startOffset, size, nextOffset);
+ LOGVV("--- old=%d size=%d new=%d", startOffset, size, nextOffset);
if (nextOffset > pHdr->mapLength) {
/*
@@ -312,7 +312,7 @@ void* dvmLinearAlloc(Object* classLoader, size_t size)
* works if the users of these functions actually free everything
* they allocate.
*/
- LOGE("LinearAlloc exceeded capacity (%d), last=%d\n",
+ LOGE("LinearAlloc exceeded capacity (%d), last=%d",
pHdr->mapLength, (int) size);
dvmAbort();
}
@@ -324,7 +324,7 @@ void* dvmLinearAlloc(Object* classLoader, size_t size)
* stuff we always treat the full extent.
*/
size = nextOffset - (startOffset + HEADER_EXTRA);
- LOGVV("--- (size now %d)\n", size);
+ LOGVV("--- (size now %d)", size);
/*
* See if we are starting on or have crossed into a new page. If so,
@@ -342,7 +342,7 @@ void* dvmLinearAlloc(Object* classLoader, size_t size)
lastGoodOff = (startOffset-1) & ~(SYSTEM_PAGE_SIZE-1);
firstWriteOff = startOffset & ~(SYSTEM_PAGE_SIZE-1);
lastWriteOff = (nextOffset-1) & ~(SYSTEM_PAGE_SIZE-1);
- LOGVV("--- lastGood=0x%04x firstWrite=0x%04x lastWrite=0x%04x\n",
+ LOGVV("--- lastGood=0x%04x firstWrite=0x%04x lastWrite=0x%04x",
lastGoodOff, firstWriteOff, lastWriteOff);
if (lastGoodOff != lastWriteOff || ENFORCE_READ_ONLY) {
int cc, start, len;
@@ -351,10 +351,10 @@ void* dvmLinearAlloc(Object* classLoader, size_t size)
assert(start <= nextOffset);
len = (lastWriteOff - firstWriteOff) + SYSTEM_PAGE_SIZE;
- LOGVV("--- calling mprotect(start=%d len=%d RW)\n", start, len);
+ LOGVV("--- calling mprotect(start=%d len=%d RW)", start, len);
cc = mprotect(pHdr->mapAddr + start, len, PROT_READ | PROT_WRITE);
if (cc != 0) {
- LOGE("LinearAlloc mprotect (+%d %d) failed: %s\n",
+ LOGE("LinearAlloc mprotect (+%d %d) failed: %s",
start, len, strerror(errno));
/* we're going to fail soon, might as do it now */
dvmAbort();
@@ -368,7 +368,7 @@ void* dvmLinearAlloc(Object* classLoader, size_t size)
start = firstWriteOff / SYSTEM_PAGE_SIZE;
end = lastWriteOff / SYSTEM_PAGE_SIZE;
- LOGVV("--- marking pages %d-%d RW (alloc %d at %p)\n",
+ LOGVV("--- marking pages %d-%d RW (alloc %d at %p)",
start, end, size, pHdr->mapAddr + startOffset + HEADER_EXTRA);
for (i = start; i <= end; i++)
pHdr->writeRefCount[i]++;
@@ -426,7 +426,7 @@ void* dvmLinearRealloc(Object* classLoader, void* mem, size_t newSize)
getHeader(classLoader)->curOffset));
const u4* pLen = getBlockHeader(mem);
- LOGV("--- LinearRealloc(%d) old=%d\n", newSize, *pLen);
+ LOGV("--- LinearRealloc(%d) old=%d", newSize, *pLen);
/* handle size reduction case */
if (*pLen >= newSize) {
@@ -464,7 +464,7 @@ static void updatePages(Object* classLoader, void* mem, int direction)
firstPage = ((u1*)pLen - (u1*)pHdr->mapAddr) / SYSTEM_PAGE_SIZE;
lastPage = ((u1*)mem - (u1*)pHdr->mapAddr + (len-1)) / SYSTEM_PAGE_SIZE;
- LOGVV("--- updating pages %d-%d (%d)\n", firstPage, lastPage, direction);
+ LOGVV("--- updating pages %d-%d (%d)", firstPage, lastPage, direction);
int i, cc;
@@ -480,19 +480,19 @@ static void updatePages(Object* classLoader, void* mem, int direction)
*/
if (i == firstPage) {
if ((*pLen & LENGTHFLAG_RW) == 0) {
- LOGW("Double RO on %p\n", mem);
+ LOGW("Double RO on %p", mem);
dvmAbort();
} else
*pLen &= ~LENGTHFLAG_RW;
}
if (pHdr->writeRefCount[i] == 0) {
- LOGE("Can't make page %d any less writable\n", i);
+ LOGE("Can't make page %d any less writable", i);
dvmAbort();
}
pHdr->writeRefCount[i]--;
if (pHdr->writeRefCount[i] == 0) {
- LOGVV("--- prot page %d RO\n", i);
+ LOGVV("--- prot page %d RO", i);
cc = mprotect(pHdr->mapAddr + SYSTEM_PAGE_SIZE * i,
SYSTEM_PAGE_SIZE, PROT_READ);
assert(cc == 0);
@@ -502,11 +502,11 @@ static void updatePages(Object* classLoader, void* mem, int direction)
* Trying to mark writable.
*/
if (pHdr->writeRefCount[i] >= 32767) {
- LOGE("Can't make page %d any more writable\n", i);
+ LOGE("Can't make page %d any more writable", i);
dvmAbort();
}
if (pHdr->writeRefCount[i] == 0) {
- LOGVV("--- prot page %d RW\n", i);
+ LOGVV("--- prot page %d RW", i);
cc = mprotect(pHdr->mapAddr + SYSTEM_PAGE_SIZE * i,
SYSTEM_PAGE_SIZE, PROT_READ | PROT_WRITE);
assert(cc == 0);
@@ -515,7 +515,7 @@ static void updatePages(Object* classLoader, void* mem, int direction)
if (i == firstPage) {
if ((*pLen & LENGTHFLAG_RW) != 0) {
- LOGW("Double RW on %p\n", mem);
+ LOGW("Double RW on %p", mem);
dvmAbort();
} else
*pLen |= LENGTHFLAG_RW;
@@ -599,10 +599,10 @@ void dvmLinearAllocDump(Object* classLoader)
dvmLockMutex(&pHdr->lock);
- LOGI("LinearAlloc classLoader=%p\n", classLoader);
- LOGI(" mapAddr=%p mapLength=%d firstOffset=%d\n",
+ LOGI("LinearAlloc classLoader=%p", classLoader);
+ LOGI(" mapAddr=%p mapLength=%d firstOffset=%d",
pHdr->mapAddr, pHdr->mapLength, pHdr->firstOffset);
- LOGI(" curOffset=%d\n", pHdr->curOffset);
+ LOGI(" curOffset=%d", pHdr->curOffset);
int off = pHdr->firstOffset;
u4 rawLen, fullLen;
@@ -612,7 +612,7 @@ void dvmLinearAllocDump(Object* classLoader)
fullLen = ((HEADER_EXTRA*2 + (rawLen & LENGTHFLAG_MASK))
& ~(BLOCK_ALIGN-1));
- LOGI(" %p (%3d): %clen=%d%s\n", pHdr->mapAddr + off + HEADER_EXTRA,
+ LOGI(" %p (%3d): %clen=%d%s", pHdr->mapAddr + off + HEADER_EXTRA,
(int) ((off + HEADER_EXTRA) / SYSTEM_PAGE_SIZE),
(rawLen & LENGTHFLAG_FREE) != 0 ? '*' : ' ',
rawLen & LENGTHFLAG_MASK,
@@ -622,7 +622,7 @@ void dvmLinearAllocDump(Object* classLoader)
}
if (ENFORCE_READ_ONLY) {
- LOGI("writeRefCount map:\n");
+ LOGI("writeRefCount map:");
int numPages = (pHdr->mapLength+SYSTEM_PAGE_SIZE-1) / SYSTEM_PAGE_SIZE;
int zstart = 0;
@@ -644,7 +644,7 @@ void dvmLinearAllocDump(Object* classLoader)
printf(" %d-%d: zero\n", zstart, i-1);
}
- LOGD("LinearAlloc %p using %d of %d (%d%%)\n",
+ LOGD("LinearAlloc %p using %d of %d (%d%%)",
classLoader, pHdr->curOffset, pHdr->mapLength,
(pHdr->curOffset * 100) / pHdr->mapLength);
@@ -675,7 +675,7 @@ static void checkAllFree(Object* classLoader)
& ~(BLOCK_ALIGN-1));
if ((rawLen & LENGTHFLAG_FREE) == 0) {
- LOGW("LinearAlloc %p not freed: %p len=%d\n", classLoader,
+ LOGW("LinearAlloc %p not freed: %p len=%d", classLoader,
pHdr->mapAddr + off + HEADER_EXTRA, rawLen & LENGTHFLAG_MASK);
}
diff --git a/vm/Misc.cpp b/vm/Misc.cpp
index 5412c7564..15097a962 100644
--- a/vm/Misc.cpp
+++ b/vm/Misc.cpp
@@ -184,7 +184,7 @@ void dvmPrintDebugMessage(const DebugOutputTarget* target, const char* format,
vfprintf(target->data.file.fp, format, args);
break;
default:
- LOGE("unexpected 'which' %d\n", target->which);
+ LOGE("unexpected 'which' %d", target->which);
break;
}
@@ -488,7 +488,7 @@ bool dvmIterativeSleep(int iteration, int maxTotalSleep, u8 relStartTime)
*/
curTime = dvmGetRelativeTimeUsec();
if (curTime >= relStartTime + maxTotalSleep) {
- LOGVV("exsl: sleep exceeded (start=%llu max=%d now=%llu)\n",
+ LOGVV("exsl: sleep exceeded (start=%llu max=%d now=%llu)",
relStartTime, maxTotalSleep, curTime);
return false;
}
@@ -507,16 +507,16 @@ bool dvmIterativeSleep(int iteration, int maxTotalSleep, u8 relStartTime)
assert(curDelay > 0);
if (curTime + curDelay >= relStartTime + maxTotalSleep) {
- LOGVV("exsl: reduced delay from %d to %d\n",
+ LOGVV("exsl: reduced delay from %d to %d",
curDelay, (int) ((relStartTime + maxTotalSleep) - curTime));
curDelay = (int) ((relStartTime + maxTotalSleep) - curTime);
}
if (iteration == 0) {
- LOGVV("exsl: yield\n");
+ LOGVV("exsl: yield");
sched_yield();
} else {
- LOGVV("exsl: sleep for %d\n", curDelay);
+ LOGVV("exsl: sleep for %d", curDelay);
usleep(curDelay);
}
return true;
@@ -537,11 +537,11 @@ bool dvmSetCloseOnExec(int fd)
*/
flags = fcntl(fd, F_GETFD);
if (flags < 0) {
- LOGW("Unable to get fd flags for fd %d\n", fd);
+ LOGW("Unable to get fd flags for fd %d", fd);
return false;
}
if (fcntl(fd, F_SETFD, flags | FD_CLOEXEC) < 0) {
- LOGW("Unable to set close-on-exec for fd %d\n", fd);
+ LOGW("Unable to set close-on-exec for fd %d", fd);
return false;
}
return true;
@@ -637,7 +637,7 @@ bool dvmGetThreadStats(ProcStatData* pData, pid_t tid)
sprintf(nameBuf, "/proc/self/task/%d/stat", (int) tid);
fd = open(nameBuf, O_RDONLY);
if (fd < 0) {
- LOGV("Unable to open '%s': %s\n", nameBuf, strerror(errno));
+ LOGV("Unable to open '%s': %s", nameBuf, strerror(errno));
return false;
}
@@ -645,7 +645,7 @@ bool dvmGetThreadStats(ProcStatData* pData, pid_t tid)
int cc = read(fd, lineBuf, sizeof(lineBuf)-1);
if (cc <= 0) {
const char* msg = (cc == 0) ? "unexpected EOF" : strerror(errno);
- LOGI("Unable to read '%s': %s\n", nameBuf, msg);
+ LOGI("Unable to read '%s': %s", nameBuf, msg);
close(fd);
return false;
}
@@ -674,7 +674,7 @@ bool dvmGetThreadStats(ProcStatData* pData, pid_t tid)
char* endp;
pData->utime = strtoul(cp+1, &endp, 10);
if (endp == cp+1)
- LOGI("Warning: strtoul failed on utime ('%.30s...')\n", cp);
+ LOGI("Warning: strtoul failed on utime ('%.30s...')", cp);
cp = strchr(cp+1, ' ');
if (cp == NULL)
@@ -682,7 +682,7 @@ bool dvmGetThreadStats(ProcStatData* pData, pid_t tid)
pData->stime = strtoul(cp+1, &endp, 10);
if (endp == cp+1)
- LOGI("Warning: strtoul failed on stime ('%.30s...')\n", cp);
+ LOGI("Warning: strtoul failed on stime ('%.30s...')", cp);
/*
* Skip more stuff we don't care about.
@@ -698,12 +698,12 @@ bool dvmGetThreadStats(ProcStatData* pData, pid_t tid)
*/
pData->processor = strtol(cp+1, &endp, 10);
if (endp == cp+1)
- LOGI("Warning: strtoul failed on processor ('%.30s...')\n", cp);
+ LOGI("Warning: strtoul failed on processor ('%.30s...')", cp);
return true;
parse_fail:
- LOGI("stat parse failed (%s)\n", lineBuf);
+ LOGI("stat parse failed (%s)", lineBuf);
return false;
}
diff --git a/vm/Native.cpp b/vm/Native.cpp
index bbb4ce6d1..dfbde901b 100644
--- a/vm/Native.cpp
+++ b/vm/Native.cpp
@@ -92,13 +92,13 @@ void dvmResolveNativeMethod(const u4* args, JValue* pResult,
/* resolution always gets the same answer, so no race here */
IF_LOGVV() {
char* desc = dexProtoCopyMethodDescriptor(&method->prototype);
- LOGVV("+++ resolved native %s.%s %s, invoking\n",
+ LOGVV("+++ resolved native %s.%s %s, invoking",
clazz->descriptor, method->name, desc);
free(desc);
}
if (dvmIsSynchronizedMethod(method)) {
- LOGE("ERROR: internal-native can't be declared 'synchronized'\n");
- LOGE("Failing on %s.%s\n", method->clazz->descriptor, method->name);
+ LOGE("ERROR: internal-native can't be declared 'synchronized'");
+ LOGE("Failing on %s.%s", method->clazz->descriptor, method->name);
dvmAbort(); // harsh, but this is VM-internal problem
}
DalvikBridgeFunc dfunc = (DalvikBridgeFunc) infunc;
@@ -118,7 +118,7 @@ void dvmResolveNativeMethod(const u4* args, JValue* pResult,
IF_LOGW() {
char* desc = dexProtoCopyMethodDescriptor(&method->prototype);
- LOGW("No implementation found for native %s.%s %s\n",
+ LOGW("No implementation found for native %s.%s %s",
clazz->descriptor, method->name, desc);
free(desc);
}
@@ -184,7 +184,7 @@ static int hashcmpSharedLib(const void* ventry, const void* vnewEntry)
const SharedLib* pLib = (const SharedLib*) ventry;
const SharedLib* pNewLib = (const SharedLib*) vnewEntry;
- LOGD("--- comparing %p '%s' %p '%s'\n",
+ LOGD("--- comparing %p '%s' %p '%s'",
pLib, pLib->pathName, pNewLib, pNewLib->pathName);
return strcmp(pLib->pathName, pNewLib->pathName);
}
@@ -269,27 +269,27 @@ static bool checkOnLoadResult(SharedLib* pEntry)
* Check this so we don't end up waiting for ourselves. We need
* to return "true" so the caller can continue.
*/
- LOGI("threadid=%d: recursive native library load attempt (%s)\n",
+ LOGI("threadid=%d: recursive native library load attempt (%s)",
self->threadId, pEntry->pathName);
return true;
}
- LOGV("+++ retrieving %s OnLoad status\n", pEntry->pathName);
+ LOGV("+++ retrieving %s OnLoad status", pEntry->pathName);
bool result;
dvmLockMutex(&pEntry->onLoadLock);
while (pEntry->onLoadResult == kOnLoadPending) {
- LOGD("threadid=%d: waiting for %s OnLoad status\n",
+ LOGD("threadid=%d: waiting for %s OnLoad status",
self->threadId, pEntry->pathName);
ThreadStatus oldStatus = dvmChangeStatus(self, THREAD_VMWAIT);
pthread_cond_wait(&pEntry->onLoadCond, &pEntry->onLoadLock);
dvmChangeStatus(self, oldStatus);
}
if (pEntry->onLoadResult == kOnLoadOkay) {
- LOGV("+++ earlier OnLoad(%s) okay\n", pEntry->pathName);
+ LOGV("+++ earlier OnLoad(%s) okay", pEntry->pathName);
result = true;
} else {
- LOGV("+++ earlier OnLoad(%s) failed\n", pEntry->pathName);
+ LOGV("+++ earlier OnLoad(%s) failed", pEntry->pathName);
result = false;
}
dvmUnlockMutex(&pEntry->onLoadLock);
@@ -327,7 +327,7 @@ bool dvmLoadNativeCode(const char* pathName, Object* classLoader,
verbose = verbose && !!strncmp(pathName, "/vendor", sizeof("/vendor")-1);
if (verbose)
- LOGD("Trying to load lib %s %p\n", pathName, classLoader);
+ LOGD("Trying to load lib %s %p", pathName, classLoader);
*detail = NULL;
@@ -338,12 +338,12 @@ bool dvmLoadNativeCode(const char* pathName, Object* classLoader,
pEntry = findSharedLibEntry(pathName);
if (pEntry != NULL) {
if (pEntry->classLoader != classLoader) {
- LOGW("Shared lib '%s' already opened by CL %p; can't open in %p\n",
+ LOGW("Shared lib '%s' already opened by CL %p; can't open in %p",
pathName, pEntry->classLoader, classLoader);
return false;
}
if (verbose) {
- LOGD("Shared lib '%s' already loaded in same CL %p\n",
+ LOGD("Shared lib '%s' already loaded in same CL %p",
pathName, classLoader);
}
if (!checkOnLoadResult(pEntry))
@@ -402,13 +402,13 @@ bool dvmLoadNativeCode(const char* pathName, Object* classLoader,
SharedLib* pActualEntry = addSharedLibEntry(pNewEntry);
if (pNewEntry != pActualEntry) {
- LOGI("WOW: we lost a race to add a shared lib (%s CL=%p)\n",
+ LOGI("WOW: we lost a race to add a shared lib (%s CL=%p)",
pathName, classLoader);
freeSharedLibEntry(pNewEntry);
return checkOnLoadResult(pActualEntry);
} else {
if (verbose)
- LOGD("Added shared lib %s %p\n", pathName, classLoader);
+ LOGD("Added shared lib %s %p", pathName, classLoader);
bool result = true;
void* vonLoad;
@@ -416,7 +416,7 @@ bool dvmLoadNativeCode(const char* pathName, Object* classLoader,
vonLoad = dlsym(handle, "JNI_OnLoad");
if (vonLoad == NULL) {
- LOGD("No JNI_OnLoad found in %s %p, skipping init\n",
+ LOGD("No JNI_OnLoad found in %s %p, skipping init",
pathName, classLoader);
} else {
/*
@@ -430,7 +430,7 @@ bool dvmLoadNativeCode(const char* pathName, Object* classLoader,
self->classLoaderOverride = classLoader;
oldStatus = dvmChangeStatus(self, THREAD_NATIVE);
- LOGV("+++ calling JNI_OnLoad(%s)\n", pathName);
+ LOGV("+++ calling JNI_OnLoad(%s)", pathName);
version = (*func)(gDvmJni.jniVm, NULL);
dvmChangeStatus(self, oldStatus);
self->classLoaderOverride = prevOverride;
@@ -438,7 +438,7 @@ bool dvmLoadNativeCode(const char* pathName, Object* classLoader,
if (version != JNI_VERSION_1_2 && version != JNI_VERSION_1_4 &&
version != JNI_VERSION_1_6)
{
- LOGW("JNI_OnLoad returned bad version (%d) in %s %p\n",
+ LOGW("JNI_OnLoad returned bad version (%d) in %s %p",
version, pathName, classLoader);
/*
* It's unwise to call dlclose() here, but we can mark it
@@ -451,7 +451,7 @@ bool dvmLoadNativeCode(const char* pathName, Object* classLoader,
*/
result = false;
} else {
- LOGV("+++ finished JNI_OnLoad %s\n", pathName);
+ LOGV("+++ finished JNI_OnLoad %s", pathName);
}
}
@@ -522,7 +522,7 @@ static void unregisterJNINativeMethods(Method* methods, size_t count)
* anything.
*/
- LOGD("Unregistering JNI method %s.%s:%s\n",
+ LOGD("Unregistering JNI method %s.%s:%s",
meth->clazz->descriptor, meth->name, meth->shorty);
dvmSetNativeFunc(meth, dvmResolveNativeMethod, NULL);
}
@@ -579,7 +579,7 @@ static char* createJniNameString(const char* classDescriptor,
*/
static char* mangleString(const char* str, int len)
{
- //LOGI("mangling '%s' %d\n", str, len);
+ //LOGI("mangling '%s' %d", str, len);
assert(str[len] == '\0');
@@ -692,11 +692,11 @@ static int findMethodInLib(void* vlib, void* vmethod)
int len;
if (meth->clazz->classLoader != pLib->classLoader) {
- LOGV("+++ not scanning '%s' for '%s' (wrong CL)\n",
+ LOGV("+++ not scanning '%s' for '%s' (wrong CL)",
pLib->pathName, meth->name);
return 0;
} else
- LOGV("+++ scanning '%s' for '%s'\n", pLib->pathName, meth->name);
+ LOGV("+++ scanning '%s' for '%s'", pLib->pathName, meth->name);
/*
* First, we try it without the signature.
@@ -710,7 +710,7 @@ static int findMethodInLib(void* vlib, void* vmethod)
if (mangleCM == NULL)
goto bail;
- LOGV("+++ calling dlsym(%s)\n", mangleCM);
+ LOGV("+++ calling dlsym(%s)", mangleCM);
func = dlsym(pLib->handle, mangleCM);
if (func == NULL) {
mangleSig =
@@ -724,13 +724,13 @@ static int findMethodInLib(void* vlib, void* vmethod)
sprintf(mangleCMSig, "%s__%s", mangleCM, mangleSig);
- LOGV("+++ calling dlsym(%s)\n", mangleCMSig);
+ LOGV("+++ calling dlsym(%s)", mangleCMSig);
func = dlsym(pLib->handle, mangleCMSig);
if (func != NULL) {
- LOGV("Found '%s' with dlsym\n", mangleCMSig);
+ LOGV("Found '%s' with dlsym", mangleCMSig);
}
} else {
- LOGV("Found '%s' with dlsym\n", mangleCM);
+ LOGV("Found '%s' with dlsym", mangleCM);
}
bail:
@@ -749,7 +749,7 @@ bail:
static void* lookupSharedLibMethod(const Method* method)
{
if (gDvm.nativeLibs == NULL) {
- LOGE("Unexpected init state: nativeLibs not ready\n");
+ LOGE("Unexpected init state: nativeLibs not ready");
dvmAbort();
}
return (void*) dvmHashForeach(gDvm.nativeLibs, findMethodInLib,
diff --git a/vm/PointerSet.cpp b/vm/PointerSet.cpp
index ca7b537f2..4f3d7d583 100644
--- a/vm/PointerSet.cpp
+++ b/vm/PointerSet.cpp
@@ -130,10 +130,10 @@ bool dvmPointerSetAddEntry(PointerSet* pSet, const void* ptr)
pSet->alloc = 4;
else
pSet->alloc *= 2;
- LOGVV("expanding %p to %d\n", pSet, pSet->alloc);
+ LOGVV("expanding %p to %d", pSet, pSet->alloc);
newList = (const void**)realloc(pSet->list, pSet->alloc * sizeof(void*));
if (newList == NULL) {
- LOGE("Failed expanding ptr set (alloc=%d)\n", pSet->alloc);
+ LOGE("Failed expanding ptr set (alloc=%d)", pSet->alloc);
dvmAbort();
}
pSet->list = newList;
@@ -148,14 +148,14 @@ bool dvmPointerSetAddEntry(PointerSet* pSet, const void* ptr)
* terminated "above" or "below" the value.
*/
if (nearby != 0 && ptr < pSet->list[nearby-1]) {
- //LOGD("nearby-1=%d %p, inserting %p at -1\n",
+ //LOGD("nearby-1=%d %p, inserting %p at -1",
// nearby-1, pSet->list[nearby-1], ptr);
nearby--;
} else if (ptr < pSet->list[nearby]) {
- //LOGD("nearby=%d %p, inserting %p at +0\n",
+ //LOGD("nearby=%d %p, inserting %p at +0",
// nearby, pSet->list[nearby], ptr);
} else {
- //LOGD("nearby+1=%d %p, inserting %p at +1\n",
+ //LOGD("nearby+1=%d %p, inserting %p at +1",
// nearby+1, pSet->list[nearby+1], ptr);
nearby++;
}
@@ -267,7 +267,7 @@ void dvmPointerSetIntersect(PointerSet* pSet, const void** ptrArray, int count)
*/
void dvmPointerSetDump(const PointerSet* pSet)
{
- LOGI("PointerSet %p\n", pSet);
+ LOGI("PointerSet %p", pSet);
int i;
for (i = 0; i < pSet->count; i++)
LOGI(" %2d: %p", i, pSet->list[i]);
diff --git a/vm/Profile.cpp b/vm/Profile.cpp
index c80a1509b..df0cf28c0 100644
--- a/vm/Profile.cpp
+++ b/vm/Profile.cpp
@@ -92,7 +92,7 @@ static inline u8 getClock()
clock_gettime(CLOCK_THREAD_CPUTIME_ID, &tm);
if (!(tm.tv_nsec >= 0 && tm.tv_nsec < 1*1000*1000*1000)) {
- LOGE("bad nsec: %ld\n", tm.tv_nsec);
+ LOGE("bad nsec: %ld", tm.tv_nsec);
dvmAbort();
}
@@ -167,13 +167,13 @@ bool dvmProfilingStartup()
*/
int fd = open("/dev/qemu_trace", O_RDWR);
if (fd < 0) {
- LOGV("Unable to open /dev/qemu_trace\n");
+ LOGV("Unable to open /dev/qemu_trace");
} else {
gDvm.emulatorTracePage = mmap(0, SYSTEM_PAGE_SIZE, PROT_READ|PROT_WRITE,
MAP_SHARED, fd, 0);
close(fd);
if (gDvm.emulatorTracePage == MAP_FAILED) {
- LOGE("Unable to mmap /dev/qemu_trace\n");
+ LOGE("Unable to mmap /dev/qemu_trace");
gDvm.emulatorTracePage = NULL;
} else {
*(u4*) gDvm.emulatorTracePage = 0;
@@ -210,7 +210,7 @@ static void updateActiveProfilers(ExecutionSubModes newMode, bool enable)
oldValue = gDvm.activeProfilers;
newValue = oldValue + (enable ? 1 : -1);
if (newValue < 0) {
- LOGE("Can't have %d active profilers\n", newValue);
+ LOGE("Can't have %d active profilers", newValue);
dvmAbort();
}
} while (android_atomic_release_cas(oldValue, newValue,
@@ -227,7 +227,7 @@ static void updateActiveProfilers(ExecutionSubModes newMode, bool enable)
dvmCompilerUpdateGlobalState();
#endif
- LOGD("+++ active profiler count now %d\n", newValue);
+ LOGD("+++ active profiler count now %d", newValue);
}
@@ -337,7 +337,7 @@ void dvmMethodTraceStart(const char* traceFileName, int traceFd, int bufferSize,
dvmLockMutex(&state->startStopLock);
while (state->traceEnabled != 0) {
- LOGI("TRACE start requested, but already in progress; stopping\n");
+ LOGI("TRACE start requested, but already in progress; stopping");
dvmUnlockMutex(&state->startStopLock);
dvmMethodTraceStop();
dvmLockMutex(&state->startStopLock);
@@ -348,7 +348,7 @@ void dvmMethodTraceStart(const char* traceFileName, int traceFd, int bufferSize,
* interpBreak flags only on the target thread.
*/
updateActiveProfilers(kSubModeMethodTrace, true);
- LOGI("TRACE STARTED: '%s' %dKB\n", traceFileName, bufferSize / 1024);
+ LOGI("TRACE STARTED: '%s' %dKB", traceFileName, bufferSize / 1024);
/*
* Allocate storage and open files.
@@ -369,7 +369,7 @@ void dvmMethodTraceStart(const char* traceFileName, int traceFd, int bufferSize,
}
if (state->traceFile == NULL) {
int err = errno;
- LOGE("Unable to open trace file '%s': %s\n",
+ LOGE("Unable to open trace file '%s': %s",
traceFileName, strerror(err));
dvmThrowExceptionFmt(gDvm.exRuntimeException,
"Unable to open trace file '%s': %s",
@@ -503,7 +503,7 @@ void dvmMethodTraceStop()
if (!state->traceEnabled) {
/* somebody already stopped it, or it was never started */
- LOGD("TRACE stop requested, but not running\n");
+ LOGD("TRACE stop requested, but not running");
dvmUnlockMutex(&state->startStopLock);
return;
} else {
@@ -559,7 +559,7 @@ void dvmMethodTraceStop()
| (scanPtr[4] << 24);
if (METHOD_ID(methodVal) == fillVal) {
u1* scanBase = state->buf + TRACE_HEADER_LEN;
- LOGW("Found unfilled record at %d (of %d)\n",
+ LOGW("Found unfilled record at %d (of %d)",
(scanPtr - scanBase) / TRACE_REC_SIZE,
(finalCurOffset - TRACE_HEADER_LEN) / TRACE_REC_SIZE);
finalCurOffset = scanPtr - state->buf;
@@ -570,7 +570,7 @@ void dvmMethodTraceStop()
}
}
- LOGI("TRACE STOPPED%s: writing %d records\n",
+ LOGI("TRACE STOPPED%s: writing %d records",
state->overflow ? " (NOTE: overflowed buffer)" : "",
(finalCurOffset - TRACE_HEADER_LEN) / TRACE_REC_SIZE);
if (gDvm.debuggerActive) {
@@ -592,7 +592,7 @@ void dvmMethodTraceStop()
state->traceFile = open_memstream(&memStreamPtr, &memStreamSize);
if (state->traceFile == NULL) {
/* not expected */
- LOGE("Unable to open memstream\n");
+ LOGE("Unable to open memstream");
dvmAbort();
}
}
@@ -646,7 +646,7 @@ void dvmMethodTraceStop()
/* append the profiling data */
if (fwrite(state->buf, finalCurOffset, 1, state->traceFile) != 1) {
int err = errno;
- LOGE("trace fwrite(%d) failed: %s\n",
+ LOGE("trace fwrite(%d) failed: %s",
finalCurOffset, strerror(err));
dvmThrowExceptionFmt(gDvm.exRuntimeException,
"Trace data write failed: %s", strerror(err));
@@ -688,7 +688,7 @@ void dvmMethodTraceAdd(Thread* self, const Method* method, int action)
if (!self->cpuClockBaseSet) {
self->cpuClockBase = getClock();
self->cpuClockBaseSet = true;
- //LOGI("thread base id=%d 0x%llx\n",
+ //LOGI("thread base id=%d 0x%llx",
// self->threadId, self->cpuClockBase);
}
@@ -825,7 +825,7 @@ void dvmEmitEmulatorTrace(const Method* method, int action)
}
*(pMagic+action) = addr;
- LOGVV("Set %p = 0x%08x (%s.%s)\n",
+ LOGVV("Set %p = 0x%08x (%s.%s)",
pMagic+action, addr, method->clazz->descriptor, method->name);
#endif
}
@@ -868,7 +868,7 @@ void dvmEmulatorTraceStart()
/* in theory we should make this an atomic inc; in practice not important */
gDvm.emulatorTraceEnableCount++;
if (gDvm.emulatorTraceEnableCount == 1)
- LOGD("--- emulator method traces enabled\n");
+ LOGD("--- emulator method traces enabled");
updateActiveProfilers(kSubModeEmulatorTrace, true);
}
@@ -878,13 +878,13 @@ void dvmEmulatorTraceStart()
void dvmEmulatorTraceStop()
{
if (gDvm.emulatorTraceEnableCount == 0) {
- LOGE("ERROR: emulator tracing not enabled\n");
+ LOGE("ERROR: emulator tracing not enabled");
return;
}
/* in theory we should make this an atomic inc; in practice not important */
gDvm.emulatorTraceEnableCount--;
if (gDvm.emulatorTraceEnableCount == 0)
- LOGD("--- emulator method traces disabled\n");
+ LOGD("--- emulator method traces disabled");
updateActiveProfilers(kSubModeEmulatorTrace,
(gDvm.emulatorTraceEnableCount != 0));
}
@@ -906,7 +906,7 @@ void dvmStartInstructionCounting()
void dvmStopInstructionCounting()
{
if (gDvm.instructionCountEnableCount == 0) {
- LOGE("ERROR: instruction counting not enabled\n");
+ LOGE("ERROR: instruction counting not enabled");
dvmAbort();
}
gDvm.instructionCountEnableCount--;
diff --git a/vm/RawDexFile.cpp b/vm/RawDexFile.cpp
index bec667574..9fef57c11 100644
--- a/vm/RawDexFile.cpp
+++ b/vm/RawDexFile.cpp
@@ -210,7 +210,7 @@ int dvmRawDexFileOpen(const char* fileName, const char* odexOutputName,
* doesn't have to be seeked anywhere in particular.
*/
if (dvmDexFileOpenFromFd(optFd, &pDvmDex) != 0) {
- LOGI("Unable to map cached %s\n", fileName);
+ LOGI("Unable to map cached %s", fileName);
goto bail;
}
@@ -218,7 +218,7 @@ int dvmRawDexFileOpen(const char* fileName, const char* odexOutputName,
/* unlock the fd */
if (!dvmUnlockCachedDexFile(optFd)) {
/* uh oh -- this process needs to exit or we'll wedge the system */
- LOGE("Unable to unlock DEX file\n");
+ LOGE("Unable to unlock DEX file");
goto bail;
}
locked = false;
diff --git a/vm/ReferenceTable.cpp b/vm/ReferenceTable.cpp
index adf3383b6..764093fa6 100644
--- a/vm/ReferenceTable.cpp
+++ b/vm/ReferenceTable.cpp
@@ -64,7 +64,7 @@ bool dvmAddToReferenceTable(ReferenceTable* pRef, Object* obj)
if (pRef->nextEntry == pRef->table + pRef->allocEntries) {
/* reached end of allocated space; did we hit buffer max? */
if (pRef->nextEntry == pRef->table + pRef->maxEntries) {
- LOGW("ReferenceTable overflow (max=%d)\n", pRef->maxEntries);
+ LOGW("ReferenceTable overflow (max=%d)", pRef->maxEntries);
return false;
}
@@ -78,11 +78,11 @@ bool dvmAddToReferenceTable(ReferenceTable* pRef, Object* obj)
newTable = (Object**) realloc(pRef->table, newSize * sizeof(Object*));
if (newTable == NULL) {
- LOGE("Unable to expand ref table (from %d to %d %d-byte entries)\n",
+ LOGE("Unable to expand ref table (from %d to %d %d-byte entries)",
pRef->allocEntries, newSize, sizeof(Object*));
return false;
}
- LOGVV("Growing %p from %d to %d\n", pRef, pRef->allocEntries, newSize);
+ LOGVV("Growing %p from %d to %d", pRef, pRef->allocEntries, newSize);
/* update entries; adjust "nextEntry" in case memory moved */
pRef->nextEntry = newTable + (pRef->nextEntry - pRef->table);
@@ -141,10 +141,10 @@ bool dvmRemoveFromReferenceTable(ReferenceTable* pRef, Object** bottom,
if (moveCount != 0) {
/* remove from middle, slide the rest down */
memmove(ptr, ptr+1, moveCount * sizeof(Object*));
- //LOGV("LREF delete %p, shift %d down\n", obj, moveCount);
+ //LOGV("LREF delete %p, shift %d down", obj, moveCount);
} else {
/* last entry, falls off the end */
- //LOGV("LREF delete %p from end\n", obj);
+ //LOGV("LREF delete %p from end", obj);
}
return true;
@@ -205,7 +205,7 @@ static int compareObject(const void* vobj1, const void* vobj2)
static void logObject(const Object* obj, size_t elems, int identical, int equiv)
{
if (obj == NULL) {
- LOGW(" NULL reference (count=%d)\n", equiv);
+ LOGW(" NULL reference (count=%d)", equiv);
return;
}
@@ -222,10 +222,10 @@ static void logObject(const Object* obj, size_t elems, int identical, int equiv)
}
if (identical + equiv != 0) {
- LOGW("%5d of %s%s (%d unique)\n", identical + equiv +1,
+ LOGW("%5d of %s%s (%d unique)", identical + equiv +1,
descriptor, elemStr, equiv +1);
} else {
- LOGW("%5d of %s%s\n", identical + equiv +1, descriptor, elemStr);
+ LOGW("%5d of %s%s", identical + equiv +1, descriptor, elemStr);
}
}
@@ -239,7 +239,7 @@ void dvmDumpReferenceTableContents(Object* const* refs, size_t count,
const char* descr)
{
if (count == 0) {
- LOGW("%s reference table has no entries\n", descr);
+ LOGW("%s reference table has no entries", descr);
return;
}
@@ -247,7 +247,7 @@ void dvmDumpReferenceTableContents(Object* const* refs, size_t count,
* Dump the most recent N entries.
*/
const size_t kLast = 10;
- LOGW("Last %d entries in %s reference table:\n", kLast, descr);
+ LOGW("Last %d entries in %s reference table:", kLast, descr);
int start = count - kLast;
if (start < 0)
start = 0;
@@ -263,16 +263,16 @@ void dvmDumpReferenceTableContents(Object* const* refs, size_t count,
if (ref->clazz == NULL) {
/* should only be possible right after a plain dvmMalloc() */
size_t size = dvmObjectSizeInHeap(ref);
- LOGW("%5d: %p cls=(raw) (%zd bytes)\n", idx, ref, size);
+ LOGW("%5d: %p cls=(raw) (%zd bytes)", idx, ref, size);
} else if (dvmIsClassObject(ref)) {
ClassObject* clazz = (ClassObject*) ref;
- LOGW("%5d: %p cls=%s '%s'\n", idx, ref, ref->clazz->descriptor,
+ LOGW("%5d: %p cls=%s '%s'", idx, ref, ref->clazz->descriptor,
clazz->descriptor);
} else if (elems != 0) {
- LOGW("%5d: %p cls=%s [%zd]\n",
+ LOGW("%5d: %p cls=%s [%zd]",
idx, ref, ref->clazz->descriptor, elems);
} else {
- LOGW("%5d: %p cls=%s\n", idx, ref, ref->clazz->descriptor);
+ LOGW("%5d: %p cls=%s", idx, ref, ref->clazz->descriptor);
}
}
@@ -281,7 +281,7 @@ void dvmDumpReferenceTableContents(Object* const* refs, size_t count,
*/
Object** tableCopy = (Object**)malloc(sizeof(Object*) * count);
if (tableCopy == NULL) {
- LOGE("Unable to copy table with %d elements\n", count);
+ LOGE("Unable to copy table with %d elements", count);
return;
}
memcpy(tableCopy, refs, sizeof(Object*) * count);
@@ -304,7 +304,7 @@ void dvmDumpReferenceTableContents(Object* const* refs, size_t count,
/*
* Dump uniquified table summary.
*/
- LOGW("%s reference table summary (%d entries):\n", descr, count);
+ LOGW("%s reference table summary (%d entries):", descr, count);
size_t equiv, identical;
equiv = identical = 0;
for (idx = 1; idx < count; idx++) {
diff --git a/vm/SignalCatcher.cpp b/vm/SignalCatcher.cpp
index a24764a49..0b4c3c00d 100644
--- a/vm/SignalCatcher.cpp
+++ b/vm/SignalCatcher.cpp
@@ -65,7 +65,7 @@ void dvmSignalCatcherShutdown()
pthread_kill(gDvm.signalCatcherHandle, SIGQUIT);
pthread_join(gDvm.signalCatcherHandle, NULL);
- LOGV("signal catcher has shut down\n");
+ LOGV("signal catcher has shut down");
}
@@ -156,7 +156,7 @@ static void handleSigQuit()
/* write to memory buffer */
FILE* memfp = open_memstream(&traceBuf, &traceLen);
if (memfp == NULL) {
- LOGE("Unable to create memstream for stack traces\n");
+ LOGE("Unable to create memstream for stack traces");
traceBuf = NULL; /* make sure it didn't touch this */
/* continue on */
} else {
@@ -186,16 +186,16 @@ static void handleSigQuit()
*/
int fd = open(gDvm.stackTraceFile, O_WRONLY | O_APPEND | O_CREAT, 0666);
if (fd < 0) {
- LOGE("Unable to open stack trace file '%s': %s\n",
+ LOGE("Unable to open stack trace file '%s': %s",
gDvm.stackTraceFile, strerror(errno));
} else {
ssize_t actual = write(fd, traceBuf, traceLen);
if (actual != (ssize_t) traceLen) {
- LOGE("Failed to write stack traces to %s (%d of %zd): %s\n",
+ LOGE("Failed to write stack traces to %s (%d of %zd): %s",
gDvm.stackTraceFile, (int) actual, traceLen,
strerror(errno));
} else {
- LOGI("Wrote stack traces to '%s'\n", gDvm.stackTraceFile);
+ LOGI("Wrote stack traces to '%s'", gDvm.stackTraceFile);
}
close(fd);
}
@@ -210,7 +210,7 @@ static void handleSigQuit()
*/
static void handleSigUsr1()
{
- LOGI("SIGUSR1 forcing GC (no HPROF)\n");
+ LOGI("SIGUSR1 forcing GC (no HPROF)");
dvmCollectGarbage();
}
@@ -257,7 +257,7 @@ static void* signalCatcherThreadStart(void* arg)
UNUSED_PARAMETER(arg);
- LOGV("Signal catcher thread started (threadid=%d)\n", self->threadId);
+ LOGV("Signal catcher thread started (threadid=%d)", self->threadId);
/* set up mask with signals we want to handle */
sigemptyset(&mask);
@@ -285,14 +285,14 @@ loop:
cc = sigwait(&mask, &rcvd);
if (cc != 0) {
if (cc == EINTR) {
- //LOGV("sigwait: EINTR\n");
+ //LOGV("sigwait: EINTR");
goto loop;
}
assert(!"bad result from sigwait");
}
if (!gDvm.haltSignalCatcher) {
- LOGI("threadid=%d: reacting to signal %d\n",
+ LOGI("threadid=%d: reacting to signal %d",
dvmThreadSelf()->threadId, rcvd);
}
@@ -315,7 +315,7 @@ loop:
break;
#endif
default:
- LOGE("unexpected signal %d\n", rcvd);
+ LOGE("unexpected signal %d", rcvd);
break;
}
}
diff --git a/vm/StdioConverter.cpp b/vm/StdioConverter.cpp
index a98d47316..45c2668a7 100644
--- a/vm/StdioConverter.cpp
+++ b/vm/StdioConverter.cpp
@@ -69,16 +69,16 @@ bool dvmStdioConverterStartup()
return false;
if (pipe(pipeStorage->stdoutPipe) != 0) {
- LOGW("pipe failed: %s\n", strerror(errno));
+ LOGW("pipe failed: %s", strerror(errno));
return false;
}
if (pipe(pipeStorage->stderrPipe) != 0) {
- LOGW("pipe failed: %s\n", strerror(errno));
+ LOGW("pipe failed: %s", strerror(errno));
return false;
}
if (dup2(pipeStorage->stdoutPipe[1], kFilenoStdout) != kFilenoStdout) {
- LOGW("dup2(1) failed: %s\n", strerror(errno));
+ LOGW("dup2(1) failed: %s", strerror(errno));
return false;
}
close(pipeStorage->stdoutPipe[1]);
@@ -87,7 +87,7 @@ bool dvmStdioConverterStartup()
/* don't redirect stderr on sim -- logs get written there! */
/* (don't need this on the sim anyway) */
if (dup2(pipeStorage->stderrPipe[1], kFilenoStderr) != kFilenoStderr) {
- LOGW("dup2(2) failed: %d %s\n", errno, strerror(errno));
+ LOGW("dup2(2) failed: %d %s", errno, strerror(errno));
return false;
}
close(pipeStorage->stderrPipe[1]);
@@ -132,7 +132,7 @@ void dvmStdioConverterShutdown()
printf("Shutting down\n");
fflush(stdout);
- LOGD("Joining stdio converter...\n");
+ LOGD("Joining stdio converter...");
pthread_join(gDvm.stdioConverterHandle, NULL);
}
@@ -181,12 +181,12 @@ static void* stdioConverterThreadStart(void* arg)
if (fdCount < 0) {
if (errno != EINTR) {
- LOGE("select on stdout/stderr failed\n");
+ LOGE("select on stdout/stderr failed");
break;
}
- LOGD("Got EINTR, ignoring\n");
+ LOGD("Got EINTR, ignoring");
} else if (fdCount == 0) {
- LOGD("WEIRD: select returned zero\n");
+ LOGD("WEIRD: select returned zero");
} else {
bool err = false;
if (FD_ISSET(pipeStorage->stdoutPipe[0], &readfds)) {
@@ -200,7 +200,7 @@ static void* stdioConverterThreadStart(void* arg)
/* probably EOF; give up */
if (err) {
- LOGW("stdio converter got read error; shutting it down\n");
+ LOGW("stdio converter got read error; shutting it down");
break;
}
}
@@ -232,11 +232,11 @@ static bool readAndLog(int fd, BufferedData* data, const char* tag)
want = kMaxLine - data->count;
actual = read(fd, data->buf + data->count, want);
if (actual <= 0) {
- LOGW("read %s: (%d,%d) failed (%d): %s\n",
+ LOGW("read %s: (%d,%d) failed (%d): %s",
tag, fd, want, (int)actual, strerror(errno));
return false;
} else {
- //LOGI("read %s: %d at %d\n", tag, actual, data->count);
+ //LOGI("read %s: %d at %d", tag, actual, data->count);
}
data->count += actual;
@@ -250,7 +250,7 @@ static bool readAndLog(int fd, BufferedData* data, const char* tag)
for (i = data->count; i > 0; i--, cp++) {
if (*cp == '\n' || (*cp == '\r' && i != 0 && *(cp+1) != '\n')) {
*cp = '\0';
- //LOGW("GOT %d at %d '%s'\n", cp - start, start - data->buf, start);
+ //LOGW("GOT %d at %d '%s'", cp - start, start - data->buf, start);
LOG(LOG_INFO, tag, "%s", start);
start = cp+1;
}
diff --git a/vm/Sync.cpp b/vm/Sync.cpp
index f3781b3ae..8257f80d4 100644
--- a/vm/Sync.cpp
+++ b/vm/Sync.cpp
@@ -98,11 +98,11 @@ Monitor* dvmCreateMonitor(Object* obj)
mon = (Monitor*) calloc(1, sizeof(Monitor));
if (mon == NULL) {
- LOGE("Unable to allocate monitor\n");
+ LOGE("Unable to allocate monitor");
dvmAbort();
}
if (((u4)mon & 7) != 0) {
- LOGE("Misaligned monitor: %p\n", mon);
+ LOGE("Misaligned monitor: %p", mon);
dvmAbort();
}
mon->obj = obj;
@@ -560,7 +560,7 @@ static void absoluteTime(s8 msec, s4 nsec, struct timespec *ts)
#endif
endSec = ts->tv_sec + msec / 1000;
if (endSec >= 0x7fffffff) {
- LOGV("NOTE: end time exceeds epoch\n");
+ LOGV("NOTE: end time exceeds epoch");
endSec = 0x7ffffffe;
}
ts->tv_sec = endSec;
diff --git a/vm/Thread.cpp b/vm/Thread.cpp
index 0e547015d..5dea33973 100644
--- a/vm/Thread.cpp
+++ b/vm/Thread.cpp
@@ -253,13 +253,13 @@ bool dvmThreadStartup()
/* allocate a TLS slot */
if (pthread_key_create(&gDvm.pthreadKeySelf, threadExitCheck) != 0) {
- LOGE("ERROR: pthread_key_create failed\n");
+ LOGE("ERROR: pthread_key_create failed");
return false;
}
/* test our pthread lib */
if (pthread_getspecific(gDvm.pthreadKeySelf) != NULL)
- LOGW("WARNING: newly-created pthread TLS slot is not NULL\n");
+ LOGW("WARNING: newly-created pthread TLS slot is not NULL");
/* prep thread-related locks and conditions */
dvmInitMutex(&gDvm.threadListLock);
@@ -550,12 +550,12 @@ void dvmSlayDaemons()
gDvm.offJavaLangThread_daemon))
{
/* should never happen; suspend it with the rest */
- LOGW("threadid=%d: non-daemon id=%d still running at shutdown?!\n",
+ LOGW("threadid=%d: non-daemon id=%d still running at shutdown?!",
threadId, target->threadId);
}
char* threadName = dvmGetThreadName(target);
- LOGV("threadid=%d: suspending daemon id=%d name='%s'\n",
+ LOGV("threadid=%d: suspending daemon id=%d name='%s'",
threadId, target->threadId, threadName);
free(threadName);
@@ -607,7 +607,7 @@ void dvmSlayDaemons()
if (target->status == THREAD_RUNNING) {
if (!complained)
- LOGD("threadid=%d not ready yet\n", target->threadId);
+ LOGD("threadid=%d not ready yet", target->threadId);
allSuspended = false;
/* keep going so we log each running daemon once */
}
@@ -616,12 +616,12 @@ void dvmSlayDaemons()
}
if (allSuspended) {
- LOGV("threadid=%d: all daemons have suspended\n", threadId);
+ LOGV("threadid=%d: all daemons have suspended", threadId);
break;
} else {
if (!complained) {
complained = true;
- LOGD("threadid=%d: waiting briefly for daemon suspension\n",
+ LOGD("threadid=%d: waiting briefly for daemon suspension",
threadId);
}
}
@@ -687,7 +687,7 @@ bool dvmPrepMainThread()
Method* init;
JValue unused;
- LOGV("+++ finishing prep on main VM thread\n");
+ LOGV("+++ finishing prep on main VM thread");
/* main thread is always first in list at this point */
thread = gDvm.threadList;
@@ -698,14 +698,14 @@ bool dvmPrepMainThread()
* we create an instance of them.
*/
if (!dvmInitClass(gDvm.classJavaLangClass)) {
- LOGE("'Class' class failed to initialize\n");
+ LOGE("'Class' class failed to initialize");
return false;
}
if (!dvmInitClass(gDvm.classJavaLangThreadGroup) ||
!dvmInitClass(gDvm.classJavaLangThread) ||
!dvmInitClass(gDvm.classJavaLangVMThread))
{
- LOGE("thread classes failed to initialize\n");
+ LOGE("thread classes failed to initialize");
return false;
}
@@ -719,7 +719,7 @@ bool dvmPrepMainThread()
*/
threadObj = dvmAllocObject(gDvm.classJavaLangThread, ALLOC_DEFAULT);
if (threadObj == NULL) {
- LOGE("unable to allocate main thread object\n");
+ LOGE("unable to allocate main thread object");
return false;
}
dvmReleaseTrackedAlloc(threadObj, NULL);
@@ -735,7 +735,7 @@ bool dvmPrepMainThread()
dvmCallMethod(thread, init, threadObj, &unused, groupObj, threadNameStr,
THREAD_NORM_PRIORITY, false);
if (dvmCheckException(thread)) {
- LOGE("exception thrown while constructing main thread object\n");
+ LOGE("exception thrown while constructing main thread object");
return false;
}
@@ -744,7 +744,7 @@ bool dvmPrepMainThread()
*/
vmThreadObj = dvmAllocObject(gDvm.classJavaLangVMThread, ALLOC_DEFAULT);
if (vmThreadObj == NULL) {
- LOGE("unable to allocate main vmthread object\n");
+ LOGE("unable to allocate main vmthread object");
return false;
}
dvmReleaseTrackedAlloc(vmThreadObj, NULL);
@@ -753,7 +753,7 @@ bool dvmPrepMainThread()
"(Ljava/lang/Thread;)V");
dvmCallMethod(thread, init, vmThreadObj, &unused, threadObj);
if (dvmCheckException(thread)) {
- LOGE("exception thrown while constructing main vmthread object\n");
+ LOGE("exception thrown while constructing main vmthread object");
return false;
}
@@ -781,7 +781,7 @@ bool dvmPrepMainThread()
*/
Object* systemLoader = dvmGetSystemClassLoader();
if (systemLoader == NULL) {
- LOGW("WARNING: system class loader is NULL (setting main ctxt)\n");
+ LOGW("WARNING: system class loader is NULL (setting main ctxt)");
/* keep going? */
} else {
dvmSetFieldObject(threadObj, gDvm.offJavaLangThread_contextClassLoader,
@@ -902,7 +902,7 @@ static bool prepareThread(Thread* thread)
thread->handle = pthread_self();
thread->systemTid = dvmGetSysThreadId();
- //LOGI("SYSTEM TID IS %d (pid is %d)\n", (int) thread->systemTid,
+ //LOGI("SYSTEM TID IS %d (pid is %d)", (int) thread->systemTid,
// (int) getpid());
/*
* If we were called by dvmAttachCurrentThread, the self value is
@@ -910,7 +910,7 @@ static bool prepareThread(Thread* thread)
*/
setThreadSelf(thread);
- LOGV("threadid=%d: interp stack at %p\n",
+ LOGV("threadid=%d: interp stack at %p",
thread->threadId, thread->interpStackStart - thread->interpStackSize);
/*
@@ -950,7 +950,7 @@ static bool prepareThread(Thread* thread)
*/
static void unlinkThread(Thread* thread)
{
- LOG_THREAD("threadid=%d: removing from list\n", thread->threadId);
+ LOG_THREAD("threadid=%d: removing from list", thread->threadId);
if (thread == gDvm.threadList) {
assert(thread->prev == NULL);
gDvm.threadList = thread->next;
@@ -972,7 +972,7 @@ static void freeThread(Thread* thread)
return;
/* thread->threadId is zero at this point */
- LOGVV("threadid=%d: freeing\n", thread->threadId);
+ LOGVV("threadid=%d: freeing", thread->threadId);
if (thread->interpStackStart != NULL) {
u1* interpStackBottom;
@@ -983,7 +983,7 @@ static void freeThread(Thread* thread)
free(interpStackBottom);
#else
if (munmap(interpStackBottom, thread->interpStackSize) != 0)
- LOGW("munmap(thread stack) failed\n");
+ LOGW("munmap(thread stack) failed");
#endif
}
@@ -1022,7 +1022,7 @@ static void setThreadSelf(Thread* thread)
* here to ensure we clean up after ourselves.
*/
if (thread != NULL) {
- LOGE("pthread_setspecific(%p) failed, err=%d\n", thread, cc);
+ LOGE("pthread_setspecific(%p) failed, err=%d", thread, cc);
dvmAbort(); /* the world is fundamentally hosed */
}
}
@@ -1055,11 +1055,11 @@ static void threadExitCheck(void* arg)
Thread* self = (Thread*) arg;
assert(self != NULL);
- LOGV("threadid=%d: threadExitCheck(%p) count=%d\n",
+ LOGV("threadid=%d: threadExitCheck(%p) count=%d",
self->threadId, arg, self->threadExitCheckCount);
if (self->status == THREAD_ZOMBIE) {
- LOGW("threadid=%d: Weird -- shouldn't be in threadExitCheck\n",
+ LOGW("threadid=%d: Weird -- shouldn't be in threadExitCheck",
self->threadId);
return;
}
@@ -1068,17 +1068,17 @@ static void threadExitCheck(void* arg)
/*
* Spin a couple of times to let other destructors fire.
*/
- LOGD("threadid=%d: thread exiting, not yet detached (count=%d)\n",
+ LOGD("threadid=%d: thread exiting, not yet detached (count=%d)",
self->threadId, self->threadExitCheckCount);
self->threadExitCheckCount++;
int cc = pthread_setspecific(gDvm.pthreadKeySelf, self);
if (cc != 0) {
- LOGE("threadid=%d: unable to re-add thread to TLS\n",
+ LOGE("threadid=%d: unable to re-add thread to TLS",
self->threadId);
dvmAbort();
}
} else {
- LOGE("threadid=%d: native thread exited without detaching\n",
+ LOGE("threadid=%d: native thread exited without detaching",
self->threadId);
dvmAbort();
}
@@ -1102,7 +1102,7 @@ static void assignThreadId(Thread* thread)
*/
int num = dvmAllocBit(gDvm.threadIdMap);
if (num < 0) {
- LOGE("Ran out of thread IDs\n");
+ LOGE("Ran out of thread IDs");
dvmAbort(); // TODO: make this a non-fatal error result
}
@@ -1199,13 +1199,13 @@ static void setThreadName(const char *threadName)
buf[sizeof(buf)-1] = '\0';
int err = pthread_setname_np(pthread_self(), buf);
if (err != 0) {
- LOGW("Unable to set the name of current thread to '%s': %s\n",
+ LOGW("Unable to set the name of current thread to '%s': %s",
buf, strerror(err));
}
#elif defined(HAVE_PRCTL)
prctl(PR_SET_NAME, (unsigned long) s, 0, 0, 0);
#else
- LOGD("No way to set current thread's name (%s)\n", s);
+ LOGD("No way to set current thread's name (%s)", s);
#endif
}
@@ -1309,7 +1309,7 @@ bool dvmCreateInterpThread(Object* threadObj, int reqStackSize)
* resource limits. VirtualMachineError is probably too severe,
* so use OutOfMemoryError.
*/
- LOGE("Thread creation failed (err=%s)\n", strerror(errno));
+ LOGE("Thread creation failed (err=%s)", strerror(errno));
dvmSetFieldObject(threadObj, gDvm.offJavaLangThread_vmThread, NULL);
@@ -1402,7 +1402,7 @@ bool dvmCreateInterpThread(Object* threadObj, int reqStackSize)
while (newThread->status != THREAD_STARTING)
pthread_cond_wait(&gDvm.threadStartCond, &gDvm.threadListLock);
- LOG_THREAD("threadid=%d: adding to list\n", newThread->threadId);
+ LOG_THREAD("threadid=%d: adding to list", newThread->threadId);
newThread->next = gDvm.threadList->next;
if (newThread->next != NULL)
newThread->next->prev = newThread;
@@ -1465,7 +1465,7 @@ static void* interpThreadStart(void* arg)
dvmLockThreadList(self);
prepareThread(self);
- LOG_THREAD("threadid=%d: created from interp\n", self->threadId);
+ LOG_THREAD("threadid=%d: created from interp", self->threadId);
/*
* Change our status and wake our parent, who will add us to the
@@ -1532,10 +1532,10 @@ static void* interpThreadStart(void* arg)
Method* run = self->threadObj->clazz->vtable[gDvm.voffJavaLangThread_run];
JValue unused;
- LOGV("threadid=%d: calling run()\n", self->threadId);
+ LOGV("threadid=%d: calling run()", self->threadId);
assert(strcmp(run->name, "run") == 0);
dvmCallMethod(self, run, self->threadObj, &unused);
- LOGV("threadid=%d: exiting\n", self->threadId);
+ LOGV("threadid=%d: exiting", self->threadId);
/*
* Remove the thread from various lists, report its death, and free
@@ -1565,7 +1565,7 @@ static void threadExitUncaughtException(Thread* self, Object* group)
Object* handlerObj;
Method* uncaughtHandler;
- LOGW("threadid=%d: thread exiting with uncaught exception (group=%p)\n",
+ LOGW("threadid=%d: thread exiting with uncaught exception (group=%p)",
self->threadId, group);
assert(group != NULL);
@@ -1597,14 +1597,14 @@ static void threadExitUncaughtException(Thread* self, Object* group)
"uncaughtException", "(Ljava/lang/Thread;Ljava/lang/Throwable;)V");
if (uncaughtHandler != NULL) {
- //LOGI("+++ calling %s.uncaughtException\n",
+ //LOGI("+++ calling %s.uncaughtException",
// handlerObj->clazz->descriptor);
JValue unused;
dvmCallMethod(self, uncaughtHandler, handlerObj, &unused,
self->threadObj, exception);
} else {
/* should be impossible, but handle it anyway */
- LOGW("WARNING: no 'uncaughtException' method in class %s\n",
+ LOGW("WARNING: no 'uncaughtException' method in class %s",
handlerObj->clazz->descriptor);
dvmSetException(self, exception);
dvmLogExceptionStackTrace();
@@ -1658,7 +1658,7 @@ bool dvmCreateInternalThread(pthread_t* pHandle, const char* name,
if (pthread_create(pHandle, &threadAttr, internalThreadStart,
pArgs) != 0)
{
- LOGE("internal thread creation failed\n");
+ LOGE("internal thread creation failed");
free(pArgs->name);
free(pArgs);
return false;
@@ -1686,7 +1686,7 @@ bool dvmCreateInternalThread(pthread_t* pHandle, const char* name,
pthread_cond_wait(&gDvm.threadStartCond, &gDvm.threadListLock);
if (newThread == NULL) {
- LOGW("internal thread create failed (createStatus=%d)\n", createStatus);
+ LOGW("internal thread create failed (createStatus=%d)", createStatus);
assert(createStatus < 0);
/* don't free pArgs -- if pthread_create succeeded, child owns it */
dvmUnlockThreadList();
@@ -1735,7 +1735,7 @@ static void* internalThreadStart(void* arg)
pthread_cond_broadcast(&gDvm.threadStartCond);
dvmUnlockThreadList();
- LOG_THREAD("threadid=%d: internal '%s'\n",
+ LOG_THREAD("threadid=%d: internal '%s'",
dvmThreadSelf()->threadId, pArgs->name);
/* execute */
@@ -1811,7 +1811,7 @@ bool dvmAttachCurrentThread(const JavaVMAttachArgs* pArgs, bool isDaemon)
* The native side of the thread is ready; add it to the list. Once
* it's on the list the thread is visible to the JDWP code and the GC.
*/
- LOG_THREAD("threadid=%d: adding to list (attached)\n", self->threadId);
+ LOG_THREAD("threadid=%d: adding to list (attached)", self->threadId);
dvmLockThreadList(self);
@@ -1893,7 +1893,7 @@ bool dvmAttachCurrentThread(const JavaVMAttachArgs* pArgs, bool isDaemon)
dvmCallMethod(self, init, threadObj, &unused, (Object*)pArgs->group,
threadNameStr, getThreadPriorityFromSystem(), isDaemon);
if (dvmCheckException(self)) {
- LOGE("exception thrown while constructing attached thread object\n");
+ LOGE("exception thrown while constructing attached thread object");
goto fail_unlink;
}
@@ -1912,7 +1912,7 @@ bool dvmAttachCurrentThread(const JavaVMAttachArgs* pArgs, bool isDaemon)
* way that ensures another thread can't call start() on it.
*/
if (dvmGetFieldObject(threadObj, gDvm.offJavaLangThread_vmThread) != NULL) {
- LOGW("WOW: thread start hijack\n");
+ LOGW("WOW: thread start hijack");
dvmThrowIllegalThreadStateException(
"thread has already been started");
/* We don't want to free anything associated with the thread
@@ -1938,7 +1938,7 @@ bool dvmAttachCurrentThread(const JavaVMAttachArgs* pArgs, bool isDaemon)
dvmReleaseTrackedAlloc(vmThreadObj, self);
dvmReleaseTrackedAlloc((Object*)threadNameStr, self);
- LOG_THREAD("threadid=%d: attached from native, name=%s\n",
+ LOG_THREAD("threadid=%d: attached from native, name=%s",
self->threadId, pArgs->name);
/* tell the debugger & DDM */
@@ -2019,7 +2019,7 @@ void dvmDetachCurrentThread()
}
if (!topIsNative) {
- LOGE("ERROR: detaching thread with interp frames (count=%d)\n",
+ LOGE("ERROR: detaching thread with interp frames (count=%d)",
curDepth);
dvmDumpThread(self, false);
dvmAbort();
@@ -2027,7 +2027,7 @@ void dvmDetachCurrentThread()
}
group = dvmGetFieldObject(self->threadObj, gDvm.offJavaLangThread_group);
- LOG_THREAD("threadid=%d: detach (group=%p)\n", self->threadId, group);
+ LOG_THREAD("threadid=%d: detach (group=%p)", self->threadId, group);
/*
* Release any held monitors. Since there are no interpreted stack
@@ -2113,7 +2113,7 @@ void dvmDetachCurrentThread()
dvmLockMutex(&traceState->startStopLock);
if (traceState->traceEnabled) {
- LOGI("threadid=%d: waiting for method trace to finish\n",
+ LOGI("threadid=%d: waiting for method trace to finish",
self->threadId);
while (traceState->traceEnabled) {
dvmWaitCond(&traceState->threadExitCond,
@@ -2147,7 +2147,7 @@ void dvmDetachCurrentThread()
if (gDvm.nonDaemonThreadCount == 0) {
int cc;
- LOGV("threadid=%d: last non-daemon thread\n", self->threadId);
+ LOGV("threadid=%d: last non-daemon thread", self->threadId);
//dvmDumpAllThreads(false);
// cond var guarded by threadListLock, which we already hold
cc = pthread_cond_signal(&gDvm.vmExitCond);
@@ -2155,7 +2155,7 @@ void dvmDetachCurrentThread()
}
}
- LOGV("threadid=%d: bye!\n", self->threadId);
+ LOGV("threadid=%d: bye!", self->threadId);
releaseThreadId(self);
dvmUnlockThreadList();
@@ -2185,7 +2185,7 @@ void dvmSuspendThread(Thread* thread)
lockThreadSuspendCount();
dvmAddToSuspendCounts(thread, 1, 1);
- LOG_THREAD("threadid=%d: suspend++, now=%d\n",
+ LOG_THREAD("threadid=%d: suspend++, now=%d",
thread->threadId, thread->suspendCount);
unlockThreadSuspendCount();
@@ -2213,11 +2213,11 @@ void dvmResumeThread(Thread* thread)
if (thread->suspendCount > 0) {
dvmAddToSuspendCounts(thread, -1, -1);
} else {
- LOG_THREAD("threadid=%d: suspendCount already zero\n",
+ LOG_THREAD("threadid=%d: suspendCount already zero",
thread->threadId);
}
- LOG_THREAD("threadid=%d: suspend--, now=%d\n",
+ LOG_THREAD("threadid=%d: suspend--, now=%d",
thread->threadId, thread->suspendCount);
if (thread->suspendCount == 0) {
@@ -2254,7 +2254,7 @@ void dvmSuspendSelf(bool jdwpActivity)
*/
assert(self->suspendCount > 0);
self->status = THREAD_SUSPENDED;
- LOG_THREAD("threadid=%d: self-suspending (dbg)\n", self->threadId);
+ LOG_THREAD("threadid=%d: self-suspending (dbg)", self->threadId);
/*
* Tell JDWP that we've completed suspension. The JDWP thread can't
@@ -2264,7 +2264,7 @@ void dvmSuspendSelf(bool jdwpActivity)
* If we got here via waitForDebugger(), don't do this part.
*/
if (jdwpActivity) {
- //LOGI("threadid=%d: clearing wait-for-event (my handle=%08x)\n",
+ //LOGI("threadid=%d: clearing wait-for-event (my handle=%08x)",
// self->threadId, (int) self->handle);
dvmJdwpClearWaitForEventThread(gDvm.jdwpState);
}
@@ -2279,13 +2279,13 @@ void dvmSuspendSelf(bool jdwpActivity)
* dump event is pending (assuming SignalCatcher was resumed for
* just long enough to try to grab the thread-suspend lock).
*/
- LOGD("threadid=%d: still suspended after undo (sc=%d dc=%d)\n",
+ LOGD("threadid=%d: still suspended after undo (sc=%d dc=%d)",
self->threadId, self->suspendCount, self->dbgSuspendCount);
}
}
assert(self->suspendCount == 0 && self->dbgSuspendCount == 0);
self->status = THREAD_RUNNING;
- LOG_THREAD("threadid=%d: self-reviving (dbg), status=%d\n",
+ LOG_THREAD("threadid=%d: self-reviving (dbg), status=%d",
self->threadId, self->status);
unlockThreadSuspendCount();
@@ -2321,12 +2321,12 @@ int dvmRaiseThreadPriorityIfNeeded(Thread* thread, int* pSavedThreadPrio,
errno = 0;
*pSavedThreadPrio = getpriority(PRIO_PROCESS, thread->systemTid);
if (errno != 0) {
- LOGW("Unable to get priority for threadid=%d sysTid=%d\n",
+ LOGW("Unable to get priority for threadid=%d sysTid=%d",
thread->threadId, thread->systemTid);
return 0;
}
if (get_sched_policy(thread->systemTid, pSavedThreadPolicy) != 0) {
- LOGW("Unable to get policy for threadid=%d sysTid=%d\n",
+ LOGW("Unable to get policy for threadid=%d sysTid=%d",
thread->threadId, thread->systemTid);
return 0;
}
@@ -2338,10 +2338,10 @@ int dvmRaiseThreadPriorityIfNeeded(Thread* thread, int* pSavedThreadPrio,
*/
if (*pSavedThreadPolicy == SP_BACKGROUND) {
if (set_sched_policy(thread->systemTid, SP_FOREGROUND) != 0) {
- LOGW("Couldn't set fg policy on tid %d\n", thread->systemTid);
+ LOGW("Couldn't set fg policy on tid %d", thread->systemTid);
} else {
changeFlags |= kChangedPolicy;
- LOGD("Temporarily moving tid %d to fg (was %d)\n",
+ LOGD("Temporarily moving tid %d to fg (was %d)",
thread->systemTid, *pSavedThreadPolicy);
}
}
@@ -2353,11 +2353,11 @@ int dvmRaiseThreadPriorityIfNeeded(Thread* thread, int* pSavedThreadPrio,
if (*pSavedThreadPrio > 0) {
const int kHigher = 0;
if (setpriority(PRIO_PROCESS, thread->systemTid, kHigher) != 0) {
- LOGW("Couldn't raise priority on tid %d to %d\n",
+ LOGW("Couldn't raise priority on tid %d to %d",
thread->systemTid, kHigher);
} else {
changeFlags |= kChangedPriority;
- LOGD("Temporarily raised priority on tid %d (%d -> %d)\n",
+ LOGD("Temporarily raised priority on tid %d (%d -> %d)",
thread->systemTid, *pSavedThreadPrio, kHigher);
}
}
@@ -2373,10 +2373,10 @@ void dvmResetThreadPriority(Thread* thread, int changeFlags,
{
if ((changeFlags & kChangedPolicy) != 0) {
if (set_sched_policy(thread->systemTid, savedThreadPolicy) != 0) {
- LOGW("NOTE: couldn't reset tid %d to (%d)\n",
+ LOGW("NOTE: couldn't reset tid %d to (%d)",
thread->systemTid, savedThreadPolicy);
} else {
- LOGD("Restored policy of %d to %d\n",
+ LOGD("Restored policy of %d to %d",
thread->systemTid, savedThreadPolicy);
}
}
@@ -2384,10 +2384,10 @@ void dvmResetThreadPriority(Thread* thread, int changeFlags,
if ((changeFlags & kChangedPriority) != 0) {
if (setpriority(PRIO_PROCESS, thread->systemTid, savedThreadPrio) != 0)
{
- LOGW("NOTE: couldn't reset priority on thread %d to %d\n",
+ LOGW("NOTE: couldn't reset priority on thread %d to %d",
thread->systemTid, savedThreadPrio);
} else {
- LOGD("Restored priority on %d to %d\n",
+ LOGD("Restored priority on %d to %d",
thread->systemTid, savedThreadPrio);
}
}
@@ -2471,7 +2471,7 @@ static void waitForThreadSuspend(Thread* self, Thread* thread)
*/
if (!dvmIterativeSleep(sleepIter++, spinSleepTime, startWhen)) {
if (spinSleepTime != FIRST_SLEEP) {
- LOGW("threadid=%d: spin on suspend #%d threadid=%d (pcf=%d)\n",
+ LOGW("threadid=%d: spin on suspend #%d threadid=%d (pcf=%d)",
self->threadId, retryCount,
thread->threadId, priChangeFlags);
if (retryCount > 1) {
@@ -2486,11 +2486,11 @@ static void waitForThreadSuspend(Thread* self, Thread* thread)
spinSleepTime = MORE_SLEEP;
if (retryCount++ == kMaxRetries) {
- LOGE("Fatal spin-on-suspend, dumping threads\n");
+ LOGE("Fatal spin-on-suspend, dumping threads");
dvmDumpAllThreads(false);
/* log this after -- long traces will scroll off log */
- LOGE("threadid=%d: stuck on threadid=%d, giving up\n",
+ LOGE("threadid=%d: stuck on threadid=%d, giving up",
self->threadId, thread->threadId);
/* try to get a debuggerd dump from the spinning thread */
@@ -2502,7 +2502,7 @@ static void waitForThreadSuspend(Thread* self, Thread* thread)
}
if (complained) {
- LOGW("threadid=%d: spin on suspend resolved in %lld msec\n",
+ LOGW("threadid=%d: spin on suspend resolved in %lld msec",
self->threadId,
(dvmGetRelativeTimeUsec() - firstStartWhen) / 1000);
//dvmDumpThread(thread, false); /* suspended, so dump is safe */
@@ -2551,7 +2551,7 @@ void dvmSuspendAllThreads(SuspendCause why)
*/
lockThreadSuspend("susp-all", why);
- LOG_THREAD("threadid=%d: SuspendAll starting\n", self->threadId);
+ LOG_THREAD("threadid=%d: SuspendAll starting", self->threadId);
/*
* This is possible if the current thread was in VMWAIT mode when a
@@ -2609,7 +2609,7 @@ void dvmSuspendAllThreads(SuspendCause why)
/* wait for the other thread to see the pending suspend */
waitForThreadSuspend(self, thread);
- LOG_THREAD("threadid=%d: threadid=%d status=%d sc=%d dc=%d\n",
+ LOG_THREAD("threadid=%d: threadid=%d status=%d sc=%d dc=%d",
self->threadId, thread->threadId, thread->status,
thread->suspendCount, thread->dbgSuspendCount);
}
@@ -2617,7 +2617,7 @@ void dvmSuspendAllThreads(SuspendCause why)
dvmUnlockThreadList();
unlockThreadSuspend();
- LOG_THREAD("threadid=%d: SuspendAll complete\n", self->threadId);
+ LOG_THREAD("threadid=%d: SuspendAll complete", self->threadId);
}
/*
@@ -2632,7 +2632,7 @@ void dvmResumeAllThreads(SuspendCause why)
int cc;
lockThreadSuspend("res-all", why); /* one suspend/resume at a time */
- LOG_THREAD("threadid=%d: ResumeAll starting\n", self->threadId);
+ LOG_THREAD("threadid=%d: ResumeAll starting", self->threadId);
/*
* Decrement the suspend counts for all threads. No need for atomic
@@ -2658,7 +2658,7 @@ void dvmResumeAllThreads(SuspendCause why)
why == SUSPEND_FOR_DEBUG_EVENT)
? -1 : 0);
} else {
- LOG_THREAD("threadid=%d: suspendCount already zero\n",
+ LOG_THREAD("threadid=%d: suspendCount already zero",
thread->threadId);
}
}
@@ -2699,7 +2699,7 @@ void dvmResumeAllThreads(SuspendCause why)
* the correct order of acquisition, but it feels weird.)
*/
- LOG_THREAD("threadid=%d: ResumeAll waking others\n", self->threadId);
+ LOG_THREAD("threadid=%d: ResumeAll waking others", self->threadId);
unlockThreadSuspend();
/*
@@ -2711,7 +2711,7 @@ void dvmResumeAllThreads(SuspendCause why)
assert(cc == 0);
unlockThreadSuspendCount();
- LOG_THREAD("threadid=%d: ResumeAll complete\n", self->threadId);
+ LOG_THREAD("threadid=%d: ResumeAll complete", self->threadId);
}
/*
@@ -2725,7 +2725,7 @@ void dvmUndoDebuggerSuspensions()
int cc;
lockThreadSuspend("undo", SUSPEND_FOR_DEBUG);
- LOG_THREAD("threadid=%d: UndoDebuggerSusp starting\n", self->threadId);
+ LOG_THREAD("threadid=%d: UndoDebuggerSusp starting", self->threadId);
/*
* Decrement the suspend counts for all threads. No need for atomic
@@ -2762,7 +2762,7 @@ void dvmUndoDebuggerSuspensions()
unlockThreadSuspend();
- LOG_THREAD("threadid=%d: UndoDebuggerSusp complete\n", self->threadId);
+ LOG_THREAD("threadid=%d: UndoDebuggerSusp complete", self->threadId);
}
/*
@@ -2814,7 +2814,7 @@ void dvmWaitForSuspend(Thread* thread)
{
Thread* self = dvmThreadSelf();
- LOG_THREAD("threadid=%d: waiting for threadid=%d to sleep\n",
+ LOG_THREAD("threadid=%d: waiting for threadid=%d to sleep",
self->threadId, thread->threadId);
assert(thread->handle != dvmJdwpGetDebugThread(gDvm.jdwpState));
@@ -2823,7 +2823,7 @@ void dvmWaitForSuspend(Thread* thread)
waitForThreadSuspend(self, thread);
- LOG_THREAD("threadid=%d: threadid=%d is now asleep\n",
+ LOG_THREAD("threadid=%d: threadid=%d is now asleep",
self->threadId, thread->threadId);
}
@@ -2846,7 +2846,7 @@ static bool fullSuspendCheck(Thread* self)
bool needSuspend = (self->suspendCount != 0);
if (needSuspend) {
- LOG_THREAD("threadid=%d: self-suspending\n", self->threadId);
+ LOG_THREAD("threadid=%d: self-suspending", self->threadId);
ThreadStatus oldStatus = self->status; /* should be RUNNING */
self->status = THREAD_SUSPENDED;
@@ -2861,7 +2861,7 @@ static bool fullSuspendCheck(Thread* self)
}
assert(self->suspendCount == 0 && self->dbgSuspendCount == 0);
self->status = oldStatus;
- LOG_THREAD("threadid=%d: self-reviving, status=%d\n",
+ LOG_THREAD("threadid=%d: self-reviving, status=%d",
self->threadId, self->status);
}
@@ -2898,7 +2898,7 @@ ThreadStatus dvmChangeStatus(Thread* self, ThreadStatus newStatus)
if (self == NULL)
self = dvmThreadSelf();
- LOGVV("threadid=%d: (status %d -> %d)\n",
+ LOGVV("threadid=%d: (status %d -> %d)",
self->threadId, self->status, newStatus);
oldStatus = self->status;
@@ -2991,13 +2991,13 @@ static Object* getStaticThreadGroup(const char* fieldName)
groupField = dvmFindStaticField(gDvm.classJavaLangThreadGroup,
fieldName, "Ljava/lang/ThreadGroup;");
if (groupField == NULL) {
- LOGE("java.lang.ThreadGroup does not have an '%s' field\n", fieldName);
+ LOGE("java.lang.ThreadGroup does not have an '%s' field", fieldName);
dvmThrowInternalError("bad definition for ThreadGroup");
return NULL;
}
groupObj = dvmGetStaticFieldObject(groupField);
if (groupObj == NULL) {
- LOGE("java.lang.ThreadGroup.%s not initialized\n", fieldName);
+ LOGE("java.lang.ThreadGroup.%s not initialized", fieldName);
dvmThrowInternalError(NULL);
return NULL;
}
@@ -3036,7 +3036,7 @@ Thread* dvmGetThreadFromThreadObject(Object* vmThreadObj)
}
if (thread == NULL) {
- LOGW("WARNING: vmThreadObj=%p has thread=%p, not in thread list\n",
+ LOGW("WARNING: vmThreadObj=%p has thread=%p, not in thread list",
vmThreadObj, (Thread*)vmData);
vmData = 0;
}
@@ -3109,7 +3109,7 @@ void dvmChangeThreadPriority(Thread* thread, int newPriority)
int newNice;
if (newPriority < 1 || newPriority > 10) {
- LOGW("bad priority %d\n", newPriority);
+ LOGW("bad priority %d", newPriority);
newPriority = 5;
}
newNice = kNiceValues[newPriority-1];
@@ -3122,11 +3122,11 @@ void dvmChangeThreadPriority(Thread* thread, int newPriority)
if (setpriority(PRIO_PROCESS, pid, newNice) != 0) {
char* str = dvmGetThreadName(thread);
- LOGI("setPriority(%d) '%s' to prio=%d(n=%d) failed: %s\n",
+ LOGI("setPriority(%d) '%s' to prio=%d(n=%d) failed: %s",
pid, str, newPriority, newNice, strerror(errno));
free(str);
} else {
- LOGV("setPriority(%d) to prio=%d(n=%d)\n",
+ LOGV("setPriority(%d) to prio=%d(n=%d)",
pid, newPriority, newNice);
}
}
@@ -3144,7 +3144,7 @@ static int getThreadPriorityFromSystem()
errno = 0;
sysprio = getpriority(PRIO_PROCESS, 0);
if (sysprio == -1 && errno != 0) {
- LOGW("getpriority() failed: %s\n", strerror(errno));
+ LOGW("getpriority() failed: %s", strerror(errno));
return THREAD_NORM_PRIORITY;
}
@@ -3324,7 +3324,7 @@ void dvmDumpThreadEx(const DebugOutputTarget* target, Thread* thread,
*/
threadObj = thread->threadObj;
if (threadObj == NULL) {
- LOGI("Can't dump thread %d: threadObj not set\n", thread->threadId);
+ LOGI("Can't dump thread %d: threadObj not set", thread->threadId);
return;
}
dvmAddTrackedAlloc(threadObj, NULL);
@@ -3337,7 +3337,7 @@ void dvmDumpThreadEx(const DebugOutputTarget* target, Thread* thread,
isDaemon = dvmGetFieldBoolean(threadObj, gDvm.offJavaLangThread_daemon);
if (pthread_getschedparam(pthread_self(), &policy, &sp) != 0) {
- LOGW("Warning: pthread_getschedparam failed\n");
+ LOGW("Warning: pthread_getschedparam failed");
policy = -1;
sp.sched_priority = -1;
}
@@ -3427,7 +3427,7 @@ char* dvmGetThreadName(Thread* thread)
StringObject* nameObj;
if (thread->threadObj == NULL) {
- LOGW("threadObj is NULL, name not available\n");
+ LOGW("threadObj is NULL, name not available");
return strdup("-unknown-");
}
@@ -3529,17 +3529,17 @@ void dvmNukeThread(Thread* thread)
dvmThreadSelf()->threadId, thread->threadId, thread->systemTid);
killResult = pthread_kill(thread->handle, SIGSTKFLT);
if (killResult != 0) {
- LOGD("NOTE: pthread_kill #1 failed: %s\n", strerror(killResult));
+ LOGD("NOTE: pthread_kill #1 failed: %s", strerror(killResult));
}
usleep(2 * 1000 * 1000); // TODO: timed-wait until debuggerd attaches
killResult = pthread_kill(thread->handle, SIGSTKFLT);
if (killResult != 0) {
- LOGD("NOTE: pthread_kill #2 failed: %s\n", strerror(killResult));
+ LOGD("NOTE: pthread_kill #2 failed: %s", strerror(killResult));
}
- LOGD("Sent, pausing to let debuggerd run\n");
+ LOGD("Sent, pausing to let debuggerd run");
usleep(8 * 1000 * 1000); // TODO: timed-wait until debuggerd finishes
/* ignore SIGSEGV so the eventual dmvAbort() doesn't notify debuggerd */
signal(SIGSEGV, SIG_IGN);
- LOGD("Continuing\n");
+ LOGD("Continuing");
}
diff --git a/vm/UtfString.cpp b/vm/UtfString.cpp
index 0b7e4a091..a4bf6a835 100644
--- a/vm/UtfString.cpp
+++ b/vm/UtfString.cpp
@@ -48,7 +48,7 @@ static StringObject* makeStringObject(u4 charsLength, ArrayObject** pChars)
if (!dvmIsClassInitialized(gDvm.classJavaLangString)) {
/* Perform first-time use initialization of the class. */
if (!dvmInitClass(gDvm.classJavaLangString)) {
- LOGE("FATAL: Could not initialize class String\n");
+ LOGE("FATAL: Could not initialize class String");
dvmAbort();
}
}
diff --git a/vm/alloc/Alloc.cpp b/vm/alloc/Alloc.cpp
index 45ed53f46..1dbac532e 100644
--- a/vm/alloc/Alloc.cpp
+++ b/vm/alloc/Alloc.cpp
@@ -109,14 +109,14 @@ static Object* createStockException(const char* descriptor, const char* msg)
/* find class, initialize if necessary */
clazz = dvmFindSystemClass(descriptor);
if (clazz == NULL) {
- LOGE("Unable to find %s\n", descriptor);
+ LOGE("Unable to find %s", descriptor);
return NULL;
}
init = dvmFindDirectMethodByDescriptor(clazz, "<init>",
"(Ljava/lang/String;)V");
if (init == NULL) {
- LOGE("Unable to find String-arg constructor for %s\n", descriptor);
+ LOGE("Unable to find String-arg constructor for %s", descriptor);
return NULL;
}
@@ -129,7 +129,7 @@ static Object* createStockException(const char* descriptor, const char* msg)
} else {
msgStr = dvmCreateStringFromCstr(msg);
if (msgStr == NULL) {
- LOGW("Could not allocate message string \"%s\"\n", msg);
+ LOGW("Could not allocate message string \"%s\"", msg);
dvmReleaseTrackedAlloc(obj, self);
return NULL;
}
@@ -175,7 +175,7 @@ bool dvmCreateStockExceptions()
if (gDvm.outOfMemoryObj == NULL || gDvm.internalErrorObj == NULL ||
gDvm.noClassDefFoundErrorObj == NULL)
{
- LOGW("Unable to create stock exceptions\n");
+ LOGW("Unable to create stock exceptions");
return false;
}
@@ -269,7 +269,7 @@ void dvmAddTrackedAlloc(Object* obj, Thread* self)
assert(obj != NULL);
assert(self != NULL);
if (!dvmAddToReferenceTable(&self->internalLocalRefTable, obj)) {
- LOGE("threadid=%d: unable to add %p to internal ref table\n",
+ LOGE("threadid=%d: unable to add %p to internal ref table",
self->threadId, obj);
dvmDumpThread(self, false);
dvmAbort();
@@ -294,7 +294,7 @@ void dvmReleaseTrackedAlloc(Object* obj, Thread* self)
if (!dvmRemoveFromReferenceTable(&self->internalLocalRefTable,
self->internalLocalRefTable.table, obj))
{
- LOGE("threadid=%d: failed to remove %p from internal ref table\n",
+ LOGE("threadid=%d: failed to remove %p from internal ref table",
self->threadId, obj);
dvmAbort();
}
diff --git a/vm/alloc/Copying.cpp b/vm/alloc/Copying.cpp
index 47df05ffa..b53b96f13 100644
--- a/vm/alloc/Copying.cpp
+++ b/vm/alloc/Copying.cpp
@@ -1133,7 +1133,7 @@ void processFinalizableReferences()
// we can schedule them next time. Watch out,
// because we may be expecting to free up space
// by calling finalizers.
- LOG_REF("no room for pending finalizations\n");
+ LOG_REF("no room for pending finalizations");
dvmAbort();
}
@@ -1153,7 +1153,7 @@ void processFinalizableReferences()
if (!dvmHeapAddToHeapRefTable(&newPendingRefs, *ref)) {
//TODO: add the current table and allocate
// a new, smaller one.
- LOG_REF("no room for any more pending finalizations: %zd\n",
+ LOG_REF("no room for any more pending finalizations: %zd",
dvmHeapNumHeapRefTableEntries(&newPendingRefs));
dvmAbort();
}
@@ -1178,7 +1178,7 @@ void processFinalizableReferences()
totalPendCount += newPendCount;
finRefs = finRefs->next;
}
- LOG_REF("%zd finalizers triggered.\n", totalPendCount);
+ LOG_REF("%zd finalizers triggered.", totalPendCount);
if (totalPendCount == 0) {
/* No objects required finalization.
* Free the empty temporary table.
@@ -1192,7 +1192,7 @@ void processFinalizableReferences()
if (!dvmHeapAddTableToLargeTable(&gDvm.gcHeap->pendingFinalizationRefs,
&newPendingRefs))
{
- LOG_REF("can't insert new pending finalizations\n");
+ LOG_REF("can't insert new pending finalizations");
dvmAbort();
}
@@ -1537,7 +1537,7 @@ static void scavengeThreadStack(Thread *thread)
#ifdef COUNT_PRECISE_METHODS
/* the GC is running, so no lock required */
if (dvmPointerSetAddEntry(gDvm.preciseMethods, method))
- LOG_SCAV("PGC: added %s.%s %p\n",
+ LOG_SCAV("PGC: added %s.%s %p",
method->clazz->descriptor, method->name, method);
#endif
#if WITH_EXTRA_GC_CHECKS > 1
@@ -1580,13 +1580,13 @@ static void scavengeThreadStack(Thread *thread)
* some value.
*/
if (saveArea->xtra.currentPc != thread->currentPc2) {
- LOGW("PGC: savedPC(%p) != current PC(%p), %s.%s ins=%p\n",
+ LOGW("PGC: savedPC(%p) != current PC(%p), %s.%s ins=%p",
saveArea->xtra.currentPc, thread->currentPc2,
method->clazz->descriptor, method->name, method->insns);
if (saveArea->xtra.currentPc != NULL)
- LOGE(" pc inst = 0x%04x\n", *saveArea->xtra.currentPc);
+ LOGE(" pc inst = 0x%04x", *saveArea->xtra.currentPc);
if (thread->currentPc2 != NULL)
- LOGE(" pc2 inst = 0x%04x\n", *thread->currentPc2);
+ LOGE(" pc2 inst = 0x%04x", *thread->currentPc2);
dvmDumpThread(thread, false);
}
} else {
@@ -1612,7 +1612,7 @@ static void scavengeThreadStack(Thread *thread)
Method* nonConstMethod = (Method*) method; // quiet gcc
pMap = dvmGetExpandedRegisterMap(nonConstMethod);
- //LOG_SCAV("PGC: %s.%s\n", method->clazz->descriptor, method->name);
+ //LOG_SCAV("PGC: %s.%s", method->clazz->descriptor, method->name);
if (pMap != NULL) {
/* found map, get registers for this address */
@@ -1620,10 +1620,10 @@ static void scavengeThreadStack(Thread *thread)
regVector = dvmRegisterMapGetLine(pMap, addr);
/*
if (regVector == NULL) {
- LOG_SCAV("PGC: map but no entry for %s.%s addr=0x%04x\n",
+ LOG_SCAV("PGC: map but no entry for %s.%s addr=0x%04x",
method->clazz->descriptor, method->name, addr);
} else {
- LOG_SCAV("PGC: found map for %s.%s 0x%04x (t=%d)\n",
+ LOG_SCAV("PGC: found map for %s.%s 0x%04x (t=%d)",
method->clazz->descriptor, method->name, addr,
thread->threadId);
}
@@ -1637,7 +1637,7 @@ static void scavengeThreadStack(Thread *thread)
* worth yelling a little.
*/
if (gDvm.preciseGc) {
- LOG_SCAV("PGC: no map for %s.%s\n", method->clazz->descriptor, method->name);
+ LOG_SCAV("PGC: no map for %s.%s", method->clazz->descriptor, method->name);
}
regVector = NULL;
}
@@ -1673,7 +1673,7 @@ static void scavengeThreadStack(Thread *thread)
#if WITH_EXTRA_GC_CHECKS > 0
if ((rval & 0x3) != 0 || !dvmIsValidObject((Object*) rval)) {
/* this is very bad */
- LOGE("PGC: invalid ref in reg %d: 0x%08x\n",
+ LOGE("PGC: invalid ref in reg %d: 0x%08x",
method->registersSize-1 - i, rval);
} else
#endif
@@ -1690,7 +1690,7 @@ static void scavengeThreadStack(Thread *thread)
#if WITH_EXTRA_GC_CHECKS > 1
if (dvmIsValidObject((Object*) rval)) {
/* this is normal, but we feel chatty */
- LOGD("PGC: ignoring valid ref in reg %d: 0x%08x\n",
+ LOGD("PGC: ignoring valid ref in reg %d: 0x%08x",
method->registersSize-1 - i, rval);
}
#endif
@@ -1771,7 +1771,7 @@ static void pinThreadStack(const Thread *thread)
* native methods don't move around. We can do a precise scan
* of the arguments by examining the method signature.
*/
- LOG_PIN("+++ native scan %s.%s\n",
+ LOG_PIN("+++ native scan %s.%s",
method->clazz->descriptor, method->name);
assert(method->registersSize == method->insSize);
if (!dvmIsStaticMethod(method)) {
@@ -1809,7 +1809,7 @@ static void pinThreadStack(const Thread *thread)
obj = (Object *)*framePtr; // debug, remove
if (dvmIsValidObject(obj)) { // debug, remove
/* if we see a lot of these, our scan might be off */
- LOG_PIN("+++ did NOT pin obj %p\n", obj);
+ LOG_PIN("+++ did NOT pin obj %p", obj);
}
break;
}
@@ -1818,7 +1818,7 @@ static void pinThreadStack(const Thread *thread)
const RegisterMap* pMap = dvmGetExpandedRegisterMap(method);
const u1* regVector = NULL;
- LOGI("conservative : %s.%s\n", method->clazz->descriptor, method->name);
+ LOGI("conservative : %s.%s", method->clazz->descriptor, method->name);
if (pMap != NULL) {
int addr = saveArea->xtra.currentPc - method->insns;
@@ -2019,10 +2019,10 @@ static void scavengeBlockQueue()
describeBlockQueue(heapSource);
while (heapSource->queueHead != QUEUE_TAIL) {
block = heapSource->queueHead;
- LOG_SCAV("Dequeueing block %zu\n", block);
+ LOG_SCAV("Dequeueing block %zu", block);
scavengeBlock(heapSource, block);
heapSource->queueHead = heapSource->blockQueue[block];
- LOG_SCAV("New queue head is %zu\n", heapSource->queueHead);
+ LOG_SCAV("New queue head is %zu", heapSource->queueHead);
}
LOG_SCAV("<<< scavengeBlockQueue()");
}
diff --git a/vm/alloc/DdmHeap.cpp b/vm/alloc/DdmHeap.cpp
index ce2cb6acb..62b8037d1 100644
--- a/vm/alloc/DdmHeap.cpp
+++ b/vm/alloc/DdmHeap.cpp
@@ -69,7 +69,7 @@ void dvmDdmSendHeapInfo(int reason, bool shouldLock)
*/
if (reason == gDvm.gcHeap->ddmHpifWhen) {
if (shouldLock && ! dvmLockHeap()) {
- LOGW("%s(): can't lock heap to clear when\n", __func__);
+ LOGW("%s(): can't lock heap to clear when", __func__);
goto skip_when;
}
if (reason == gDvm.gcHeap->ddmHpifWhen) {
@@ -135,12 +135,12 @@ bool dvmDdmHandleHpifChunk(int when)
gDvm.gcHeap->ddmHpifWhen = when;
dvmUnlockHeap();
} else {
- LOGI("%s(): can't lock heap to set when\n", __func__);
+ LOGI("%s(): can't lock heap to set when", __func__);
return false;
}
break;
default:
- LOGI("%s(): bad when value 0x%08x\n", __func__, when);
+ LOGI("%s(): bad when value 0x%08x", __func__, when);
return false;
}
@@ -228,7 +228,7 @@ static void heap_chunk_callback(const void *chunkptr, size_t chunklen,
bytesLeft = ctx->bufLen - (size_t)(ctx->p - ctx->buf);
if (bytesLeft < needed) {
- LOGW("chunk is too big to transmit (chunklen=%zd, %zd bytes)\n",
+ LOGW("chunk is too big to transmit (chunklen=%zd, %zd bytes)",
chunklen, needed);
return;
}
@@ -414,7 +414,7 @@ void dvmDdmSendHeapSegments(bool shouldLock, bool native)
}
}
if (shouldLock && !dvmLockHeap()) {
- LOGW("Can't lock heap for DDM HPSx dump\n");
+ LOGW("Can't lock heap for DDM HPSx dump");
return;
}
@@ -451,14 +451,14 @@ void dvmDdmSendHeapSegments(bool shouldLock, bool native)
bool dvmDdmHandleHpsgNhsgChunk(int when, int what, bool native)
{
- LOGI("dvmDdmHandleHpsgChunk(when %d, what %d, heap %d)\n", when, what,
+ LOGI("dvmDdmHandleHpsgChunk(when %d, what %d, heap %d)", when, what,
native);
switch (when) {
case HPSG_WHEN_NEVER:
case HPSG_WHEN_EVERY_GC:
break;
default:
- LOGI("%s(): bad when value 0x%08x\n", __func__, when);
+ LOGI("%s(): bad when value 0x%08x", __func__, when);
return false;
}
@@ -467,7 +467,7 @@ bool dvmDdmHandleHpsgNhsgChunk(int when, int what, bool native)
case HPSG_WHAT_DISTINCT_OBJECTS:
break;
default:
- LOGI("%s(): bad what value 0x%08x\n", __func__, what);
+ LOGI("%s(): bad what value 0x%08x", __func__, what);
return false;
}
@@ -482,7 +482,7 @@ bool dvmDdmHandleHpsgNhsgChunk(int when, int what, bool native)
//TODO: if what says we should dump immediately, signal (or do) it from here
dvmUnlockHeap();
} else {
- LOGI("%s(): can't lock heap to set when/what\n", __func__);
+ LOGI("%s(): can't lock heap to set when/what", __func__);
return false;
}
diff --git a/vm/alloc/Heap.cpp b/vm/alloc/Heap.cpp
index 34f56cc3b..97df20f35 100644
--- a/vm/alloc/Heap.cpp
+++ b/vm/alloc/Heap.cpp
@@ -259,7 +259,7 @@ static void *tryMalloc(size_t size)
*/
//TODO: wait for the finalizers from the previous GC to finish
collect_soft_refs:
- LOGI_HEAP("Forcing collection of SoftReferences for %zu-byte allocation\n",
+ LOGI_HEAP("Forcing collection of SoftReferences for %zu-byte allocation",
size);
gcForMalloc(true);
ptr = dvmHeapSourceAllocAndGrow(size);
@@ -268,7 +268,7 @@ collect_soft_refs:
}
//TODO: maybe wait for finalizers and try one last time
- LOGE_HEAP("Out of memory on a %zd-byte allocation.\n", size);
+ LOGE_HEAP("Out of memory on a %zd-byte allocation.", size);
//TODO: tell the HeapSource to dump its state
dvmDumpThread(dvmThreadSelf(), false);
@@ -525,7 +525,7 @@ void dvmCollectGarbageInternal(const GcSpec* spec)
*/
if (gcHeap->gcRunning) {
- LOGW_HEAP("Attempted recursive GC\n");
+ LOGW_HEAP("Attempted recursive GC");
return;
}
@@ -553,7 +553,7 @@ void dvmCollectGarbageInternal(const GcSpec* spec)
/* Set up the marking context.
*/
if (!dvmHeapBeginMarkStep(spec->isPartial)) {
- LOGE_HEAP("dvmHeapBeginMarkStep failed; aborting\n");
+ LOGE_HEAP("dvmHeapBeginMarkStep failed; aborting");
dvmAbort();
}
@@ -740,15 +740,15 @@ void dvmCollectGarbageInternal(const GcSpec* spec)
rootTime, dirtyTime);
}
if (gcHeap->ddmHpifWhen != 0) {
- LOGD_HEAP("Sending VM heap info to DDM\n");
+ LOGD_HEAP("Sending VM heap info to DDM");
dvmDdmSendHeapInfo(gcHeap->ddmHpifWhen, false);
}
if (gcHeap->ddmHpsgWhen != 0) {
- LOGD_HEAP("Dumping VM heap to DDM\n");
+ LOGD_HEAP("Dumping VM heap to DDM");
dvmDdmSendHeapSegments(false, false);
}
if (gcHeap->ddmNhsgWhen != 0) {
- LOGD_HEAP("Dumping native heap to DDM\n");
+ LOGD_HEAP("Dumping native heap to DDM");
dvmDdmSendHeapSegments(false, true);
}
}
diff --git a/vm/alloc/HeapSource.cpp b/vm/alloc/HeapSource.cpp
index 29551a02f..aa084ab4d 100644
--- a/vm/alloc/HeapSource.cpp
+++ b/vm/alloc/HeapSource.cpp
@@ -289,7 +289,7 @@ static mspace createMspace(void *base, size_t startSize, size_t maximumSize)
* memory in the case where a process uses even less
* than the starting size.
*/
- LOGV_HEAP("Creating VM heap of size %zu\n", startSize);
+ LOGV_HEAP("Creating VM heap of size %zu", startSize);
errno = 0;
mspace msp = create_contiguous_mspace_with_base(startSize/2,
@@ -303,7 +303,7 @@ static mspace createMspace(void *base, size_t startSize, size_t maximumSize)
/* There's no guarantee that errno has meaning when the call
* fails, but it often does.
*/
- LOGE_HEAP("Can't create VM heap of size (%zu,%zu): %s\n",
+ LOGE_HEAP("Can't create VM heap of size (%zu,%zu): %s",
startSize/2, maximumSize, strerror(errno));
}
@@ -340,7 +340,7 @@ static bool addNewHeap(HeapSource *hs)
assert(hs != NULL);
if (hs->numHeaps >= HEAP_SOURCE_MAX_HEAP_COUNT) {
- LOGE("Attempt to create too many heaps (%zd >= %zd)\n",
+ LOGE("Attempt to create too many heaps (%zd >= %zd)",
hs->numHeaps, HEAP_SOURCE_MAX_HEAP_COUNT);
dvmAbort();
return false;
@@ -505,14 +505,14 @@ GcHeap* dvmHeapSourceStartup(size_t startSize, size_t maximumSize,
gcHeap = (GcHeap *)malloc(sizeof(*gcHeap));
if (gcHeap == NULL) {
- LOGE_HEAP("Can't allocate heap descriptor\n");
+ LOGE_HEAP("Can't allocate heap descriptor");
goto fail;
}
memset(gcHeap, 0, sizeof(*gcHeap));
hs = (HeapSource *)malloc(sizeof(*hs));
if (hs == NULL) {
- LOGE_HEAP("Can't allocate heap source\n");
+ LOGE_HEAP("Can't allocate heap source");
free(gcHeap);
goto fail;
}
@@ -530,15 +530,15 @@ GcHeap* dvmHeapSourceStartup(size_t startSize, size_t maximumSize,
hs->heapBase = (char *)base;
hs->heapLength = length;
if (!addInitialHeap(hs, msp, growthLimit)) {
- LOGE_HEAP("Can't add initial heap\n");
+ LOGE_HEAP("Can't add initial heap");
goto fail;
}
if (!dvmHeapBitmapInit(&hs->liveBits, base, length, "dalvik-bitmap-1")) {
- LOGE_HEAP("Can't create liveBits\n");
+ LOGE_HEAP("Can't create liveBits");
goto fail;
}
if (!dvmHeapBitmapInit(&hs->markBits, base, length, "dalvik-bitmap-2")) {
- LOGE_HEAP("Can't create markBits\n");
+ LOGE_HEAP("Can't create markBits");
dvmHeapBitmapDelete(&hs->liveBits);
goto fail;
}
@@ -581,7 +581,7 @@ bool dvmHeapSourceStartupBeforeFork()
/* Create a new heap for post-fork zygote allocations. We only
* try once, even if it fails.
*/
- LOGV("Splitting out new zygote heap\n");
+ LOGV("Splitting out new zygote heap");
gDvm.newZygoteHeapAllocated = true;
dvmClearCardTable();
return addNewHeap(gHs);
@@ -773,7 +773,7 @@ void* dvmHeapSourceAlloc(size_t n)
* This allocation would push us over the soft limit; act as
* if the heap is full.
*/
- LOGV_HEAP("softLimit of %zd.%03zdMB hit for %zd-byte allocation\n",
+ LOGV_HEAP("softLimit of %zd.%03zdMB hit for %zd-byte allocation",
FRACTIONAL_MB(hs->softLimit), n);
return NULL;
}
@@ -1118,7 +1118,7 @@ static void setIdealFootprint(size_t max)
HeapSource *hs = gHs;
size_t maximumSize = getMaximumSize(hs);
if (max > maximumSize) {
- LOGI_HEAP("Clamp target GC heap from %zd.%03zdMB to %u.%03uMB\n",
+ LOGI_HEAP("Clamp target GC heap from %zd.%03zdMB to %u.%03uMB",
FRACTIONAL_MB(max),
FRACTIONAL_MB(maximumSize));
max = maximumSize;
@@ -1183,7 +1183,7 @@ void dvmSetTargetHeapUtilization(float newTarget)
hs->targetUtilization =
(size_t)(newTarget * (float)HEAP_UTILIZATION_MAX);
- LOGV("Set heap target utilization to %zd/%d (%f)\n",
+ LOGV("Set heap target utilization to %zd/%d (%f)",
hs->targetUtilization, HEAP_UTILIZATION_MAX, newTarget);
}
@@ -1302,7 +1302,7 @@ void dvmHeapSourceTrim(size_t bytesTrimmed[], size_t arrayLen)
size_t nativeBytes = 0;
dlmalloc_walk_free_pages(releasePagesInRange, &nativeBytes);
- LOGD_HEAP("madvised %zd (GC) + %zd (native) = %zd total bytes\n",
+ LOGD_HEAP("madvised %zd (GC) + %zd (native) = %zd total bytes",
heapBytes, nativeBytes, heapBytes + nativeBytes);
}
diff --git a/vm/analysis/CodeVerify.cpp b/vm/analysis/CodeVerify.cpp
index bb847d0e0..0c30dac1e 100644
--- a/vm/analysis/CodeVerify.cpp
+++ b/vm/analysis/CodeVerify.cpp
@@ -225,7 +225,7 @@ static void checkMergeTab()
for (i = 0; i < kRegTypeMAX; i++) {
for (j = i; j < kRegTypeMAX; j++) {
if (gDvmMergeTab[i][j] != gDvmMergeTab[j][i]) {
- LOGE("Symmetry violation: %d,%d vs %d,%d\n", i, j, j, i);
+ LOGE("Symmetry violation: %d,%d vs %d,%d", i, j, j, i);
dvmAbort();
}
}
@@ -260,7 +260,7 @@ static bool canConvertTo1nr(RegType srcType, RegType checkType)
assert(checkType >= kRegType1nrSTART && checkType <= kRegType1nrEND);
#if 0
if (checkType < kRegType1nrSTART || checkType > kRegType1nrEND) {
- LOG_VFY("Unexpected checkType %d (srcType=%d)\n", checkType, srcType);
+ LOG_VFY("Unexpected checkType %d (srcType=%d)", checkType, srcType);
assert(false);
return false;
}
@@ -462,7 +462,7 @@ static int setUninitInstance(UninitInstanceMap* uninitMap, int addr,
if (uninitMap->map[idx].clazz != NULL &&
uninitMap->map[idx].clazz != clazz)
{
- LOG_VFY("VFY: addr %d already set to %p, not setting to %p\n",
+ LOG_VFY("VFY: addr %d already set to %p, not setting to %p",
addr, uninitMap->map[idx].clazz, clazz);
return -1; // already set to something else??
}
@@ -471,7 +471,7 @@ static int setUninitInstance(UninitInstanceMap* uninitMap, int addr,
}
}
- LOG_VFY("VFY: addr %d not found in uninit map\n", addr);
+ LOG_VFY("VFY: addr %d not found in uninit map", addr);
assert(false); // shouldn't happen
return -1;
}
@@ -505,7 +505,7 @@ static ClassObject* regTypeInitializedReferenceToClass(RegType type)
if ((type & 0x01) == 0) {
return (ClassObject*) type;
} else {
- //LOG_VFY("VFY: attempted to use uninitialized reference\n");
+ //LOG_VFY("VFY: attempted to use uninitialized reference");
return NULL;
}
}
@@ -586,16 +586,16 @@ static ClassObject* lookupClassByDescriptor(const Method* meth,
* allows the verifier to process the class successfully.
*/
- //LOGI("Looking up '%s'\n", typeStr);
+ //LOGI("Looking up '%s'", typeStr);
ClassObject* clazz;
clazz = dvmFindClassNoInit(pDescriptor, meth->clazz->classLoader);
if (clazz == NULL) {
dvmClearOptException(dvmThreadSelf());
if (strchr(pDescriptor, '$') != NULL) {
- LOGV("VFY: unable to find class referenced in signature (%s)\n",
+ LOGV("VFY: unable to find class referenced in signature (%s)",
pDescriptor);
} else {
- LOG_VFY("VFY: unable to find class referenced in signature (%s)\n",
+ LOG_VFY("VFY: unable to find class referenced in signature (%s)",
pDescriptor);
}
@@ -606,7 +606,7 @@ static ClassObject* lookupClassByDescriptor(const Method* meth,
* There should never be a problem loading primitive arrays.
*/
if (pDescriptor[1] != 'L' && pDescriptor[1] != '[') {
- LOG_VFY("VFY: invalid char in signature in '%s'\n",
+ LOG_VFY("VFY: invalid char in signature in '%s'",
pDescriptor);
*pFailure = VERIFY_ERROR_GENERIC;
}
@@ -629,7 +629,7 @@ static ClassObject* lookupClassByDescriptor(const Method* meth,
clazz = gDvm.classJavaLangObject;
} else {
/* We are looking at a primitive type. */
- LOG_VFY("VFY: invalid char in signature in '%s'\n", pDescriptor);
+ LOG_VFY("VFY: invalid char in signature in '%s'", pDescriptor);
*pFailure = VERIFY_ERROR_GENERIC;
}
@@ -639,7 +639,7 @@ static ClassObject* lookupClassByDescriptor(const Method* meth,
}
if (dvmIsPrimitiveClass(clazz)) {
- LOG_VFY("VFY: invalid use of primitive type '%s'\n", pDescriptor);
+ LOG_VFY("VFY: invalid use of primitive type '%s'", pDescriptor);
*pFailure = VERIFY_ERROR_GENERIC;
clazz = NULL;
}
@@ -667,7 +667,7 @@ static ClassObject* lookupSignatureClass(const Method* meth, const char** pSig,
while (*++endp != ';' && *endp != '\0')
;
if (*endp != ';') {
- LOG_VFY("VFY: bad signature component '%s' (missing ';')\n", sig);
+ LOG_VFY("VFY: bad signature component '%s' (missing ';')", sig);
*pFailure = VERIFY_ERROR_GENERIC;
return NULL;
}
@@ -707,7 +707,7 @@ static ClassObject* lookupSignatureArrayClass(const Method* meth,
while (*++endp != ';' && *endp != '\0')
;
if (*endp != ';') {
- LOG_VFY("VFY: bad signature component '%s' (missing ';')\n", sig);
+ LOG_VFY("VFY: bad signature component '%s' (missing ';')", sig);
*pFailure = VERIFY_ERROR_GENERIC;
return NULL;
}
@@ -774,7 +774,7 @@ static bool setTypesFromSignature(const Method* meth, RegType* regTypes,
}
if (actualArgs >= expectedArgs) {
- LOG_VFY("VFY: expected %d args, found more (%s)\n",
+ LOG_VFY("VFY: expected %d args, found more (%s)",
expectedArgs, descriptor);
goto bad_sig;
}
@@ -834,13 +834,13 @@ static bool setTypesFromSignature(const Method* meth, RegType* regTypes,
actualArgs += 2;
break;
default:
- LOG_VFY("VFY: unexpected signature type char '%c'\n", *descriptor);
+ LOG_VFY("VFY: unexpected signature type char '%c'", *descriptor);
goto bad_sig;
}
}
if (actualArgs != expectedArgs) {
- LOG_VFY("VFY: expected %d args, found %d\n", expectedArgs, actualArgs);
+ LOG_VFY("VFY: expected %d args, found %d", expectedArgs, actualArgs);
goto bad_sig;
}
@@ -892,13 +892,13 @@ static bool setTypesFromSignature(const Method* meth, RegType* regTypes,
return true;
//fail:
-// LOG_VFY_METH(meth, "VFY: bad sig\n");
+// LOG_VFY_METH(meth, "VFY: bad sig");
// return false;
bad_sig:
{
char* desc = dexProtoCopyMethodDescriptor(&meth->prototype);
- LOG_VFY("VFY: bad signature '%s' for %s.%s\n",
+ LOG_VFY("VFY: bad signature '%s' for %s.%s",
desc, meth->clazz->descriptor, meth->name);
free(desc);
}
@@ -1099,7 +1099,7 @@ static Method* verifyInvocationArgs(const Method* meth,
//char* curMethodDesc =
// dexProtoCopyMethodDescriptor(&meth->prototype);
- LOGI("Could not find method %s.%s, referenced from method %s.%s\n",
+ LOGI("Could not find method %s.%s, referenced from method %s.%s",
dotMissingClass, methodName/*, methodDesc*/,
dotMethClass, meth->name/*, curMethodDesc*/);
@@ -1108,7 +1108,7 @@ static Method* verifyInvocationArgs(const Method* meth,
//free(curMethodDesc);
}
- LOG_VFY("VFY: unable to resolve %s method %u: %s.%s %s\n",
+ LOG_VFY("VFY: unable to resolve %s method %u: %s.%s %s",
dvmMethodTypeStr(methodType), pDecInsn->vB,
classDescriptor, methodName, methodDesc);
free(methodDesc);
@@ -1124,7 +1124,7 @@ static Method* verifyInvocationArgs(const Method* meth,
*/
if (resMethod->name[0] == '<') {
if (methodType != METHOD_DIRECT || !isInitMethod(resMethod)) {
- LOG_VFY("VFY: invalid call to %s.%s\n",
+ LOG_VFY("VFY: invalid call to %s.%s",
resMethod->clazz->descriptor, resMethod->name);
goto bad_sig;
}
@@ -1135,7 +1135,7 @@ static Method* verifyInvocationArgs(const Method* meth,
* access flags for the target method.
*/
if (!isCorrectInvokeKind(methodType, resMethod)) {
- LOG_VFY("VFY: invoke type does not match method type of %s.%s\n",
+ LOG_VFY("VFY: invoke type does not match method type of %s.%s",
resMethod->clazz->descriptor, resMethod->name);
goto fail;
}
@@ -1149,7 +1149,7 @@ static Method* verifyInvocationArgs(const Method* meth,
ClassObject* super = meth->clazz->super;
if (super == NULL || resMethod->methodIndex > super->vtableCount) {
char* desc = dexProtoCopyMethodDescriptor(&resMethod->prototype);
- LOG_VFY("VFY: invalid invoke-super from %s.%s to super %s.%s %s\n",
+ LOG_VFY("VFY: invalid invoke-super from %s.%s to super %s.%s %s",
meth->clazz->descriptor, meth->name,
(super == NULL) ? "-" : super->descriptor,
resMethod->name, desc);
@@ -1174,7 +1174,7 @@ static Method* verifyInvocationArgs(const Method* meth,
assert(isRange || expectedArgs <= 5);
if (expectedArgs > meth->outsSize) {
- LOG_VFY("VFY: invalid arg count (%d) exceeds outsSize (%d)\n",
+ LOG_VFY("VFY: invalid arg count (%d) exceeds outsSize (%d)",
expectedArgs, meth->outsSize);
goto fail;
}
@@ -1198,13 +1198,13 @@ static Method* verifyInvocationArgs(const Method* meth,
if (regTypeIsUninitReference(actualArgType) && resMethod->name[0] != '<')
{
- LOG_VFY("VFY: 'this' arg must be initialized\n");
+ LOG_VFY("VFY: 'this' arg must be initialized");
goto fail;
}
if (methodType != METHOD_INTERFACE && actualArgType != kRegTypeZero) {
actualThisRef = regTypeReferenceToClass(actualArgType, uninitMap);
if (!dvmInstanceof(actualThisRef, resMethod->clazz)) {
- LOG_VFY("VFY: 'this' arg '%s' not instance of '%s'\n",
+ LOG_VFY("VFY: 'this' arg '%s' not instance of '%s'",
actualThisRef->descriptor,
resMethod->clazz->descriptor);
goto fail;
@@ -1219,7 +1219,7 @@ static Method* verifyInvocationArgs(const Method* meth,
*/
while (*sig != '\0' && *sig != ')') {
if (actualArgs >= expectedArgs) {
- LOG_VFY("VFY: expected %d args, found more (%c)\n",
+ LOG_VFY("VFY: expected %d args, found more (%c)",
expectedArgs, *sig);
goto bad_sig;
}
@@ -1239,7 +1239,7 @@ static Method* verifyInvocationArgs(const Method* meth,
verifyRegisterType(registerLine, getReg,
regTypeFromClass(clazz), pFailure);
if (!VERIFY_OK(*pFailure)) {
- LOG_VFY("VFY: bad arg %d (into %s)\n",
+ LOG_VFY("VFY: bad arg %d (into %s)",
actualArgs, clazz->descriptor);
goto bad_sig;
}
@@ -1255,7 +1255,7 @@ static Method* verifyInvocationArgs(const Method* meth,
verifyRegisterType(registerLine, getReg,
regTypeFromClass(clazz), pFailure);
if (!VERIFY_OK(*pFailure)) {
- LOG_VFY("VFY: bad arg %d (into %s)\n",
+ LOG_VFY("VFY: bad arg %d (into %s)",
actualArgs, clazz->descriptor);
goto bad_sig;
}
@@ -1295,7 +1295,7 @@ static Method* verifyInvocationArgs(const Method* meth,
actualArgs += 2;
break;
default:
- LOG_VFY("VFY: invocation target: bad signature type char '%c'\n",
+ LOG_VFY("VFY: invocation target: bad signature type char '%c'",
*sig);
goto bad_sig;
}
@@ -1304,13 +1304,13 @@ static Method* verifyInvocationArgs(const Method* meth,
}
if (*sig != ')') {
char* desc = dexProtoCopyMethodDescriptor(&resMethod->prototype);
- LOG_VFY("VFY: invocation target: bad signature '%s'\n", desc);
+ LOG_VFY("VFY: invocation target: bad signature '%s'", desc);
free(desc);
goto bad_sig;
}
if (actualArgs != expectedArgs) {
- LOG_VFY("VFY: expected %d args, found %d\n", expectedArgs, actualArgs);
+ LOG_VFY("VFY: expected %d args, found %d", expectedArgs, actualArgs);
goto bad_sig;
}
@@ -1320,7 +1320,7 @@ static Method* verifyInvocationArgs(const Method* meth,
bad_sig:
if (resMethod != NULL) {
char* desc = dexProtoCopyMethodDescriptor(&resMethod->prototype);
- LOG_VFY("VFY: rejecting call to %s.%s %s\n",
+ LOG_VFY("VFY: rejecting call to %s.%s %s",
resMethod->clazz->descriptor, resMethod->name, desc);
free(desc);
}
@@ -1355,7 +1355,7 @@ static ClassObject* getFieldClass(const Method* meth, const Field* field)
if (fieldClass == NULL) {
dvmClearOptException(dvmThreadSelf());
- LOGV("VFY: unable to find class '%s' for field %s.%s, trying Object\n",
+ LOGV("VFY: unable to find class '%s' for field %s.%s, trying Object",
field->signature, meth->clazz->descriptor, field->name);
fieldClass = gDvm.classJavaLangObject;
} else {
@@ -1404,13 +1404,13 @@ static ClassObject* getClassFromRegister(const RegisterLine* registerLine,
goto bail;
if (!regTypeIsReference(type)) {
- LOG_VFY("VFY: tried to get class from non-ref register v%d (type=%d)\n",
+ LOG_VFY("VFY: tried to get class from non-ref register v%d (type=%d)",
vsrc, type);
*pFailure = VERIFY_ERROR_GENERIC;
goto bail;
}
if (regTypeIsUninitReference(type)) {
- LOG_VFY("VFY: register %u holds uninitialized reference\n", vsrc);
+ LOG_VFY("VFY: register %u holds uninitialized reference", vsrc);
*pFailure = VERIFY_ERROR_GENERIC;
goto bail;
}
@@ -1437,7 +1437,7 @@ static RegType getInvocationThis(const RegisterLine* registerLine,
RegType thisType = kRegTypeUnknown;
if (pDecInsn->vA < 1) {
- LOG_VFY("VFY: invoke lacks 'this'\n");
+ LOG_VFY("VFY: invoke lacks 'this'");
*pFailure = VERIFY_ERROR_GENERIC;
goto bail;
}
@@ -1445,7 +1445,7 @@ static RegType getInvocationThis(const RegisterLine* registerLine,
/* get the element type of the array held in vsrc */
thisType = getRegisterType(registerLine, pDecInsn->vC);
if (!regTypeIsReference(thisType)) {
- LOG_VFY("VFY: tried to get class from non-ref register v%d (type=%d)\n",
+ LOG_VFY("VFY: tried to get class from non-ref register v%d (type=%d)",
pDecInsn->vC, thisType);
*pFailure = VERIFY_ERROR_GENERIC;
goto bail;
@@ -1493,7 +1493,7 @@ static void setRegisterType(RegisterLine* registerLine, u4 vdst,
case kRegTypeLongHi:
case kRegTypeDoubleHi:
/* should never set these explicitly */
- LOGE("BUG: explicit set of high register type\n");
+ LOGE("BUG: explicit set of high register type");
dvmAbort();
break;
@@ -1518,7 +1518,7 @@ static void setRegisterType(RegisterLine* registerLine, u4 vdst,
/* bad type - fall through */
case kRegTypeConflict: // should only be set during a merge
- LOGE("BUG: set register to unknown type %d\n", newType);
+ LOGE("BUG: set register to unknown type %d", newType);
dvmAbort();
break;
}
@@ -1549,7 +1549,7 @@ static void verifyRegisterType(const RegisterLine* registerLine, u4 vsrc,
const RegType* insnRegs = registerLine->regTypes;
RegType srcType = insnRegs[vsrc];
- //LOGD("check-reg v%u = %d\n", vsrc, checkType);
+ //LOGD("check-reg v%u = %d", vsrc, checkType);
switch (checkType) {
case kRegTypeFloat:
case kRegTypeBoolean:
@@ -1560,7 +1560,7 @@ static void verifyRegisterType(const RegisterLine* registerLine, u4 vsrc,
case kRegTypeChar:
case kRegTypeInteger:
if (!canConvertTo1nr(srcType, checkType)) {
- LOG_VFY("VFY: register1 v%u type %d, wanted %d\n",
+ LOG_VFY("VFY: register1 v%u type %d, wanted %d",
vsrc, srcType, checkType);
*pFailure = VERIFY_ERROR_GENERIC;
}
@@ -1568,11 +1568,11 @@ static void verifyRegisterType(const RegisterLine* registerLine, u4 vsrc,
case kRegTypeLongLo:
case kRegTypeDoubleLo:
if (insnRegs[vsrc+1] != srcType+1) {
- LOG_VFY("VFY: register2 v%u-%u values %d,%d\n",
+ LOG_VFY("VFY: register2 v%u-%u values %d,%d",
vsrc, vsrc+1, insnRegs[vsrc], insnRegs[vsrc+1]);
*pFailure = VERIFY_ERROR_GENERIC;
} else if (!canConvertTo2(srcType, checkType)) {
- LOG_VFY("VFY: register2 v%u type %d, wanted %d\n",
+ LOG_VFY("VFY: register2 v%u type %d, wanted %d",
vsrc, srcType, checkType);
*pFailure = VERIFY_ERROR_GENERIC;
}
@@ -1592,24 +1592,24 @@ static void verifyRegisterType(const RegisterLine* registerLine, u4 vsrc,
default:
/* make sure checkType is initialized reference */
if (!regTypeIsReference(checkType)) {
- LOG_VFY("VFY: unexpected check type %d\n", checkType);
+ LOG_VFY("VFY: unexpected check type %d", checkType);
assert(false);
*pFailure = VERIFY_ERROR_GENERIC;
break;
}
if (regTypeIsUninitReference(checkType)) {
- LOG_VFY("VFY: uninitialized ref not expected as reg check\n");
+ LOG_VFY("VFY: uninitialized ref not expected as reg check");
*pFailure = VERIFY_ERROR_GENERIC;
break;
}
/* make sure srcType is initialized reference or always-NULL */
if (!regTypeIsReference(srcType)) {
- LOG_VFY("VFY: register1 v%u type %d, wanted ref\n", vsrc, srcType);
+ LOG_VFY("VFY: register1 v%u type %d, wanted ref", vsrc, srcType);
*pFailure = VERIFY_ERROR_GENERIC;
break;
}
if (regTypeIsUninitReference(srcType)) {
- LOG_VFY("VFY: register1 v%u holds uninitialized ref\n", vsrc);
+ LOG_VFY("VFY: register1 v%u holds uninitialized ref", vsrc);
*pFailure = VERIFY_ERROR_GENERIC;
break;
}
@@ -1630,14 +1630,14 @@ static void verifyRegisterType(const RegisterLine* registerLine, u4 vsrc,
if (srcClass != checkClass &&
!dvmImplements(srcClass, checkClass))
{
- LOG_VFY("VFY: %s does not implement %s\n",
+ LOG_VFY("VFY: %s does not implement %s",
srcClass->descriptor, checkClass->descriptor);
*pFailure = VERIFY_ERROR_GENERIC;
}
*/
} else {
if (!dvmInstanceof(srcClass, checkClass)) {
- LOG_VFY("VFY: %s is not instance of %s\n",
+ LOG_VFY("VFY: %s is not instance of %s",
srcClass->descriptor, checkClass->descriptor);
*pFailure = VERIFY_ERROR_GENERIC;
}
@@ -1673,7 +1673,7 @@ static void markRefsAsInitialized(RegisterLine* registerLine, int insnRegCount,
clazz = getUninitInstance(uninitMap, regTypeToUninitIndex(uninitType));
if (clazz == NULL) {
- LOGE("VFY: unable to find type=0x%x (idx=%d)\n",
+ LOGE("VFY: unable to find type=0x%x (idx=%d)",
uninitType, regTypeToUninitIndex(uninitType));
*pFailure = VERIFY_ERROR_GENERIC;
return;
@@ -1687,7 +1687,7 @@ static void markRefsAsInitialized(RegisterLine* registerLine, int insnRegCount,
changed++;
}
}
- //LOGD("VFY: marked %d registers as initialized\n", changed);
+ //LOGD("VFY: marked %d registers as initialized", changed);
assert(changed > 0);
return;
@@ -1717,7 +1717,7 @@ static void markUninitRefsAsInvalid(RegisterLine* registerLine,
}
//if (changed)
- // LOGD("VFY: marked %d uninitialized registers as invalid\n", changed);
+ // LOGD("VFY: marked %d uninitialized registers as invalid", changed);
}
/*
@@ -1791,18 +1791,18 @@ static inline int compareLineToTable(const RegisterTable* regTable,
result = memcmp(line1->monitorEntries, line2->monitorEntries,
regTable->insnRegCountPlus * sizeof(MonitorEntries));
if (result != 0) {
- LOG_VFY("monitorEntries mismatch\n");
+ LOG_VFY("monitorEntries mismatch");
return result;
}
result = line1->monitorStackTop - line2->monitorStackTop;
if (result != 0) {
- LOG_VFY("monitorStackTop mismatch\n");
+ LOG_VFY("monitorStackTop mismatch");
return result;
}
result = memcmp(line1->monitorStack, line2->monitorStack,
line1->monitorStackTop);
if (result != 0) {
- LOG_VFY("monitorStack mismatch\n");
+ LOG_VFY("monitorStack mismatch");
return result;
}
}
@@ -1909,7 +1909,7 @@ static void copyRegister1(RegisterLine* registerLine, u4 vdst, u4 vsrc,
RegType type = getRegisterType(registerLine, vsrc);
checkTypeCategory(type, cat, pFailure);
if (!VERIFY_OK(*pFailure)) {
- LOG_VFY("VFY: copy1 v%u<-v%u type=%d cat=%d\n", vdst, vsrc, type, cat);
+ LOG_VFY("VFY: copy1 v%u<-v%u type=%d cat=%d", vdst, vsrc, type, cat);
} else {
setRegisterType(registerLine, vdst, type);
if (cat == kTypeCategoryRef && registerLine->monitorEntries != NULL) {
@@ -1932,7 +1932,7 @@ static void copyRegister2(RegisterLine* registerLine, u4 vdst, u4 vsrc,
checkTypeCategory(typel, kTypeCategory2, pFailure);
checkWidePair(typel, typeh, pFailure);
if (!VERIFY_OK(*pFailure)) {
- LOG_VFY("VFY: copy2 v%u<-v%u type=%d/%d\n", vdst, vsrc, typel, typeh);
+ LOG_VFY("VFY: copy2 v%u<-v%u type=%d/%d", vdst, vsrc, typel, typeh);
} else {
setRegisterType(registerLine, vdst, typel);
/* target monitor stack bits will be cleared */
@@ -1955,7 +1955,7 @@ static void copyResultRegister1(RegisterLine* registerLine,
type = getRegisterType(registerLine, vsrc);
checkTypeCategory(type, cat, pFailure);
if (!VERIFY_OK(*pFailure)) {
- LOG_VFY("VFY: copyRes1 v%u<-v%u cat=%d type=%d\n",
+ LOG_VFY("VFY: copyRes1 v%u<-v%u cat=%d type=%d",
vdst, vsrc, cat, type);
} else {
setRegisterType(registerLine, vdst, type);
@@ -1982,7 +1982,7 @@ static void copyResultRegister2(RegisterLine* registerLine,
checkTypeCategory(typel, kTypeCategory2, pFailure);
checkWidePair(typel, typeh, pFailure);
if (!VERIFY_OK(*pFailure)) {
- LOG_VFY("VFY: copyRes2 v%u<-v%u type=%d/%d\n",
+ LOG_VFY("VFY: copyRes2 v%u<-v%u type=%d/%d",
vdst, vsrc, typel, typeh);
} else {
setRegisterType(registerLine, vdst, typel);
@@ -2148,7 +2148,7 @@ static RegType adjustForRightShift(RegisterLine* registerLine, int reg,
newType = srcType;
if (shiftCount >= 32) {
- LOG_VFY("Got unexpectedly large shift count %u\n", shiftCount);
+ LOG_VFY("Got unexpectedly large shift count %u", shiftCount);
/* fail? */
return newType;
}
@@ -2204,10 +2204,10 @@ static RegType adjustForRightShift(RegisterLine* registerLine, int reg,
}
if (newType != srcType) {
- LOGVV("narrowing: %d(%d) --> %d to %d\n",
+ LOGVV("narrowing: %d(%d) --> %d to %d",
shiftCount, isUnsignedShift, srcType, newType);
} else {
- LOGVV("not narrowed: %d(%d) --> %d\n",
+ LOGVV("not narrowed: %d(%d) --> %d",
shiftCount, isUnsignedShift, srcType);
}
return newType;
@@ -2251,7 +2251,7 @@ static ClassObject* digForSuperclass(ClassObject* c1, ClassObject* c2)
depth2 = getClassDepth(c2);
if (gDebugVerbose) {
- LOGVV("COMMON: %s(%d) + %s(%d)\n",
+ LOGVV("COMMON: %s(%d) + %s(%d)",
c1->descriptor, depth1, c2->descriptor, depth2);
}
@@ -2277,7 +2277,7 @@ static ClassObject* digForSuperclass(ClassObject* c1, ClassObject* c2)
}
if (gDebugVerbose) {
- LOGVV(" : --> %s\n", c1->descriptor);
+ LOGVV(" : --> %s", c1->descriptor);
}
return c1;
}
@@ -2360,7 +2360,7 @@ static ClassObject* findCommonArraySuperclass(ClassObject* c1, ClassObject* c2)
}
assert(arrayClass != NULL);
- LOGVV("ArrayMerge '%s' + '%s' --> '%s'\n",
+ LOGVV("ArrayMerge '%s' + '%s' --> '%s'",
c1->descriptor, c2->descriptor, arrayClass->descriptor);
return arrayClass;
}
@@ -2404,13 +2404,13 @@ static ClassObject* findCommonSuperclass(ClassObject* c1, ClassObject* c2)
if (dvmIsInterfaceClass(c1) && dvmImplements(c2, c1)) {
if (gDebugVerbose)
- LOGVV("COMMON/I1: %s + %s --> %s\n",
+ LOGVV("COMMON/I1: %s + %s --> %s",
c1->descriptor, c2->descriptor, c1->descriptor);
return c1;
}
if (dvmIsInterfaceClass(c2) && dvmImplements(c1, c2)) {
if (gDebugVerbose)
- LOGVV("COMMON/I2: %s + %s --> %s\n",
+ LOGVV("COMMON/I2: %s + %s --> %s",
c1->descriptor, c2->descriptor, c2->descriptor);
return c2;
}
@@ -2528,7 +2528,7 @@ static bool updateRegisters(const Method* meth, InsnFlags* insnFlags,
* way a register can transition out of "unknown", so this is not
* just an optimization.)
*/
- LOGVV("COPY into 0x%04x\n", nextInsn);
+ LOGVV("COPY into 0x%04x", nextInsn);
copyLineToTable(regTable, nextInsn, workLine);
dvmInsnSetChanged(insnFlags, nextInsn, true);
#ifdef VERIFIER_STATS
@@ -2536,7 +2536,7 @@ static bool updateRegisters(const Method* meth, InsnFlags* insnFlags,
#endif
} else {
if (gDebugVerbose) {
- LOGVV("MERGE into 0x%04x\n", nextInsn);
+ LOGVV("MERGE into 0x%04x", nextInsn);
//dumpRegTypes(vdata, targetRegs, 0, "targ", NULL, 0);
//dumpRegTypes(vdata, workRegs, 0, "work", NULL, 0);
}
@@ -2564,7 +2564,7 @@ static bool updateRegisters(const Method* meth, InsnFlags* insnFlags,
if (memcmp(targetLine->monitorStack, workLine->monitorStack,
targetLine->monitorStackTop * sizeof(u4)) != 0)
{
- LOG_VFY_METH(meth, "VFY: mismatched monitor stacks at 0x%04x\n",
+ LOG_VFY_METH(meth, "VFY: mismatched monitor stacks at 0x%04x",
nextInsn);
return false;
}
@@ -2581,7 +2581,7 @@ static bool updateRegisters(const Method* meth, InsnFlags* insnFlags,
}
if (gDebugVerbose) {
- //LOGI(" RESULT (changed=%d)\n", changed);
+ //LOGI(" RESULT (changed=%d)", changed);
//dumpRegTypes(vdata, targetRegs, 0, "rslt", NULL, 0);
}
#ifdef VERIFIER_STATS
@@ -2630,7 +2630,7 @@ static InstField* getInstField(const Method* meth,
bool mustBeLocal = false;
if (!regTypeIsReference(objType)) {
- LOG_VFY("VFY: attempt to access field in non-reference type %d\n",
+ LOG_VFY("VFY: attempt to access field in non-reference type %d",
objType);
*pFailure = VERIFY_ERROR_GENERIC;
goto bail;
@@ -2638,7 +2638,7 @@ static InstField* getInstField(const Method* meth,
instField = dvmOptResolveInstField(meth->clazz, fieldIdx, pFailure);
if (instField == NULL) {
- LOG_VFY("VFY: unable to resolve instance field %u\n", fieldIdx);
+ LOG_VFY("VFY: unable to resolve instance field %u", fieldIdx);
assert(!VERIFY_OK(*pFailure));
goto bail;
}
@@ -2655,7 +2655,7 @@ static InstField* getInstField(const Method* meth,
assert(objClass != NULL);
if (regTypeIsUninitReference(objType)) {
if (!isInitMethod(meth) || meth->clazz != objClass) {
- LOG_VFY("VFY: attempt to access field via uninitialized ref\n");
+ LOG_VFY("VFY: attempt to access field via uninitialized ref");
*pFailure = VERIFY_ERROR_GENERIC;
goto bail;
}
@@ -2663,7 +2663,7 @@ static InstField* getInstField(const Method* meth,
}
if (!dvmInstanceof(objClass, instField->clazz)) {
- LOG_VFY("VFY: invalid field access (field %s.%s, through %s ref)\n",
+ LOG_VFY("VFY: invalid field access (field %s.%s, through %s ref)",
instField->clazz->descriptor, instField->name,
objClass->descriptor);
*pFailure = VERIFY_ERROR_NO_FIELD;
@@ -2675,7 +2675,7 @@ static InstField* getInstField(const Method* meth,
if (instField < objClass->ifields ||
instField >= objClass->ifields + objClass->ifieldCount)
{
- LOG_VFY("VFY: invalid constructor field access (field %s in %s)\n",
+ LOG_VFY("VFY: invalid constructor field access (field %s in %s)",
instField->name, objClass->descriptor);
*pFailure = VERIFY_ERROR_GENERIC;
goto bail;
@@ -2704,7 +2704,7 @@ static StaticField* getStaticField(const Method* meth, int fieldIdx,
pFieldId = dexGetFieldId(pDexFile, fieldIdx);
- LOG_VFY("VFY: unable to resolve static field %u (%s) in %s\n", fieldIdx,
+ LOG_VFY("VFY: unable to resolve static field %u (%s) in %s", fieldIdx,
dexStringById(pDexFile, pFieldId->nameIdx),
dexStringByTypeIdx(pDexFile, pFieldId->classIdx));
assert(!VERIFY_OK(*pFailure));
@@ -2729,7 +2729,7 @@ static void checkFinalFieldAccess(const Method* meth, const Field* field,
/* make sure we're in the same class */
if (meth->clazz != field->clazz) {
- LOG_VFY_METH(meth, "VFY: can't modify final field %s.%s\n",
+ LOG_VFY_METH(meth, "VFY: can't modify final field %s.%s",
field->clazz->descriptor, field->name);
*pFailure = VERIFY_ERROR_ACCESS_FIELD;
return;
@@ -2775,7 +2775,7 @@ static void checkArrayIndexType(const Method* meth, RegType regType,
*/
checkTypeCategory(regType, kTypeCategory1nr, pFailure);
if (!VERIFY_OK(*pFailure)) {
- LOG_VFY_METH(meth, "Invalid reg type for array index (%d)\n",
+ LOG_VFY_METH(meth, "Invalid reg type for array index (%d)",
regType);
}
}
@@ -2805,7 +2805,7 @@ static bool checkConstructorReturn(const Method* meth,
for (i = 0; i < insnRegCount; i++) {
if (insnRegs[i] == uninitThis) {
- LOG_VFY("VFY: <init> returning without calling superclass init\n");
+ LOG_VFY("VFY: <init> returning without calling superclass init");
return false;
}
}
@@ -2826,7 +2826,7 @@ static bool checkMoveException(const Method* meth, int insnIdx,
assert(insnIdx >= 0 && insnIdx < (int)dvmGetMethodInsnsSize(meth));
if ((meth->insns[insnIdx] & 0xff) == OP_MOVE_EXCEPTION) {
- LOG_VFY("VFY: invalid use of move-exception\n");
+ LOG_VFY("VFY: invalid use of move-exception");
return false;
}
return true;
@@ -2888,7 +2888,7 @@ static ClassObject* getCaughtExceptionType(const Method* meth, int insnIdx,
&localFailure);
if (clazz == NULL) {
- LOG_VFY("VFY: unable to resolve exception class %u (%s)\n",
+ LOG_VFY("VFY: unable to resolve exception class %u (%s)",
handler->typeIdx,
dexStringByTypeIdx(pDexFile, handler->typeIdx));
/* TODO: do we want to keep going? If we don't fail
@@ -3082,7 +3082,7 @@ static bool initRegisterTable(const VerifierData* vdata,
storage = assignLineStorage(storage, &regTable->savedLine,
trackMonitors, regTypeSize, monEntSize, stackSize);
- //LOGD("Tracking registers for [%d], total %d in %d units\n",
+ //LOGD("Tracking registers for [%d], total %d in %d units",
// trackRegsFor, interestingCount-kExtraLines, insnsSize);
assert(storage - (u1*)regTable->lineAlloc ==
@@ -3130,7 +3130,7 @@ static void verifyFilledNewArrayRegs(const Method* meth,
} else {
expectedType = primitiveTypeToRegType(elemType);
}
- //LOGI("filled-new-array: %s -> %d\n", resClass->descriptor, expectedType);
+ //LOGI("filled-new-array: %s -> %d", resClass->descriptor, expectedType);
/*
* Verify each register. If "argCount" is bad, verifyRegisterType()
@@ -3147,7 +3147,7 @@ static void verifyFilledNewArrayRegs(const Method* meth,
verifyRegisterType(registerLine, getReg, expectedType, pFailure);
if (!VERIFY_OK(*pFailure)) {
- LOG_VFY("VFY: filled-new-array arg %u(%u) not valid\n", ui, getReg);
+ LOG_VFY("VFY: filled-new-array arg %u(%u) not valid", ui, getReg);
return;
}
}
@@ -3288,7 +3288,7 @@ static bool replaceFailingInstruction(const Method* meth, InsnFlags* insnFlags,
default:
/* could handle this in a generic way, but this is probably safer */
- LOG_VFY("GLITCH: verifier asked to replace opcode 0x%02x\n", opcode);
+ LOG_VFY("GLITCH: verifier asked to replace opcode 0x%02x", opcode);
goto bail;
}
@@ -3309,7 +3309,7 @@ static bool replaceFailingInstruction(const Method* meth, InsnFlags* insnFlags,
break;
default:
/* whoops */
- LOGE("ERROR: stomped a %d-unit instruction with a verifier error\n",
+ LOGE("ERROR: stomped a %d-unit instruction with a verifier error",
width);
dvmAbort();
}
@@ -3344,7 +3344,7 @@ void handleMonitorEnter(RegisterLine* workLine, u4 regIdx, u4 insnIdx,
VerifyError* pFailure)
{
if (!regTypeIsReference(getRegisterType(workLine, regIdx))) {
- LOG_VFY("VFY: monitor-enter on non-object\n");
+ LOG_VFY("VFY: monitor-enter on non-object");
*pFailure = VERIFY_ERROR_GENERIC;
return;
}
@@ -3356,7 +3356,7 @@ void handleMonitorEnter(RegisterLine* workLine, u4 regIdx, u4 insnIdx,
}
if (workLine->monitorStackTop == kMaxMonitorStackDepth) {
- LOG_VFY("VFY: monitor-enter stack overflow (%d)\n",
+ LOG_VFY("VFY: monitor-enter stack overflow (%d)",
kMaxMonitorStackDepth);
*pFailure = VERIFY_ERROR_GENERIC;
return;
@@ -3377,7 +3377,7 @@ void handleMonitorExit(RegisterLine* workLine, u4 regIdx, u4 insnIdx,
VerifyError* pFailure)
{
if (!regTypeIsReference(getRegisterType(workLine, regIdx))) {
- LOG_VFY("VFY: monitor-exit on non-object\n");
+ LOG_VFY("VFY: monitor-exit on non-object");
*pFailure = VERIFY_ERROR_GENERIC;
return;
}
@@ -3389,7 +3389,7 @@ void handleMonitorExit(RegisterLine* workLine, u4 regIdx, u4 insnIdx,
}
if (workLine->monitorStackTop == 0) {
- LOG_VFY("VFY: monitor-exit stack underflow\n");
+ LOG_VFY("VFY: monitor-exit stack underflow");
*pFailure = VERIFY_ERROR_GENERIC;
return;
}
@@ -3403,7 +3403,7 @@ void handleMonitorExit(RegisterLine* workLine, u4 regIdx, u4 insnIdx,
if ((workLine->monitorEntries[regIdx] & (1 << workLine->monitorStackTop))
== 0)
{
- LOG_VFY("VFY: monitor-exit bit %d not set: addr=0x%04x (bits[%d]=0x%x)\n",
+ LOG_VFY("VFY: monitor-exit bit %d not set: addr=0x%04x (bits[%d]=0x%x)",
workLine->monitorStackTop, insnIdx, regIdx,
workLine->monitorEntries[regIdx]);
*pFailure = VERIFY_ERROR_GENERIC;
@@ -3612,10 +3612,10 @@ static bool doCodeVerification(VerifierData* vdata, RegisterTable* regTable)
if (dvmWantVerboseVerification(meth)) {
IF_LOGI() {
char* desc = dexProtoCopyMethodDescriptor(&meth->prototype);
- LOGI("Now verifying: %s.%s %s (ins=%d regs=%d)\n",
+ LOGI("Now verifying: %s.%s %s (ins=%d regs=%d)",
meth->clazz->descriptor, meth->name, desc,
meth->insSize, meth->registersSize);
- LOGI(" ------ [0 4 8 12 16 20 24 28 32 36\n");
+ LOGI(" ------ [0 4 8 12 16 20 24 28 32 36");
free(desc);
}
debugVerbose = true;
@@ -3676,7 +3676,7 @@ static bool doCodeVerification(VerifierData* vdata, RegisterTable* regTable)
compareLineToTable(regTable, insnIdx, &regTable->workLine) != 0)
{
char* desc = dexProtoCopyMethodDescriptor(&meth->prototype);
- LOG_VFY("HUH? workLine diverged in %s.%s %s\n",
+ LOG_VFY("HUH? workLine diverged in %s.%s %s",
meth->clazz->descriptor, meth->name, desc);
free(desc);
dumpRegTypes(vdata, registerLine, 0, "work",
@@ -3691,12 +3691,12 @@ static bool doCodeVerification(VerifierData* vdata, RegisterTable* regTable)
NULL, uninitMap, SHOW_REG_DETAILS);
}
- //LOGI("process %s.%s %s %d\n",
+ //LOGI("process %s.%s %s %d",
// meth->clazz->descriptor, meth->name, meth->descriptor, insnIdx);
if (!verifyInstruction(meth, insnFlags, regTable, insnIdx,
uninitMap, &startGuess))
{
- //LOGD("+++ %s bailing at %d\n", meth->name, insnIdx);
+ //LOGD("+++ %s bailing at %d", meth->name, insnIdx);
goto bail;
}
@@ -3743,7 +3743,7 @@ static bool doCodeVerification(VerifierData* vdata, RegisterTable* regTable)
IF_LOGD() {
char* desc =
dexProtoCopyMethodDescriptor(&meth->prototype);
- LOGD("VFY: dead code 0x%04x-%04x in %s.%s %s\n",
+ LOGD("VFY: dead code 0x%04x-%04x in %s.%s %s",
deadStart, insnIdx-1,
meth->clazz->descriptor, meth->name, desc);
free(desc);
@@ -3755,7 +3755,7 @@ static bool doCodeVerification(VerifierData* vdata, RegisterTable* regTable)
if (deadStart >= 0) {
IF_LOGD() {
char* desc = dexProtoCopyMethodDescriptor(&meth->prototype);
- LOGD("VFY: dead code 0x%04x-%04x in %s.%s %s\n",
+ LOGD("VFY: dead code 0x%04x-%04x in %s.%s %s",
deadStart, insnIdx-1,
meth->clazz->descriptor, meth->name, desc);
free(desc);
@@ -3862,7 +3862,7 @@ static bool verifyInstruction(const Method* meth, InsnFlags* insnFlags,
* the course of executing code then we have a problem.
*/
if (decInsn.vA != 0) {
- LOG_VFY("VFY: encountered data table in instruction stream\n");
+ LOG_VFY("VFY: encountered data table in instruction stream");
failure = VERIFY_ERROR_GENERIC;
}
break;
@@ -3930,7 +3930,7 @@ static bool verifyInstruction(const Method* meth, InsnFlags* insnFlags,
if (!checkConstructorReturn(meth, workLine, insnRegCount)) {
failure = VERIFY_ERROR_GENERIC;
} else if (getMethodReturnType(meth) != kRegTypeUnknown) {
- LOG_VFY("VFY: return-void not expected\n");
+ LOG_VFY("VFY: return-void not expected");
failure = VERIFY_ERROR_GENERIC;
}
break;
@@ -3942,13 +3942,13 @@ static bool verifyInstruction(const Method* meth, InsnFlags* insnFlags,
RegType returnType = getMethodReturnType(meth);
checkTypeCategory(returnType, kTypeCategory1nr, &failure);
if (!VERIFY_OK(failure))
- LOG_VFY("VFY: return-1nr not expected\n");
+ LOG_VFY("VFY: return-1nr not expected");
/* check the register contents */
returnType = getRegisterType(workLine, decInsn.vA);
checkTypeCategory(returnType, kTypeCategory1nr, &failure);
if (!VERIFY_OK(failure)) {
- LOG_VFY("VFY: return-1nr on invalid register v%d\n",
+ LOG_VFY("VFY: return-1nr on invalid register v%d",
decInsn.vA);
}
}
@@ -3963,7 +3963,7 @@ static bool verifyInstruction(const Method* meth, InsnFlags* insnFlags,
returnType = getMethodReturnType(meth);
checkTypeCategory(returnType, kTypeCategory2, &failure);
if (!VERIFY_OK(failure))
- LOG_VFY("VFY: return-wide not expected\n");
+ LOG_VFY("VFY: return-wide not expected");
/* check the register contents */
returnType = getRegisterType(workLine, decInsn.vA);
@@ -3971,7 +3971,7 @@ static bool verifyInstruction(const Method* meth, InsnFlags* insnFlags,
checkTypeCategory(returnType, kTypeCategory2, &failure);
checkWidePair(returnType, returnTypeHi, &failure);
if (!VERIFY_OK(failure)) {
- LOG_VFY("VFY: return-wide on invalid register pair v%d\n",
+ LOG_VFY("VFY: return-wide on invalid register pair v%d",
decInsn.vA);
}
}
@@ -3983,7 +3983,7 @@ static bool verifyInstruction(const Method* meth, InsnFlags* insnFlags,
RegType returnType = getMethodReturnType(meth);
checkTypeCategory(returnType, kTypeCategoryRef, &failure);
if (!VERIFY_OK(failure)) {
- LOG_VFY("VFY: return-object not expected\n");
+ LOG_VFY("VFY: return-object not expected");
break;
}
@@ -4011,7 +4011,7 @@ static bool verifyInstruction(const Method* meth, InsnFlags* insnFlags,
if (!dvmIsInterfaceClass(declClass) &&
!dvmInstanceof(resClass, declClass))
{
- LOG_VFY("VFY: returning %s (cl=%p), declared %s (cl=%p)\n",
+ LOG_VFY("VFY: returning %s (cl=%p), declared %s (cl=%p)",
resClass->descriptor, resClass->classLoader,
declClass->descriptor, declClass->classLoader);
failure = VERIFY_ERROR_GENERIC;
@@ -4054,7 +4054,7 @@ static bool verifyInstruction(const Method* meth, InsnFlags* insnFlags,
if (resClass == NULL) {
const char* badClassDesc = dexStringByTypeIdx(pDexFile, decInsn.vB);
dvmLogUnableToResolveClass(badClassDesc, meth);
- LOG_VFY("VFY: unable to resolve const-class %d (%s) in %s\n",
+ LOG_VFY("VFY: unable to resolve const-class %d (%s) in %s",
decInsn.vB, badClassDesc, meth->clazz->descriptor);
assert(failure != VERIFY_ERROR_GENERIC);
} else {
@@ -4106,7 +4106,7 @@ static bool verifyInstruction(const Method* meth, InsnFlags* insnFlags,
if (resClass == NULL) {
const char* badClassDesc = dexStringByTypeIdx(pDexFile, decInsn.vB);
dvmLogUnableToResolveClass(badClassDesc, meth);
- LOG_VFY("VFY: unable to resolve check-cast %d (%s) in %s\n",
+ LOG_VFY("VFY: unable to resolve check-cast %d (%s) in %s",
decInsn.vB, badClassDesc, meth->clazz->descriptor);
assert(failure != VERIFY_ERROR_GENERIC);
} else {
@@ -4114,7 +4114,7 @@ static bool verifyInstruction(const Method* meth, InsnFlags* insnFlags,
origType = getRegisterType(workLine, decInsn.vA);
if (!regTypeIsReference(origType)) {
- LOG_VFY("VFY: check-cast on non-reference in v%u\n",decInsn.vA);
+ LOG_VFY("VFY: check-cast on non-reference in v%u",decInsn.vA);
failure = VERIFY_ERROR_GENERIC;
break;
}
@@ -4126,7 +4126,7 @@ static bool verifyInstruction(const Method* meth, InsnFlags* insnFlags,
/* make sure we're checking a reference type */
tmpType = getRegisterType(workLine, decInsn.vB);
if (!regTypeIsReference(tmpType)) {
- LOG_VFY("VFY: vB not a reference (%d)\n", tmpType);
+ LOG_VFY("VFY: vB not a reference (%d)", tmpType);
failure = VERIFY_ERROR_GENERIC;
break;
}
@@ -4136,7 +4136,7 @@ static bool verifyInstruction(const Method* meth, InsnFlags* insnFlags,
if (resClass == NULL) {
const char* badClassDesc = dexStringByTypeIdx(pDexFile, decInsn.vC);
dvmLogUnableToResolveClass(badClassDesc, meth);
- LOG_VFY("VFY: unable to resolve instanceof %d (%s) in %s\n",
+ LOG_VFY("VFY: unable to resolve instanceof %d (%s) in %s",
decInsn.vC, badClassDesc, meth->clazz->descriptor);
assert(failure != VERIFY_ERROR_GENERIC);
} else {
@@ -4150,7 +4150,7 @@ static bool verifyInstruction(const Method* meth, InsnFlags* insnFlags,
if (!VERIFY_OK(failure))
break;
if (resClass != NULL && !dvmIsArrayClass(resClass)) {
- LOG_VFY("VFY: array-length on non-array\n");
+ LOG_VFY("VFY: array-length on non-array");
failure = VERIFY_ERROR_GENERIC;
break;
}
@@ -4163,7 +4163,7 @@ static bool verifyInstruction(const Method* meth, InsnFlags* insnFlags,
if (resClass == NULL) {
const char* badClassDesc = dexStringByTypeIdx(pDexFile, decInsn.vB);
dvmLogUnableToResolveClass(badClassDesc, meth);
- LOG_VFY("VFY: unable to resolve new-instance %d (%s) in %s\n",
+ LOG_VFY("VFY: unable to resolve new-instance %d (%s) in %s",
decInsn.vB, badClassDesc, meth->clazz->descriptor);
assert(failure != VERIFY_ERROR_GENERIC);
} else {
@@ -4171,7 +4171,7 @@ static bool verifyInstruction(const Method* meth, InsnFlags* insnFlags,
/* can't create an instance of an interface or abstract class */
if (dvmIsAbstractClass(resClass) || dvmIsInterfaceClass(resClass)) {
- LOG_VFY("VFY: new-instance on interface or abstract class %s\n",
+ LOG_VFY("VFY: new-instance on interface or abstract class %s",
resClass->descriptor);
failure = VERIFY_ERROR_INSTANTIATION;
break;
@@ -4199,11 +4199,11 @@ static bool verifyInstruction(const Method* meth, InsnFlags* insnFlags,
if (resClass == NULL) {
const char* badClassDesc = dexStringByTypeIdx(pDexFile, decInsn.vC);
dvmLogUnableToResolveClass(badClassDesc, meth);
- LOG_VFY("VFY: unable to resolve new-array %d (%s) in %s\n",
+ LOG_VFY("VFY: unable to resolve new-array %d (%s) in %s",
decInsn.vC, badClassDesc, meth->clazz->descriptor);
assert(failure != VERIFY_ERROR_GENERIC);
} else if (!dvmIsArrayClass(resClass)) {
- LOG_VFY("VFY: new-array on non-array class\n");
+ LOG_VFY("VFY: new-array on non-array class");
failure = VERIFY_ERROR_GENERIC;
} else {
/* make sure "size" register is valid type */
@@ -4219,11 +4219,11 @@ static bool verifyInstruction(const Method* meth, InsnFlags* insnFlags,
if (resClass == NULL) {
const char* badClassDesc = dexStringByTypeIdx(pDexFile, decInsn.vB);
dvmLogUnableToResolveClass(badClassDesc, meth);
- LOG_VFY("VFY: unable to resolve filled-array %d (%s) in %s\n",
+ LOG_VFY("VFY: unable to resolve filled-array %d (%s) in %s",
decInsn.vB, badClassDesc, meth->clazz->descriptor);
assert(failure != VERIFY_ERROR_GENERIC);
} else if (!dvmIsArrayClass(resClass)) {
- LOG_VFY("VFY: filled-new-array on non-array class\n");
+ LOG_VFY("VFY: filled-new-array on non-array class");
failure = VERIFY_ERROR_GENERIC;
} else {
bool isRange = (decInsn.opcode == OP_FILLED_NEW_ARRAY_RANGE ||
@@ -4261,7 +4261,7 @@ static bool verifyInstruction(const Method* meth, InsnFlags* insnFlags,
resClass = getClassFromRegister(workLine, decInsn.vA, &failure);
if (VERIFY_OK(failure) && resClass != NULL) {
if (!dvmInstanceof(resClass, gDvm.exThrowable)) {
- LOG_VFY("VFY: thrown class %s not instanceof Throwable\n",
+ LOG_VFY("VFY: thrown class %s not instanceof Throwable",
resClass->descriptor);
failure = VERIFY_ERROR_GENERIC;
}
@@ -4299,7 +4299,7 @@ static bool verifyInstruction(const Method* meth, InsnFlags* insnFlags,
resClass->elementClass->primitiveType == PRIM_NOT ||
resClass->elementClass->primitiveType == PRIM_VOID)
{
- LOG_VFY("VFY: invalid fill-array-data on %s\n",
+ LOG_VFY("VFY: invalid fill-array-data on %s",
resClass->descriptor);
failure = VERIFY_ERROR_GENERIC;
break;
@@ -4315,7 +4315,7 @@ static bool verifyInstruction(const Method* meth, InsnFlags* insnFlags,
*/
arrayData = insns + (insns[1] | (((s4)insns[2]) << 16));
if (arrayData[0] != kArrayDataSignature) {
- LOG_VFY("VFY: invalid magic for array-data\n");
+ LOG_VFY("VFY: invalid magic for array-data");
failure = VERIFY_ERROR_GENERIC;
break;
}
@@ -4348,7 +4348,7 @@ static bool verifyInstruction(const Method* meth, InsnFlags* insnFlags,
* class.
*/
if (arrayData[1] != elemWidth) {
- LOG_VFY("VFY: array-data size mismatch (%d vs %d)\n",
+ LOG_VFY("VFY: array-data size mismatch (%d vs %d)",
arrayData[1], elemWidth);
failure = VERIFY_ERROR_GENERIC;
}
@@ -4371,7 +4371,7 @@ static bool verifyInstruction(const Method* meth, InsnFlags* insnFlags,
checkTypeCategory(type1, kTypeCategory1nr, &failure);
checkTypeCategory(type2, kTypeCategory1nr, &failure);
if (!VERIFY_OK(failure)) {
- LOG_VFY("VFY: args to if-eq/if-ne must both be refs or cat1\n");
+ LOG_VFY("VFY: args to if-eq/if-ne must both be refs or cat1");
break;
}
}
@@ -4383,13 +4383,13 @@ static bool verifyInstruction(const Method* meth, InsnFlags* insnFlags,
tmpType = getRegisterType(workLine, decInsn.vA);
checkTypeCategory(tmpType, kTypeCategory1nr, &failure);
if (!VERIFY_OK(failure)) {
- LOG_VFY("VFY: args to 'if' must be cat-1nr\n");
+ LOG_VFY("VFY: args to 'if' must be cat-1nr");
break;
}
tmpType = getRegisterType(workLine, decInsn.vB);
checkTypeCategory(tmpType, kTypeCategory1nr, &failure);
if (!VERIFY_OK(failure)) {
- LOG_VFY("VFY: args to 'if' must be cat-1nr\n");
+ LOG_VFY("VFY: args to 'if' must be cat-1nr");
break;
}
break;
@@ -4400,7 +4400,7 @@ static bool verifyInstruction(const Method* meth, InsnFlags* insnFlags,
break;
checkTypeCategory(tmpType, kTypeCategory1nr, &failure);
if (!VERIFY_OK(failure))
- LOG_VFY("VFY: expected cat-1 arg to if\n");
+ LOG_VFY("VFY: expected cat-1 arg to if");
break;
case OP_IF_LTZ:
case OP_IF_GEZ:
@@ -4409,7 +4409,7 @@ static bool verifyInstruction(const Method* meth, InsnFlags* insnFlags,
tmpType = getRegisterType(workLine, decInsn.vA);
checkTypeCategory(tmpType, kTypeCategory1nr, &failure);
if (!VERIFY_OK(failure))
- LOG_VFY("VFY: expected cat-1 arg to if\n");
+ LOG_VFY("VFY: expected cat-1 arg to if");
break;
case OP_AGET:
@@ -4444,7 +4444,7 @@ aget_1nr_common:
if (!dvmIsArrayClass(resClass) || resClass->arrayDim != 1 ||
resClass->elementClass->primitiveType == PRIM_NOT)
{
- LOG_VFY("VFY: invalid aget-1nr target %s\n",
+ LOG_VFY("VFY: invalid aget-1nr target %s",
resClass->descriptor);
failure = VERIFY_ERROR_GENERIC;
break;
@@ -4484,7 +4484,7 @@ aget_1nr_common:
if (!dvmIsArrayClass(resClass) || resClass->arrayDim != 1 ||
resClass->elementClass->primitiveType == PRIM_NOT)
{
- LOG_VFY("VFY: invalid aget-wide target %s\n",
+ LOG_VFY("VFY: invalid aget-wide target %s",
resClass->descriptor);
failure = VERIFY_ERROR_GENERIC;
break;
@@ -4499,7 +4499,7 @@ aget_1nr_common:
dstType = kRegTypeDoubleLo;
break;
default:
- LOG_VFY("VFY: invalid aget-wide on %s\n",
+ LOG_VFY("VFY: invalid aget-wide on %s",
resClass->descriptor);
dstType = kRegTypeUnknown;
failure = VERIFY_ERROR_GENERIC;
@@ -4536,7 +4536,7 @@ aget_1nr_common:
assert(resClass != NULL);
if (!dvmIsArrayClass(resClass)) {
- LOG_VFY("VFY: aget-object on non-array class\n");
+ LOG_VFY("VFY: aget-object on non-array class");
failure = VERIFY_ERROR_GENERIC;
break;
}
@@ -4555,7 +4555,7 @@ aget_1nr_common:
assert(resClass->arrayDim == 1);
elementClass = resClass->elementClass;
} else {
- LOG_VFY("VFY: aget-object on non-ref array class (%s)\n",
+ LOG_VFY("VFY: aget-object on non-ref array class (%s)",
resClass->descriptor);
failure = VERIFY_ERROR_GENERIC;
break;
@@ -4602,7 +4602,7 @@ aput_1nr_common:
/* make sure the source register has the correct type */
srcType = getRegisterType(workLine, decInsn.vA);
if (!canConvertTo1nr(srcType, tmpType)) {
- LOG_VFY("VFY: invalid reg type %d on aput instr (need %d)\n",
+ LOG_VFY("VFY: invalid reg type %d on aput instr (need %d)",
srcType, tmpType);
failure = VERIFY_ERROR_GENERIC;
break;
@@ -4619,7 +4619,7 @@ aput_1nr_common:
if (!dvmIsArrayClass(resClass) || resClass->arrayDim != 1 ||
resClass->elementClass->primitiveType == PRIM_NOT)
{
- LOG_VFY("VFY: invalid aput-1nr on %s\n", resClass->descriptor);
+ LOG_VFY("VFY: invalid aput-1nr on %s", resClass->descriptor);
failure = VERIFY_ERROR_GENERIC;
break;
}
@@ -4630,7 +4630,7 @@ aput_1nr_common:
assert(dstType != kRegTypeUnknown);
if (!checkFieldArrayStore1nr(tmpType, dstType)) {
- LOG_VFY("VFY: invalid aput-1nr on %s (inst=%d dst=%d)\n",
+ LOG_VFY("VFY: invalid aput-1nr on %s (inst=%d dst=%d)",
resClass->descriptor, tmpType, dstType);
failure = VERIFY_ERROR_GENERIC;
break;
@@ -4660,7 +4660,7 @@ aput_1nr_common:
if (!dvmIsArrayClass(resClass) || resClass->arrayDim != 1 ||
resClass->elementClass->primitiveType == PRIM_NOT)
{
- LOG_VFY("VFY: invalid aput-wide on %s\n",
+ LOG_VFY("VFY: invalid aput-wide on %s",
resClass->descriptor);
failure = VERIFY_ERROR_GENERIC;
break;
@@ -4672,7 +4672,7 @@ aput_1nr_common:
/* these are okay */
break;
default:
- LOG_VFY("VFY: invalid aput-wide on %s\n",
+ LOG_VFY("VFY: invalid aput-wide on %s",
resClass->descriptor);
failure = VERIFY_ERROR_GENERIC;
break;
@@ -4703,7 +4703,7 @@ aput_1nr_common:
if (arrayClass != NULL) {
/* see if the array holds a compatible type */
if (!dvmIsArrayClass(arrayClass)) {
- LOG_VFY("VFY: invalid aput-object on %s\n",
+ LOG_VFY("VFY: invalid aput-object on %s",
arrayClass->descriptor);
failure = VERIFY_ERROR_GENERIC;
break;
@@ -4728,7 +4728,7 @@ aput_1nr_common:
elementClass = arrayClass->elementClass;
}
if (elementClass->primitiveType != PRIM_NOT) {
- LOG_VFY("VFY: invalid aput-object of %s into %s\n",
+ LOG_VFY("VFY: invalid aput-object of %s into %s",
resClass->descriptor, arrayClass->descriptor);
failure = VERIFY_ERROR_GENERIC;
break;
@@ -4773,7 +4773,7 @@ iget_1nr_common:
if (fieldType == kRegTypeUnknown ||
!checkFieldArrayStore1nr(tmpType, fieldType))
{
- LOG_VFY("VFY: invalid iget-1nr of %s.%s (inst=%d field=%d)\n",
+ LOG_VFY("VFY: invalid iget-1nr of %s.%s (inst=%d field=%d)",
instField->clazz->descriptor,
instField->name, tmpType, fieldType);
failure = VERIFY_ERROR_GENERIC;
@@ -4804,7 +4804,7 @@ iget_1nr_common:
dstType = kRegTypeLongLo;
break;
default:
- LOG_VFY("VFY: invalid iget-wide of %s.%s\n",
+ LOG_VFY("VFY: invalid iget-wide of %s.%s",
instField->clazz->descriptor,
instField->name);
dstType = kRegTypeUnknown;
@@ -4831,7 +4831,7 @@ iget_1nr_common:
fieldClass = getFieldClass(meth, instField);
if (fieldClass == NULL) {
/* class not found or primitive type */
- LOG_VFY("VFY: unable to recover field class from '%s'\n",
+ LOG_VFY("VFY: unable to recover field class from '%s'",
instField->signature);
failure = VERIFY_ERROR_GENERIC;
break;
@@ -4879,7 +4879,7 @@ iput_1nr_common:
/* make sure the source register has the correct type */
if (!canConvertTo1nr(srcType, tmpType)) {
- LOG_VFY("VFY: invalid reg type %d on iput instr (need %d)\n",
+ LOG_VFY("VFY: invalid reg type %d on iput instr (need %d)",
srcType, tmpType);
failure = VERIFY_ERROR_GENERIC;
break;
@@ -4899,7 +4899,7 @@ iput_1nr_common:
if (fieldType == kRegTypeUnknown ||
!checkFieldArrayStore1nr(tmpType, fieldType))
{
- LOG_VFY("VFY: invalid iput-1nr of %s.%s (inst=%d field=%d)\n",
+ LOG_VFY("VFY: invalid iput-1nr of %s.%s (inst=%d field=%d)",
instField->clazz->descriptor,
instField->name, tmpType, fieldType);
failure = VERIFY_ERROR_GENERIC;
@@ -4935,7 +4935,7 @@ iput_1nr_common:
/* these are okay (and interchangeable) */
break;
default:
- LOG_VFY("VFY: invalid iput-wide of %s.%s\n",
+ LOG_VFY("VFY: invalid iput-wide of %s.%s",
instField->clazz->descriptor,
instField->name);
failure = VERIFY_ERROR_GENERIC;
@@ -4962,7 +4962,7 @@ iput_1nr_common:
fieldClass = getFieldClass(meth, instField);
if (fieldClass == NULL) {
- LOG_VFY("VFY: unable to recover field class from '%s'\n",
+ LOG_VFY("VFY: unable to recover field class from '%s'",
instField->signature);
failure = VERIFY_ERROR_GENERIC;
break;
@@ -4970,7 +4970,7 @@ iput_1nr_common:
valueType = getRegisterType(workLine, decInsn.vA);
if (!regTypeIsReference(valueType)) {
- LOG_VFY("VFY: storing non-ref v%d into ref field '%s' (%s)\n",
+ LOG_VFY("VFY: storing non-ref v%d into ref field '%s' (%s)",
decInsn.vA, instField->name,
fieldClass->descriptor);
failure = VERIFY_ERROR_GENERIC;
@@ -4979,7 +4979,7 @@ iput_1nr_common:
if (valueType != kRegTypeZero) {
valueClass = regTypeInitializedReferenceToClass(valueType);
if (valueClass == NULL) {
- LOG_VFY("VFY: storing uninit ref v%d into ref field\n",
+ LOG_VFY("VFY: storing uninit ref v%d into ref field",
decInsn.vA);
failure = VERIFY_ERROR_GENERIC;
break;
@@ -4988,7 +4988,7 @@ iput_1nr_common:
if (!dvmIsInterfaceClass(fieldClass) &&
!dvmInstanceof(valueClass, fieldClass))
{
- LOG_VFY("VFY: storing type '%s' into field type '%s' (%s.%s)\n",
+ LOG_VFY("VFY: storing type '%s' into field type '%s' (%s.%s)",
valueClass->descriptor, fieldClass->descriptor,
instField->clazz->descriptor,
instField->name);
@@ -5038,7 +5038,7 @@ sget_1nr_common:
*/
fieldType = primSigCharToRegType(staticField->signature[0]);
if (!checkFieldArrayStore1nr(tmpType, fieldType)) {
- LOG_VFY("VFY: invalid sget-1nr of %s.%s (inst=%d actual=%d)\n",
+ LOG_VFY("VFY: invalid sget-1nr of %s.%s (inst=%d actual=%d)",
staticField->clazz->descriptor,
staticField->name, tmpType, fieldType);
failure = VERIFY_ERROR_GENERIC;
@@ -5066,7 +5066,7 @@ sget_1nr_common:
dstType = kRegTypeLongLo;
break;
default:
- LOG_VFY("VFY: invalid sget-wide of %s.%s\n",
+ LOG_VFY("VFY: invalid sget-wide of %s.%s",
staticField->clazz->descriptor,
staticField->name);
dstType = kRegTypeUnknown;
@@ -5089,13 +5089,13 @@ sget_1nr_common:
break;
fieldClass = getFieldClass(meth, staticField);
if (fieldClass == NULL) {
- LOG_VFY("VFY: unable to recover field class from '%s'\n",
+ LOG_VFY("VFY: unable to recover field class from '%s'",
staticField->signature);
failure = VERIFY_ERROR_GENERIC;
break;
}
if (dvmIsPrimitiveClass(fieldClass)) {
- LOG_VFY("VFY: attempt to get prim field with sget-object\n");
+ LOG_VFY("VFY: attempt to get prim field with sget-object");
failure = VERIFY_ERROR_GENERIC;
break;
}
@@ -5138,7 +5138,7 @@ sput_1nr_common:
/* make sure the source register has the correct type */
if (!canConvertTo1nr(srcType, tmpType)) {
- LOG_VFY("VFY: invalid reg type %d on sput instr (need %d)\n",
+ LOG_VFY("VFY: invalid reg type %d on sput instr (need %d)",
srcType, tmpType);
failure = VERIFY_ERROR_GENERIC;
break;
@@ -5160,7 +5160,7 @@ sput_1nr_common:
*/
fieldType = primSigCharToRegType(staticField->signature[0]);
if (!checkFieldArrayStore1nr(tmpType, fieldType)) {
- LOG_VFY("VFY: invalid sput-1nr of %s.%s (inst=%d actual=%d)\n",
+ LOG_VFY("VFY: invalid sput-1nr of %s.%s (inst=%d actual=%d)",
staticField->clazz->descriptor,
staticField->name, tmpType, fieldType);
failure = VERIFY_ERROR_GENERIC;
@@ -5193,7 +5193,7 @@ sput_1nr_common:
/* these are okay */
break;
default:
- LOG_VFY("VFY: invalid sput-wide of %s.%s\n",
+ LOG_VFY("VFY: invalid sput-wide of %s.%s",
staticField->clazz->descriptor,
staticField->name);
failure = VERIFY_ERROR_GENERIC;
@@ -5218,7 +5218,7 @@ sput_1nr_common:
fieldClass = getFieldClass(meth, staticField);
if (fieldClass == NULL) {
- LOG_VFY("VFY: unable to recover field class from '%s'\n",
+ LOG_VFY("VFY: unable to recover field class from '%s'",
staticField->signature);
failure = VERIFY_ERROR_GENERIC;
break;
@@ -5226,7 +5226,7 @@ sput_1nr_common:
valueType = getRegisterType(workLine, decInsn.vA);
if (!regTypeIsReference(valueType)) {
- LOG_VFY("VFY: storing non-ref v%d into ref field '%s' (%s)\n",
+ LOG_VFY("VFY: storing non-ref v%d into ref field '%s' (%s)",
decInsn.vA, staticField->name,
fieldClass->descriptor);
failure = VERIFY_ERROR_GENERIC;
@@ -5235,7 +5235,7 @@ sput_1nr_common:
if (valueType != kRegTypeZero) {
valueClass = regTypeInitializedReferenceToClass(valueType);
if (valueClass == NULL) {
- LOG_VFY("VFY: storing uninit ref v%d into ref field\n",
+ LOG_VFY("VFY: storing uninit ref v%d into ref field",
decInsn.vA);
failure = VERIFY_ERROR_GENERIC;
break;
@@ -5244,7 +5244,7 @@ sput_1nr_common:
if (!dvmIsInterfaceClass(fieldClass) &&
!dvmInstanceof(valueClass, fieldClass))
{
- LOG_VFY("VFY: storing type '%s' into field type '%s' (%s.%s)\n",
+ LOG_VFY("VFY: storing type '%s' into field type '%s' (%s.%s)",
valueClass->descriptor, fieldClass->descriptor,
staticField->clazz->descriptor,
staticField->name);
@@ -5318,7 +5318,7 @@ sput_1nr_common:
/* no null refs allowed (?) */
if (thisType == kRegTypeZero) {
- LOG_VFY("VFY: unable to initialize null ref\n");
+ LOG_VFY("VFY: unable to initialize null ref");
failure = VERIFY_ERROR_GENERIC;
break;
}
@@ -5345,7 +5345,7 @@ sput_1nr_common:
/* arg must be an uninitialized reference */
if (!regTypeIsUninitReference(thisType)) {
- LOG_VFY("VFY: can only initialize the uninitialized\n");
+ LOG_VFY("VFY: can only initialize the uninitialized");
failure = VERIFY_ERROR_GENERIC;
break;
}
@@ -5420,7 +5420,7 @@ sput_1nr_common:
thisClass = regTypeInitializedReferenceToClass(thisType);
if (thisClass == NULL) {
- LOG_VFY("VFY: interface call on uninitialized\n");
+ LOG_VFY("VFY: interface call on uninitialized");
failure = VERIFY_ERROR_GENERIC;
break;
}
@@ -5435,7 +5435,7 @@ sput_1nr_common:
thisClass != gDvm.classJavaLangObject &&
!dvmImplements(thisClass, absMethod->clazz))
{
- LOG_VFY("VFY: unable to match absMethod '%s' with %s interfaces\n",
+ LOG_VFY("VFY: unable to match absMethod '%s' with %s interfaces",
absMethod->name, thisClass->descriptor);
failure = VERIFY_ERROR_GENERIC;
break;
@@ -5999,15 +5999,15 @@ sput_1nr_common:
if (!VERIFY_OK(failure)) {
if (failure == VERIFY_ERROR_GENERIC || gDvm.optimizing) {
/* immediate failure, reject class */
- LOG_VFY_METH(meth, "VFY: rejecting opcode 0x%02x at 0x%04x\n",
+ LOG_VFY_METH(meth, "VFY: rejecting opcode 0x%02x at 0x%04x",
decInsn.opcode, insnIdx);
goto bail;
} else {
/* replace opcode and continue on */
- LOGD("VFY: replacing opcode 0x%02x at 0x%04x\n",
+ LOGD("VFY: replacing opcode 0x%02x at 0x%04x",
decInsn.opcode, insnIdx);
if (!replaceFailingInstruction(meth, insnFlags, insnIdx, failure)) {
- LOG_VFY_METH(meth, "VFY: rejecting opcode 0x%02x at 0x%04x\n",
+ LOG_VFY_METH(meth, "VFY: rejecting opcode 0x%02x at 0x%04x",
decInsn.opcode, insnIdx);
goto bail;
}
@@ -6088,7 +6088,7 @@ sput_1nr_common:
&isConditional))
{
/* should never happen after static verification */
- LOG_VFY_METH(meth, "VFY: bad branch at %d\n", insnIdx);
+ LOG_VFY_METH(meth, "VFY: bad branch at %d", insnIdx);
goto bail;
}
assert(isConditional || (nextFlags & kInstrCanContinue) == 0);
@@ -6205,7 +6205,7 @@ sput_1nr_common:
* is empty.
*/
if ((nextFlags & kInstrCanReturn) != 0 && workLine->monitorStackTop != 0) {
- LOG_VFY_METH(meth, "VFY: return with stack depth=%d at 0x%04x\n",
+ LOG_VFY_METH(meth, "VFY: return with stack depth=%d at 0x%04x",
workLine->monitorStackTop, insnIdx);
goto bail;
}
@@ -6245,7 +6245,7 @@ static void logLocalsCb(void *cnxt, u2 reg, u4 startAddress, u4 endAddress,
if (addr >= (int) startAddress && addr < (int) endAddress)
{
- LOGI(" %2d: '%s' %s\n", reg, name, descriptor);
+ LOGI(" %2d: '%s' %s", reg, name, descriptor);
}
}
@@ -6316,10 +6316,10 @@ static void dumpRegTypes(const VerifierData* vdata,
}
if (addr == 0 && addrName != NULL) {
- LOGI("%c%s %s mst=%d\n", branchTarget ? '>' : ' ',
+ LOGI("%c%s %s mst=%d", branchTarget ? '>' : ' ',
addrName, regChars, registerLine->monitorStackTop);
} else {
- LOGI("%c0x%04x %s mst=%d\n", branchTarget ? '>' : ' ',
+ LOGI("%c0x%04x %s mst=%d", branchTarget ? '>' : ' ',
addr, regChars, registerLine->monitorStackTop);
}
if (displayFlags & DRT_SHOW_LIVENESS) {
@@ -6337,9 +6337,9 @@ static void dumpRegTypes(const VerifierData* vdata,
bool isLive = dvmIsBitSet(liveRegs, i);
liveChars[i + 1 + (i / 4)] = isLive ? '+' : '-';
}
- LOGI(" %s\n", liveChars);
+ LOGI(" %s", liveChars);
} else {
- LOGI(" %c\n", '#');
+ LOGI(" %c", '#');
}
}
@@ -6352,12 +6352,12 @@ static void dumpRegTypes(const VerifierData* vdata,
clazz = regTypeReferenceToClass(addrRegs[i], uninitMap);
assert(dvmIsValidObject((Object*)clazz));
if (i < regCount) {
- LOGI(" %2d: 0x%08x %s%s\n",
+ LOGI(" %2d: 0x%08x %s%s",
i, addrRegs[i],
regTypeIsUninitReference(addrRegs[i]) ? "[U]" : "",
clazz->descriptor);
} else {
- LOGI(" RS: 0x%08x %s%s\n",
+ LOGI(" RS: 0x%08x %s%s",
addrRegs[i],
regTypeIsUninitReference(addrRegs[i]) ? "[U]" : "",
clazz->descriptor);
diff --git a/vm/analysis/DexPrepare.cpp b/vm/analysis/DexPrepare.cpp
index 4337ffad9..1a817f575 100644
--- a/vm/analysis/DexPrepare.cpp
+++ b/vm/analysis/DexPrepare.cpp
@@ -98,7 +98,7 @@ retry:
fd = open(cacheFileName, O_RDONLY, 0);
if (fd < 0) {
if (createIfMissing) {
- LOGE("Can't open dex cache '%s': %s\n",
+ LOGE("Can't open dex cache '%s': %s",
cacheFileName, strerror(errno));
}
return fd;
@@ -113,21 +113,21 @@ retry:
* working on it, we'll block here until they complete. Because
* we're waiting on an external resource, we go into VMWAIT mode.
*/
- LOGV("DexOpt: locking cache file %s (fd=%d, boot=%d)\n",
+ LOGV("DexOpt: locking cache file %s (fd=%d, boot=%d)",
cacheFileName, fd, isBootstrap);
ThreadStatus oldStatus = dvmChangeStatus(NULL, THREAD_VMWAIT);
cc = flock(fd, LOCK_EX | LOCK_NB);
if (cc != 0) {
- LOGD("DexOpt: sleeping on flock(%s)\n", cacheFileName);
+ LOGD("DexOpt: sleeping on flock(%s)", cacheFileName);
cc = flock(fd, LOCK_EX);
}
dvmChangeStatus(NULL, oldStatus);
if (cc != 0) {
- LOGE("Can't lock dex cache '%s': %d\n", cacheFileName, cc);
+ LOGE("Can't lock dex cache '%s': %d", cacheFileName, cc);
close(fd);
return -1;
}
- LOGV("DexOpt: locked cache file\n");
+ LOGV("DexOpt: locked cache file");
/*
* Check to see if the fd we opened and locked matches the file in
@@ -138,16 +138,16 @@ retry:
*/
cc = fstat(fd, &fdStat);
if (cc != 0) {
- LOGE("Can't stat open file '%s'\n", cacheFileName);
- LOGVV("DexOpt: unlocking cache file %s\n", cacheFileName);
+ LOGE("Can't stat open file '%s'", cacheFileName);
+ LOGVV("DexOpt: unlocking cache file %s", cacheFileName);
goto close_fail;
}
cc = stat(cacheFileName, &fileStat);
if (cc != 0 ||
fdStat.st_dev != fileStat.st_dev || fdStat.st_ino != fileStat.st_ino)
{
- LOGD("DexOpt: our open cache file is stale; sleeping and retrying\n");
- LOGVV("DexOpt: unlocking cache file %s\n", cacheFileName);
+ LOGD("DexOpt: our open cache file is stale; sleeping and retrying");
+ LOGVV("DexOpt: unlocking cache file %s", cacheFileName);
flock(fd, LOCK_UN);
close(fd);
usleep(250 * 1000); /* if something is hosed, don't peg machine */
@@ -163,14 +163,14 @@ retry:
*/
if (fdStat.st_size == 0) {
if (readOnly) {
- LOGW("DexOpt: file has zero length and isn't writable\n");
+ LOGW("DexOpt: file has zero length and isn't writable");
goto close_fail;
}
cc = dexOptCreateEmptyHeader(fd);
if (cc != 0)
goto close_fail;
*pNewFile = true;
- LOGV("DexOpt: successfully initialized new cache file\n");
+ LOGV("DexOpt: successfully initialized new cache file");
} else {
bool expectVerify, expectOpt;
@@ -191,7 +191,7 @@ retry:
expectOpt = true;
}
- LOGV("checking deps, expecting vfy=%d opt=%d\n",
+ LOGV("checking deps, expecting vfy=%d opt=%d",
expectVerify, expectOpt);
if (!dvmCheckOptHeaderAndDependencies(fd, true, modWhen, crc,
@@ -205,7 +205,7 @@ retry:
* give up now.
*/
if (createIfMissing) {
- LOGW("Cached DEX '%s' (%s) is stale and not writable\n",
+ LOGW("Cached DEX '%s' (%s) is stale and not writable",
fileName, cacheFileName);
}
goto close_fail;
@@ -232,24 +232,24 @@ retry:
* changes doing anything" purposes its best if we just make
* everything crash when a DEX they're using gets updated.
*/
- LOGD("ODEX file is stale or bad; removing and retrying (%s)\n",
+ LOGD("ODEX file is stale or bad; removing and retrying (%s)",
cacheFileName);
if (ftruncate(fd, 0) != 0) {
- LOGW("Warning: unable to truncate cache file '%s': %s\n",
+ LOGW("Warning: unable to truncate cache file '%s': %s",
cacheFileName, strerror(errno));
/* keep going */
}
if (unlink(cacheFileName) != 0) {
- LOGW("Warning: unable to remove cache file '%s': %d %s\n",
+ LOGW("Warning: unable to remove cache file '%s': %d %s",
cacheFileName, errno, strerror(errno));
/* keep going; permission failure should probably be fatal */
}
- LOGVV("DexOpt: unlocking cache file %s\n", cacheFileName);
+ LOGVV("DexOpt: unlocking cache file %s", cacheFileName);
flock(fd, LOCK_UN);
close(fd);
goto retry;
} else {
- LOGV("DexOpt: good deps in cache file\n");
+ LOGV("DexOpt: good deps in cache file");
}
}
@@ -269,7 +269,7 @@ close_fail:
*/
bool dvmUnlockCachedDexFile(int fd)
{
- LOGVV("DexOpt: unlocking cache file fd=%d\n", fd);
+ LOGVV("DexOpt: unlocking cache file fd=%d", fd);
return (flock(fd, LOCK_UN) == 0);
}
@@ -307,7 +307,7 @@ bool dvmOptimizeDexFile(int fd, off_t dexOffset, long dexLength,
else
lastPart = fileName;
- LOGD("DexOpt: --- BEGIN '%s' (bootstrap=%d) ---\n", lastPart, isBootstrap);
+ LOGD("DexOpt: --- BEGIN '%s' (bootstrap=%d) ---", lastPart, isBootstrap);
pid_t pid;
@@ -316,7 +316,7 @@ bool dvmOptimizeDexFile(int fd, off_t dexOffset, long dexLength,
* was all optimized, got rejected.
*/
if (gDvm.optimizing) {
- LOGW("Rejecting recursive optimization attempt on '%s'\n", fileName);
+ LOGW("Rejecting recursive optimization attempt on '%s'", fileName);
return false;
}
@@ -343,7 +343,7 @@ bool dvmOptimizeDexFile(int fd, off_t dexOffset, long dexLength,
/* full path to optimizer */
androidRoot = getenv("ANDROID_ROOT");
if (androidRoot == NULL) {
- LOGW("ANDROID_ROOT not set, defaulting to /system\n");
+ LOGW("ANDROID_ROOT not set, defaulting to /system");
androidRoot = "/system";
}
execFile = (char*)malloc(strlen(androidRoot) + strlen(kDexOptBin) + 1);
@@ -422,11 +422,11 @@ bool dvmOptimizeDexFile(int fd, off_t dexOffset, long dexLength,
else
execv(execFile, const_cast<char**>(argv));
- LOGE("execv '%s'%s failed: %s\n", execFile,
+ LOGE("execv '%s'%s failed: %s", execFile,
kUseValgrind ? " [valgrind]" : "", strerror(errno));
exit(1);
} else {
- LOGV("DexOpt: waiting for verify+opt, pid=%d\n", (int) pid);
+ LOGV("DexOpt: waiting for verify+opt, pid=%d", (int) pid);
int status;
pid_t gotPid;
@@ -438,23 +438,23 @@ bool dvmOptimizeDexFile(int fd, off_t dexOffset, long dexLength,
while (true) {
gotPid = waitpid(pid, &status, 0);
if (gotPid == -1 && errno == EINTR) {
- LOGD("waitpid interrupted, retrying\n");
+ LOGD("waitpid interrupted, retrying");
} else {
break;
}
}
dvmChangeStatus(NULL, oldStatus);
if (gotPid != pid) {
- LOGE("waitpid failed: wanted %d, got %d: %s\n",
+ LOGE("waitpid failed: wanted %d, got %d: %s",
(int) pid, (int) gotPid, strerror(errno));
return false;
}
if (WIFEXITED(status) && WEXITSTATUS(status) == 0) {
- LOGD("DexOpt: --- END '%s' (success) ---\n", lastPart);
+ LOGD("DexOpt: --- END '%s' (success) ---", lastPart);
return true;
} else {
- LOGW("DexOpt: --- END '%s' --- status=0x%04x, process failed\n",
+ LOGW("DexOpt: --- END '%s' --- status=0x%04x, process failed",
lastPart, status);
return false;
}
@@ -482,17 +482,17 @@ bool dvmContinueOptimization(int fd, off_t dexOffset, long dexLength,
assert(gDvm.optimizing);
- LOGV("Continuing optimization (%s, isb=%d)\n", fileName, isBootstrap);
+ LOGV("Continuing optimization (%s, isb=%d)", fileName, isBootstrap);
assert(dexOffset >= 0);
/* quick test so we don't blow up on empty file */
if (dexLength < (int) sizeof(DexHeader)) {
- LOGE("too small to be DEX\n");
+ LOGE("too small to be DEX");
return false;
}
if (dexOffset < (int) sizeof(DexOptHeader)) {
- LOGE("not enough room for opt header\n");
+ LOGE("not enough room for opt header");
return false;
}
@@ -516,7 +516,7 @@ bool dvmContinueOptimization(int fd, off_t dexOffset, long dexLength,
mapAddr = mmap(NULL, dexOffset + dexLength, PROT_READ|PROT_WRITE,
MAP_SHARED, fd, 0);
if (mapAddr == MAP_FAILED) {
- LOGE("unable to mmap DEX cache: %s\n", strerror(errno));
+ LOGE("unable to mmap DEX cache: %s", strerror(errno));
goto bail;
}
@@ -557,7 +557,7 @@ bool dvmContinueOptimization(int fd, off_t dexOffset, long dexLength,
u1* dexAddr = ((u1*) mapAddr) + dexOffset;
if (dvmDexFileOpenPartial(dexAddr, dexLength, &pDvmDex) != 0) {
- LOGE("Unable to create DexFile\n");
+ LOGE("Unable to create DexFile");
success = false;
} else {
/*
@@ -568,7 +568,7 @@ bool dvmContinueOptimization(int fd, off_t dexOffset, long dexLength,
if (gDvm.generateRegisterMaps) {
pRegMapBuilder = dvmGenerateRegisterMaps(pDvmDex);
if (pRegMapBuilder == NULL) {
- LOGE("Failed generating register maps\n");
+ LOGE("Failed generating register maps");
success = false;
}
}
@@ -582,7 +582,7 @@ bool dvmContinueOptimization(int fd, off_t dexOffset, long dexLength,
/* unmap the read-write version, forcing writes to disk */
if (msync(mapAddr, dexOffset + dexLength, MS_SYNC) != 0) {
- LOGW("msync failed: %s\n", strerror(errno));
+ LOGW("msync failed: %s", strerror(errno));
// weird, but keep going
}
#if 1
@@ -593,7 +593,7 @@ bool dvmContinueOptimization(int fd, off_t dexOffset, long dexLength,
* Exclude this code when doing clean shutdown for valgrind.
*/
if (munmap(mapAddr, dexOffset + dexLength) != 0) {
- LOGE("munmap failed: %s\n", strerror(errno));
+ LOGE("munmap failed: %s", strerror(errno));
goto bail;
}
#endif
@@ -609,12 +609,12 @@ bool dvmContinueOptimization(int fd, off_t dexOffset, long dexLength,
depsOffset = lseek(fd, 0, SEEK_END);
if (depsOffset < 0) {
- LOGE("lseek to EOF failed: %s\n", strerror(errno));
+ LOGE("lseek to EOF failed: %s", strerror(errno));
goto bail;
}
adjOffset = (depsOffset + 7) & ~(0x07);
if (adjOffset != depsOffset) {
- LOGV("Adjusting deps start from %d to %d\n",
+ LOGV("Adjusting deps start from %d to %d",
(int) depsOffset, (int) adjOffset);
depsOffset = adjOffset;
lseek(fd, depsOffset, SEEK_SET);
@@ -624,7 +624,7 @@ bool dvmContinueOptimization(int fd, off_t dexOffset, long dexLength,
* Append the dependency list.
*/
if (writeDependencies(fd, modWhen, crc) != 0) {
- LOGW("Failed writing dependencies\n");
+ LOGW("Failed writing dependencies");
goto bail;
}
@@ -634,7 +634,7 @@ bool dvmContinueOptimization(int fd, off_t dexOffset, long dexLength,
adjOffset = (optOffset + 7) & ~(0x07);
if (adjOffset != optOffset) {
- LOGV("Adjusting opt start from %d to %d\n",
+ LOGV("Adjusting opt start from %d to %d",
(int) optOffset, (int) adjOffset);
optOffset = adjOffset;
lseek(fd, optOffset, SEEK_SET);
@@ -644,7 +644,7 @@ bool dvmContinueOptimization(int fd, off_t dexOffset, long dexLength,
* Append any optimized pre-computed data structures.
*/
if (!writeOptData(fd, pClassLookup, pRegMapBuilder)) {
- LOGW("Failed writing opt data\n");
+ LOGW("Failed writing opt data");
goto bail;
}
@@ -685,7 +685,7 @@ bool dvmContinueOptimization(int fd, off_t dexOffset, long dexLength,
if (sysWriteFully(fd, &optHdr, sizeof(optHdr), "DexOpt opt header") != 0)
goto bail;
- LOGV("Successfully wrote DEX header\n");
+ LOGV("Successfully wrote DEX header");
result = true;
//dvmRegisterMapDumpStats();
@@ -759,7 +759,7 @@ static bool rewriteDex(u1* addr, int len, bool doVerify, bool doOpt,
* for it.
*/
if (dvmDexFileOpenPartial(addr, len, &pDvmDex) != 0) {
- LOGE("Unable to create DexFile\n");
+ LOGE("Unable to create DexFile");
goto bail;
}
@@ -820,7 +820,7 @@ static bool rewriteDex(u1* addr, int len, bool doVerify, bool doOpt,
msgStr = "verify";
else if (doOpt)
msgStr = "opt";
- LOGD("DexOpt: load %dms, %s %dms\n",
+ LOGD("DexOpt: load %dms, %s %dms",
(int) (loadWhen - prepWhen) / 1000,
msgStr,
(int) (verifyOptWhen - loadWhen) / 1000);
@@ -873,7 +873,7 @@ static bool loadAllClasses(DvmDex* pDvmDex)
u4 idx;
int loaded = 0;
- LOGV("DexOpt: +++ trying to load %d classes\n", count);
+ LOGV("DexOpt: +++ trying to load %d classes", count);
dvmSetBootPathExtraDex(pDvmDex);
@@ -900,7 +900,7 @@ static bool loadAllClasses(DvmDex* pDvmDex)
* list, but it costs very little to do it in all cases.)
*/
if (!dvmInitClass(gDvm.classJavaLangClass)) {
- LOGE("ERROR: failed to initialize the class Class!\n");
+ LOGE("ERROR: failed to initialize the class Class!");
return false;
}
@@ -918,7 +918,7 @@ static bool loadAllClasses(DvmDex* pDvmDex)
// NULL);
newClass = dvmFindSystemClassNoInit(classDescriptor);
if (newClass == NULL) {
- LOGV("DexOpt: failed loading '%s'\n", classDescriptor);
+ LOGV("DexOpt: failed loading '%s'", classDescriptor);
dvmClearOptException(dvmThreadSelf());
} else if (newClass->pDvmDex != pDvmDex) {
/*
@@ -926,14 +926,14 @@ static bool loadAllClasses(DvmDex* pDvmDex)
* with the "multiple def" flag so the resolver doesn't try
* to make it available.
*/
- LOGD("DexOpt: '%s' has an earlier definition; blocking out\n",
+ LOGD("DexOpt: '%s' has an earlier definition; blocking out",
classDescriptor);
SET_CLASS_FLAG(newClass, CLASS_MULTIPLE_DEFS);
} else {
loaded++;
}
}
- LOGV("DexOpt: +++ successfully loaded %d classes\n", loaded);
+ LOGV("DexOpt: +++ successfully loaded %d classes", loaded);
dvmSetBootPathExtraDex(NULL);
return true;
@@ -964,22 +964,22 @@ static void verifyAndOptimizeClasses(DexFile* pDexFile, bool doVerify,
} else {
// TODO: log when in verbose mode
- LOGV("DexOpt: not optimizing unavailable class '%s'\n",
+ LOGV("DexOpt: not optimizing unavailable class '%s'",
classDescriptor);
}
}
#ifdef VERIFIER_STATS
- LOGI("Verifier stats:\n");
- LOGI(" methods examined : %u\n", gDvm.verifierStats.methodsExamined);
- LOGI(" monitor-enter methods : %u\n", gDvm.verifierStats.monEnterMethods);
- LOGI(" instructions examined : %u\n", gDvm.verifierStats.instrsExamined);
- LOGI(" instructions re-examined: %u\n", gDvm.verifierStats.instrsReexamined);
- LOGI(" copying of register sets: %u\n", gDvm.verifierStats.copyRegCount);
- LOGI(" merging of register sets: %u\n", gDvm.verifierStats.mergeRegCount);
- LOGI(" ...that caused changes : %u\n", gDvm.verifierStats.mergeRegChanged);
- LOGI(" uninit searches : %u\n", gDvm.verifierStats.uninitSearches);
- LOGI(" max memory required : %u\n", gDvm.verifierStats.biggestAlloc);
+ LOGI("Verifier stats:");
+ LOGI(" methods examined : %u", gDvm.verifierStats.methodsExamined);
+ LOGI(" monitor-enter methods : %u", gDvm.verifierStats.monEnterMethods);
+ LOGI(" instructions examined : %u", gDvm.verifierStats.instrsExamined);
+ LOGI(" instructions re-examined: %u", gDvm.verifierStats.instrsReexamined);
+ LOGI(" copying of register sets: %u", gDvm.verifierStats.copyRegCount);
+ LOGI(" merging of register sets: %u", gDvm.verifierStats.mergeRegCount);
+ LOGI(" ...that caused changes : %u", gDvm.verifierStats.mergeRegChanged);
+ LOGI(" uninit searches : %u", gDvm.verifierStats.uninitSearches);
+ LOGI(" max memory required : %u", gDvm.verifierStats.biggestAlloc);
#endif
}
@@ -1000,7 +1000,7 @@ static void verifyAndOptimizeClass(DexFile* pDexFile, ClassObject* clazz,
* (a) not the one we want to examine, and (b) mapped read-only,
* so we will seg fault if we try to rewrite instructions inside it.
*/
- LOGD("DexOpt: not verifying/optimizing '%s': multiple definitions\n",
+ LOGD("DexOpt: not verifying/optimizing '%s': multiple definitions",
clazz->descriptor);
return;
}
@@ -1023,7 +1023,7 @@ static void verifyAndOptimizeClass(DexFile* pDexFile, ClassObject* clazz,
verified = true;
} else {
// TODO: log when in verbose mode
- LOGV("DexOpt: '%s' failed verification\n", classDescriptor);
+ LOGV("DexOpt: '%s' failed verification", classDescriptor);
}
}
@@ -1031,7 +1031,7 @@ static void verifyAndOptimizeClass(DexFile* pDexFile, ClassObject* clazz,
bool needVerify = (gDvm.dexOptMode == OPTIMIZE_MODE_VERIFIED ||
gDvm.dexOptMode == OPTIMIZE_MODE_FULL);
if (!verified && needVerify) {
- LOGV("DexOpt: not optimizing '%s': not verified\n",
+ LOGV("DexOpt: not optimizing '%s': not verified",
classDescriptor);
} else {
dvmOptimizeClass(clazz, false);
@@ -1054,7 +1054,7 @@ static const char* getCacheFileName(const ClassPathEntry* cpe)
case kCpeDex:
return dvmGetRawDexFileCacheFileName((RawDexFile*) cpe->ptr);
default:
- LOGE("DexOpt: unexpected cpe kind %d\n", cpe->kind);
+ LOGE("DexOpt: unexpected cpe kind %d", cpe->kind);
dvmAbort();
return NULL;
}
@@ -1075,7 +1075,7 @@ static const u1* getSignature(const ClassPathEntry* cpe)
pDvmDex = dvmGetRawDexFileDex((RawDexFile*) cpe->ptr);
break;
default:
- LOGE("unexpected cpe kind %d\n", cpe->kind);
+ LOGE("unexpected cpe kind %d", cpe->kind);
dvmAbort();
pDvmDex = NULL; // make gcc happy
}
@@ -1128,7 +1128,7 @@ bool dvmCheckOptHeaderAndDependencies(int fd, bool sourceAvail, u4 modWhen,
* the first thing in the file.
*/
if (lseek(fd, 0, SEEK_SET) != 0) {
- LOGE("DexOpt: failed to seek to start of file: %s\n", strerror(errno));
+ LOGE("DexOpt: failed to seek to start of file: %s", strerror(errno));
goto bail;
}
@@ -1138,10 +1138,10 @@ bool dvmCheckOptHeaderAndDependencies(int fd, bool sourceAvail, u4 modWhen,
*/
actual = read(fd, &optHdr, sizeof(optHdr));
if (actual < 0) {
- LOGE("DexOpt: failed reading opt header: %s\n", strerror(errno));
+ LOGE("DexOpt: failed reading opt header: %s", strerror(errno));
goto bail;
} else if (actual != sizeof(optHdr)) {
- LOGE("DexOpt: failed reading opt header (got %d of %zd)\n",
+ LOGE("DexOpt: failed reading opt header (got %d of %zd)",
(int) actual, sizeof(optHdr));
goto bail;
}
@@ -1149,21 +1149,21 @@ bool dvmCheckOptHeaderAndDependencies(int fd, bool sourceAvail, u4 modWhen,
magic = optHdr.magic;
if (memcmp(magic, DEX_MAGIC, 4) == 0) {
/* somebody probably pointed us at the wrong file */
- LOGD("DexOpt: expected optimized DEX, found unoptimized\n");
+ LOGD("DexOpt: expected optimized DEX, found unoptimized");
goto bail;
} else if (memcmp(magic, DEX_OPT_MAGIC, 4) != 0) {
/* not a DEX file, or previous attempt was interrupted */
- LOGD("DexOpt: incorrect opt magic number (0x%02x %02x %02x %02x)\n",
+ LOGD("DexOpt: incorrect opt magic number (0x%02x %02x %02x %02x)",
magic[0], magic[1], magic[2], magic[3]);
goto bail;
}
if (memcmp(magic+4, DEX_OPT_MAGIC_VERS, 4) != 0) {
- LOGW("DexOpt: stale opt version (0x%02x %02x %02x %02x)\n",
+ LOGW("DexOpt: stale opt version (0x%02x %02x %02x %02x)",
magic[4], magic[5], magic[6], magic[7]);
goto bail;
}
if (optHdr.depsLength < kMinDepSize || optHdr.depsLength > kMaxDepSize) {
- LOGW("DexOpt: weird deps length %d, bailing\n", optHdr.depsLength);
+ LOGW("DexOpt: weird deps length %d, bailing", optHdr.depsLength);
goto bail;
}
@@ -1179,7 +1179,7 @@ bool dvmCheckOptHeaderAndDependencies(int fd, bool sourceAvail, u4 modWhen,
expectedFlags |= DEX_OPT_FLAG_BIG;
#endif
if ((expectedFlags & matchMask) != (optHdr.flags & matchMask)) {
- LOGI("DexOpt: header flag mismatch (0x%02x vs 0x%02x, mask=0x%02x)\n",
+ LOGI("DexOpt: header flag mismatch (0x%02x vs 0x%02x, mask=0x%02x)",
expectedFlags, optHdr.flags, matchMask);
goto bail;
}
@@ -1187,7 +1187,7 @@ bool dvmCheckOptHeaderAndDependencies(int fd, bool sourceAvail, u4 modWhen,
posn = lseek(fd, optHdr.depsOffset, SEEK_SET);
if (posn < 0) {
- LOGW("DexOpt: seek to deps failed: %s\n", strerror(errno));
+ LOGW("DexOpt: seek to deps failed: %s", strerror(errno));
goto bail;
}
@@ -1196,16 +1196,16 @@ bool dvmCheckOptHeaderAndDependencies(int fd, bool sourceAvail, u4 modWhen,
*/
depData = (u1*) malloc(optHdr.depsLength);
if (depData == NULL) {
- LOGW("DexOpt: unable to allocate %d bytes for deps\n",
+ LOGW("DexOpt: unable to allocate %d bytes for deps",
optHdr.depsLength);
goto bail;
}
actual = read(fd, depData, optHdr.depsLength);
if (actual < 0) {
- LOGW("DexOpt: failed reading deps: %s\n", strerror(errno));
+ LOGW("DexOpt: failed reading deps: %s", strerror(errno));
goto bail;
} else if (actual != (ssize_t) optHdr.depsLength) {
- LOGW("DexOpt: failed reading deps: got %d of %d\n",
+ LOGW("DexOpt: failed reading deps: got %d of %d",
(int) actual, optHdr.depsLength);
goto bail;
}
@@ -1219,18 +1219,18 @@ bool dvmCheckOptHeaderAndDependencies(int fd, bool sourceAvail, u4 modWhen,
ptr = depData;
val = read4LE(&ptr);
if (sourceAvail && val != modWhen) {
- LOGI("DexOpt: source file mod time mismatch (%08x vs %08x)\n",
+ LOGI("DexOpt: source file mod time mismatch (%08x vs %08x)",
val, modWhen);
goto bail;
}
val = read4LE(&ptr);
if (sourceAvail && val != crc) {
- LOGI("DexOpt: source file CRC mismatch (%08x vs %08x)\n", val, crc);
+ LOGI("DexOpt: source file CRC mismatch (%08x vs %08x)", val, crc);
goto bail;
}
val = read4LE(&ptr);
if (val != DALVIK_VM_BUILD) {
- LOGD("DexOpt: VM build version mismatch (%d vs %d)\n",
+ LOGD("DexOpt: VM build version mismatch (%d vs %d)",
val, DALVIK_VM_BUILD);
goto bail;
}
@@ -1243,7 +1243,7 @@ bool dvmCheckOptHeaderAndDependencies(int fd, bool sourceAvail, u4 modWhen,
u4 numDeps;
numDeps = read4LE(&ptr);
- LOGV("+++ DexOpt: numDeps = %d\n", numDeps);
+ LOGV("+++ DexOpt: numDeps = %d", numDeps);
for (cpe = gDvm.bootClassPath; cpe->ptr != NULL; cpe++) {
const char* cacheFileName =
dvmPathToAbsolutePortion(getCacheFileName(cpe));
@@ -1255,7 +1255,7 @@ bool dvmCheckOptHeaderAndDependencies(int fd, bool sourceAvail, u4 modWhen,
if (numDeps == 0) {
/* more entries in bootclasspath than in deps list */
- LOGI("DexOpt: not all deps represented\n");
+ LOGI("DexOpt: not all deps represented");
goto bail;
}
@@ -1263,7 +1263,7 @@ bool dvmCheckOptHeaderAndDependencies(int fd, bool sourceAvail, u4 modWhen,
if (len != storedStrLen ||
strcmp(cacheFileName, (const char*) ptr) != 0)
{
- LOGI("DexOpt: mismatch dep name: '%s' vs. '%s'\n",
+ LOGI("DexOpt: mismatch dep name: '%s' vs. '%s'",
cacheFileName, ptr);
goto bail;
}
@@ -1271,25 +1271,25 @@ bool dvmCheckOptHeaderAndDependencies(int fd, bool sourceAvail, u4 modWhen,
ptr += storedStrLen;
if (memcmp(signature, ptr, kSHA1DigestLen) != 0) {
- LOGI("DexOpt: mismatch dep signature for '%s'\n", cacheFileName);
+ LOGI("DexOpt: mismatch dep signature for '%s'", cacheFileName);
goto bail;
}
ptr += kSHA1DigestLen;
- LOGV("DexOpt: dep match on '%s'\n", cacheFileName);
+ LOGV("DexOpt: dep match on '%s'", cacheFileName);
numDeps--;
}
if (numDeps != 0) {
/* more entries in deps list than in classpath */
- LOGI("DexOpt: Some deps went away\n");
+ LOGI("DexOpt: Some deps went away");
goto bail;
}
// consumed all data and no more?
if (ptr != depData + optHdr.depsLength) {
- LOGW("DexOpt: Spurious dep data? %d vs %d\n",
+ LOGW("DexOpt: Spurious dep data? %d vs %d",
(int) (ptr - depData), optHdr.depsLength);
assert(false);
}
@@ -1322,7 +1322,7 @@ static int writeDependencies(int fd, u4 modWhen, u4 crc)
dvmPathToAbsolutePortion(getCacheFileName(cpe));
assert(cacheFileName != NULL); /* guaranteed by Class.c */
- LOGV("+++ DexOpt: found dep '%s'\n", cacheFileName);
+ LOGV("+++ DexOpt: found dep '%s'", cacheFileName);
numDeps++;
bufLen += strlen(cacheFileName) +1;
@@ -1351,7 +1351,7 @@ static int writeDependencies(int fd, u4 modWhen, u4 crc)
int len = strlen(cacheFileName) +1;
if (ptr + 4 + len + kSHA1DigestLen > buf + bufLen) {
- LOGE("DexOpt: overran buffer\n");
+ LOGE("DexOpt: overran buffer");
dvmAbort();
}
@@ -1390,7 +1390,7 @@ static bool writeChunk(int fd, u4 type, const void* data, size_t size)
assert(sizeof(header) == 8);
- LOGV("Writing chunk, type=%.4s size=%d\n", (char*) &type, size);
+ LOGV("Writing chunk, type=%.4s size=%d", (char*) &type, size);
header.ts.type = type;
header.ts.size = (u4) size;
@@ -1408,7 +1408,7 @@ static bool writeChunk(int fd, u4 type, const void* data, size_t size)
/* if necessary, pad to 64-bit alignment */
if ((size & 7) != 0) {
int padSize = 8 - (size & 7);
- LOGV("size was %d, inserting %d pad bytes\n", size, padSize);
+ LOGV("size was %d, inserting %d pad bytes", size, padSize);
lseek(fd, padSize, SEEK_CUR);
}
@@ -1466,7 +1466,7 @@ static bool computeFileChecksum(int fd, off_t start, size_t length, u4* pSum)
uLong adler;
if (lseek(fd, start, SEEK_SET) != start) {
- LOGE("Unable to seek to start of checksum area (%ld): %s\n",
+ LOGE("Unable to seek to start of checksum area (%ld): %s",
(long) start, strerror(errno));
return false;
}
@@ -1477,7 +1477,7 @@ static bool computeFileChecksum(int fd, off_t start, size_t length, u4* pSum)
size_t wanted = (length < sizeof(readBuf)) ? length : sizeof(readBuf);
actual = read(fd, readBuf, wanted);
if (actual <= 0) {
- LOGE("Read failed (%d) while computing checksum (len=%zu): %s\n",
+ LOGE("Read failed (%d) while computing checksum (len=%zu): %s",
(int) actual, length, strerror(errno));
return false;
}
diff --git a/vm/analysis/DexVerify.cpp b/vm/analysis/DexVerify.cpp
index 19513cbc1..f7217e692 100644
--- a/vm/analysis/DexVerify.cpp
+++ b/vm/analysis/DexVerify.cpp
@@ -42,19 +42,19 @@ bool dvmVerifyClass(ClassObject* clazz)
int i;
if (dvmIsClassVerified(clazz)) {
- LOGD("Ignoring duplicate verify attempt on %s\n", clazz->descriptor);
+ LOGD("Ignoring duplicate verify attempt on %s", clazz->descriptor);
return true;
}
for (i = 0; i < clazz->directMethodCount; i++) {
if (!verifyMethod(&clazz->directMethods[i])) {
- LOG_VFY("Verifier rejected class %s\n", clazz->descriptor);
+ LOG_VFY("Verifier rejected class %s", clazz->descriptor);
return false;
}
}
for (i = 0; i < clazz->virtualMethodCount; i++) {
if (!verifyMethod(&clazz->virtualMethods[i])) {
- LOG_VFY("Verifier rejected class %s\n", clazz->descriptor);
+ LOG_VFY("Verifier rejected class %s", clazz->descriptor);
return false;
}
}
@@ -94,7 +94,7 @@ static bool computeWidthsAndCountOps(VerifierData* vdata)
for (i = 0; i < (int) insnCount; /**/) {
size_t width = dexGetWidthFromInstruction(insns);
if (width == 0) {
- LOG_VFY_METH(meth, "VFY: invalid instruction (0x%04x)\n", *insns);
+ LOG_VFY_METH(meth, "VFY: invalid instruction (0x%04x)", *insns);
goto bail;
} else if (width > 65535) {
LOG_VFY_METH(meth,
@@ -112,7 +112,7 @@ static bool computeWidthsAndCountOps(VerifierData* vdata)
insns += width;
}
if (i != (int) vdata->insnsSize) {
- LOG_VFY_METH(meth, "VFY: code did not end where expected (%d vs. %d)\n",
+ LOG_VFY_METH(meth, "VFY: code did not end where expected (%d vs. %d)",
i, dvmGetMethodInsnsSize(meth));
goto bail;
}
@@ -273,7 +273,7 @@ static bool verifyMethod(Method* meth)
* sure that ins <= registers.
*/
if (meth->insSize > meth->registersSize) {
- LOG_VFY_METH(meth, "VFY: bad register counts (ins=%d regs=%d)\n",
+ LOG_VFY_METH(meth, "VFY: bad register counts (ins=%d regs=%d)",
meth->insSize, meth->registersSize);
goto bail;
}
@@ -324,7 +324,7 @@ static bool verifyMethod(Method* meth)
* that's so rare that there's little point in checking.
*/
if (!dvmVerifyCodeFlow(&vdata)) {
- //LOGD("+++ %s failed code flow\n", meth->name);
+ //LOGD("+++ %s failed code flow", meth->name);
goto bail;
}
@@ -369,7 +369,7 @@ static bool checkArrayData(const Method* meth, u4 curOffset)
/* make sure the table is 32-bit aligned */
if ((((u4) arrayData) & 0x03) != 0) {
- LOG_VFY("VFY: unaligned array data table: at %d, data offset %d\n",
+ LOG_VFY("VFY: unaligned array data table: at %d, data offset %d",
curOffset, offsetToArrayData);
return false;
}
@@ -402,14 +402,14 @@ static bool checkNewInstance(const DvmDex* pDvmDex, u4 idx)
const char* classDescriptor;
if (idx >= pDvmDex->pHeader->typeIdsSize) {
- LOG_VFY("VFY: bad type index %d (max %d)\n",
+ LOG_VFY("VFY: bad type index %d (max %d)",
idx, pDvmDex->pHeader->typeIdsSize);
return false;
}
classDescriptor = dexStringByTypeIdx(pDvmDex->pDexFile, idx);
if (classDescriptor[0] != 'L') {
- LOG_VFY("VFY: can't call new-instance on type '%s'\n",
+ LOG_VFY("VFY: can't call new-instance on type '%s'",
classDescriptor);
return false;
}
@@ -427,7 +427,7 @@ static bool checkNewArray(const DvmDex* pDvmDex, u4 idx)
const char* classDescriptor;
if (idx >= pDvmDex->pHeader->typeIdsSize) {
- LOG_VFY("VFY: bad type index %d (max %d)\n",
+ LOG_VFY("VFY: bad type index %d (max %d)",
idx, pDvmDex->pHeader->typeIdsSize);
return false;
}
@@ -441,12 +441,12 @@ static bool checkNewArray(const DvmDex* pDvmDex, u4 idx)
if (bracketCount == 0) {
/* The given class must be an array type. */
- LOG_VFY("VFY: can't new-array class '%s' (not an array)\n",
+ LOG_VFY("VFY: can't new-array class '%s' (not an array)",
classDescriptor);
return false;
} else if (bracketCount > 255) {
/* It is illegal to create an array of more than 255 dimensions. */
- LOG_VFY("VFY: can't new-array class '%s' (exceeds limit)\n",
+ LOG_VFY("VFY: can't new-array class '%s' (exceeds limit)",
classDescriptor);
return false;
}
@@ -461,7 +461,7 @@ static bool checkNewArray(const DvmDex* pDvmDex, u4 idx)
static bool checkTypeIndex(const DvmDex* pDvmDex, u4 idx)
{
if (idx >= pDvmDex->pHeader->typeIdsSize) {
- LOG_VFY("VFY: bad type index %d (max %d)\n",
+ LOG_VFY("VFY: bad type index %d (max %d)",
idx, pDvmDex->pHeader->typeIdsSize);
return false;
}
@@ -475,7 +475,7 @@ static bool checkTypeIndex(const DvmDex* pDvmDex, u4 idx)
static bool checkFieldIndex(const DvmDex* pDvmDex, u4 idx)
{
if (idx >= pDvmDex->pHeader->fieldIdsSize) {
- LOG_VFY("VFY: bad field index %d (max %d)\n",
+ LOG_VFY("VFY: bad field index %d (max %d)",
idx, pDvmDex->pHeader->fieldIdsSize);
return false;
}
@@ -489,7 +489,7 @@ static bool checkFieldIndex(const DvmDex* pDvmDex, u4 idx)
static bool checkMethodIndex(const DvmDex* pDvmDex, u4 idx)
{
if (idx >= pDvmDex->pHeader->methodIdsSize) {
- LOG_VFY("VFY: bad method index %d (max %d)\n",
+ LOG_VFY("VFY: bad method index %d (max %d)",
idx, pDvmDex->pHeader->methodIdsSize);
return false;
}
@@ -502,7 +502,7 @@ static bool checkMethodIndex(const DvmDex* pDvmDex, u4 idx)
static bool checkStringIndex(const DvmDex* pDvmDex, u4 idx)
{
if (idx >= pDvmDex->pHeader->stringIdsSize) {
- LOG_VFY("VFY: bad string index %d (max %d)\n",
+ LOG_VFY("VFY: bad string index %d (max %d)",
idx, pDvmDex->pHeader->stringIdsSize);
return false;
}
@@ -515,7 +515,7 @@ static bool checkStringIndex(const DvmDex* pDvmDex, u4 idx)
static bool checkRegisterIndex(const Method* meth, u4 idx)
{
if (idx >= meth->registersSize) {
- LOG_VFY("VFY: register index out of range (%d >= %d)\n",
+ LOG_VFY("VFY: register index out of range (%d >= %d)",
idx, meth->registersSize);
return false;
}
@@ -528,7 +528,7 @@ static bool checkRegisterIndex(const Method* meth, u4 idx)
static bool checkWideRegisterIndex(const Method* meth, u4 idx)
{
if (idx+1 >= meth->registersSize) {
- LOG_VFY("VFY: wide register index out of range (%d+1 >= %d)\n",
+ LOG_VFY("VFY: wide register index out of range (%d+1 >= %d)",
idx, meth->registersSize);
return false;
}
@@ -553,14 +553,14 @@ static bool checkVarargRegs(const Method* meth,
unsigned int idx;
if (pDecInsn->vA > 5) {
- LOG_VFY("VFY: invalid arg count (%d) in non-range invoke)\n",
+ LOG_VFY("VFY: invalid arg count (%d) in non-range invoke)",
pDecInsn->vA);
return false;
}
for (idx = 0; idx < pDecInsn->vA; idx++) {
if (pDecInsn->arg[idx] > registersSize) {
- LOG_VFY("VFY: invalid reg index (%d) in non-range invoke (> %d)\n",
+ LOG_VFY("VFY: invalid reg index (%d) in non-range invoke (> %d)",
pDecInsn->arg[idx], registersSize);
return false;
}
@@ -585,7 +585,7 @@ static bool checkVarargRangeRegs(const Method* meth,
* so there's no risk of integer overflow when adding them here.
*/
if (pDecInsn->vA + pDecInsn->vC > registersSize) {
- LOG_VFY("VFY: invalid reg index %d+%d in range invoke (> %d)\n",
+ LOG_VFY("VFY: invalid reg index %d+%d in range invoke (> %d)",
pDecInsn->vA, pDecInsn->vC, registersSize);
return false;
}
@@ -629,7 +629,7 @@ static bool checkSwitchTargets(const Method* meth, InsnFlags* insnFlags,
/* make sure the table is 32-bit aligned */
if ((((u4) switchInsns) & 0x03) != 0) {
- LOG_VFY("VFY: unaligned switch table: at %d, switch offset %d\n",
+ LOG_VFY("VFY: unaligned switch table: at %d, switch offset %d",
curOffset, offsetToSwitch);
return false;
}
@@ -650,7 +650,7 @@ static bool checkSwitchTargets(const Method* meth, InsnFlags* insnFlags,
tableSize = offsetToTargets + switchCount*2;
if (switchInsns[0] != expectedSignature) {
- LOG_VFY("VFY: wrong signature for switch table (0x%04x, wanted 0x%04x)\n",
+ LOG_VFY("VFY: wrong signature for switch table (0x%04x, wanted 0x%04x)",
switchInsns[0], expectedSignature);
return false;
}
@@ -674,7 +674,7 @@ static bool checkSwitchTargets(const Method* meth, InsnFlags* insnFlags,
s4 key = (s4) switchInsns[offsetToKeys + targ*2] |
(s4) (switchInsns[offsetToKeys + targ*2 +1] << 16);
if (key <= lastKey) {
- LOG_VFY("VFY: invalid packed switch: last key=%d, this=%d\n",
+ LOG_VFY("VFY: invalid packed switch: last key=%d, this=%d",
lastKey, key);
return false;
}
@@ -692,7 +692,7 @@ static bool checkSwitchTargets(const Method* meth, InsnFlags* insnFlags,
if (absOffset < 0 || absOffset >= (s4)insnCount ||
!dvmInsnIsOpcode(insnFlags, absOffset))
{
- LOG_VFY("VFY: invalid switch target %d (-> 0x%x) at 0x%x[%d]\n",
+ LOG_VFY("VFY: invalid switch target %d (-> 0x%x) at 0x%x[%d]",
offset, absOffset, curOffset, targ);
return false;
}
@@ -726,7 +726,7 @@ static bool checkBranchTarget(const Method* meth, InsnFlags* insnFlags,
return false;
if (!selfOkay && offset == 0) {
- LOG_VFY_METH(meth, "VFY: branch offset of zero not allowed at 0x%x\n",
+ LOG_VFY_METH(meth, "VFY: branch offset of zero not allowed at 0x%x",
curOffset);
return false;
}
@@ -737,7 +737,7 @@ static bool checkBranchTarget(const Method* meth, InsnFlags* insnFlags,
* it's unwise to depend on that.
*/
if (((s8) curOffset + (s8) offset) != (s8)(curOffset + offset)) {
- LOG_VFY_METH(meth, "VFY: branch target overflow 0x%x +%d\n",
+ LOG_VFY_METH(meth, "VFY: branch target overflow 0x%x +%d",
curOffset, offset);
return false;
}
@@ -1435,7 +1435,7 @@ static bool verifyInstructions(VerifierData* vdata)
case OP_UNUSED_EFFF:
case OP_UNUSED_F0FF:
case OP_UNUSED_F1FF:
- LOGE("VFY: unexpected opcode %04x\n", decInsn.opcode);
+ LOGE("VFY: unexpected opcode %04x", decInsn.opcode);
okay = false;
break;
@@ -1446,7 +1446,7 @@ static bool verifyInstructions(VerifierData* vdata)
}
if (!okay) {
- LOG_VFY_METH(meth, "VFY: rejecting opcode 0x%02x at 0x%04x\n",
+ LOG_VFY_METH(meth, "VFY: rejecting opcode 0x%02x at 0x%04x",
decInsn.opcode, codeOffset);
return false;
}
diff --git a/vm/analysis/Liveness.cpp b/vm/analysis/Liveness.cpp
index f659e8919..8099685c8 100644
--- a/vm/analysis/Liveness.cpp
+++ b/vm/analysis/Liveness.cpp
@@ -68,7 +68,7 @@ bool dvmComputeLiveness(VerifierData* vdata)
bool verbose = false; //= dvmWantVerboseVerification(vdata->method);
if (verbose) {
const Method* meth = vdata->method;
- LOGI("Computing liveness for %s.%s:%s\n",
+ LOGI("Computing liveness for %s.%s:%s",
meth->clazz->descriptor, meth->name, meth->shorty);
}
@@ -147,7 +147,7 @@ bool dvmComputeLiveness(VerifierData* vdata)
assert(workBlock->liveRegs != NULL);
dvmCopyBitVector(workBits, workBlock->liveRegs);
if (verbose) {
- LOGI("Loaded work bits from last=0x%04x\n", workBlock->lastAddr);
+ LOGI("Loaded work bits from last=0x%04x", workBlock->lastAddr);
dumpLiveState(vdata, 0xfffd, workBlock->liveRegs);
dumpLiveState(vdata, 0xffff, workBits);
}
@@ -215,7 +215,7 @@ bool dvmComputeLiveness(VerifierData* vdata)
pred->changed = dvmCheckMergeBitVectors(pred->liveRegs, workBits);
if (verbose) {
- LOGI("merging cur=%04x into pred last=%04x (ch=%d)\n",
+ LOGI("merging cur=%04x into pred last=%04x (ch=%d)",
curIdx, pred->lastAddr, pred->changed);
dumpLiveState(vdata, 0xfffa, pred->liveRegs);
dumpLiveState(vdata, 0xfffb, workBits);
@@ -997,7 +997,7 @@ static void markLocalsCb(void* ctxt, u2 reg, u4 startAddress, u4 endAddress,
bool verbose = dvmWantVerboseVerification(vdata->method);
if (verbose) {
- LOGI("%04x-%04x %2d (%s %s)\n",
+ LOGI("%04x-%04x %2d (%s %s)",
startAddress, endAddress, reg, name, descriptor);
}
@@ -1075,5 +1075,5 @@ static void dumpLiveState(const VerifierData* vdata, u4 curIdx,
regChars[1 + idx + (idx/4)] = ch;
}
- LOGI("0x%04x %s\n", curIdx, regChars);
+ LOGI("0x%04x %s", curIdx, regChars);
}
diff --git a/vm/analysis/Optimize.cpp b/vm/analysis/Optimize.cpp
index 907818776..e773e6080 100644
--- a/vm/analysis/Optimize.cpp
+++ b/vm/analysis/Optimize.cpp
@@ -85,7 +85,7 @@ bool dvmCreateInlineSubsTable()
* Not expected. We only use this for key methods in core
* classes, so we should always be able to find them.
*/
- LOGE("Unable to find method for inlining: %s.%s:%s\n",
+ LOGE("Unable to find method for inlining: %s.%s:%s",
ops[i].classDescriptor, ops[i].methodName,
ops[i].methodSignature);
return false;
@@ -532,7 +532,7 @@ ClassObject* dvmOptResolveClass(ClassObject* referrer, u4 classIdx,
}
if (resClass == NULL) {
/* not found, exception should be raised */
- LOGV("DexOpt: class %d (%s) not found\n",
+ LOGV("DexOpt: class %d (%s) not found",
classIdx,
dexStringByTypeIdx(pDvmDex->pDexFile, classIdx));
if (pFailure != NULL) {
@@ -564,7 +564,7 @@ ClassObject* dvmOptResolveClass(ClassObject* referrer, u4 classIdx,
/* multiple definitions? */
if (IS_CLASS_FLAG_SET(resClass, CLASS_MULTIPLE_DEFS)) {
- LOGI("DexOpt: not resolving ambiguous class '%s'\n",
+ LOGI("DexOpt: not resolving ambiguous class '%s'",
resClass->descriptor);
if (pFailure != NULL)
*pFailure = VERIFY_ERROR_NO_CLASS;
@@ -576,7 +576,7 @@ ClassObject* dvmOptResolveClass(ClassObject* referrer, u4 classIdx,
bool allowed = dvmCheckClassAccess(referrer, resClass);
untweakLoader(referrer, resClass);
if (!allowed) {
- LOGW("DexOpt: resolve class illegal access: %s -> %s\n",
+ LOGW("DexOpt: resolve class illegal access: %s -> %s",
referrer->descriptor, resClass->descriptor);
if (pFailure != NULL)
*pFailure = VERIFY_ERROR_ACCESS_CLASS;
@@ -619,7 +619,7 @@ InstField* dvmOptResolveInstField(ClassObject* referrer, u4 ifieldIdx,
dexStringById(pDvmDex->pDexFile, pFieldId->nameIdx),
dexStringByTypeIdx(pDvmDex->pDexFile, pFieldId->typeIdx));
if (resField == NULL) {
- LOGD("DexOpt: couldn't find field %s.%s\n",
+ LOGD("DexOpt: couldn't find field %s.%s",
resClass->descriptor,
dexStringById(pDvmDex->pDexFile, pFieldId->nameIdx));
if (pFailure != NULL)
@@ -627,7 +627,7 @@ InstField* dvmOptResolveInstField(ClassObject* referrer, u4 ifieldIdx,
return NULL;
}
if (dvmIsStaticField(resField)) {
- LOGD("DexOpt: wanted instance, got static for field %s.%s\n",
+ LOGD("DexOpt: wanted instance, got static for field %s.%s",
resClass->descriptor,
dexStringById(pDvmDex->pDexFile, pFieldId->nameIdx));
if (pFailure != NULL)
@@ -646,7 +646,7 @@ InstField* dvmOptResolveInstField(ClassObject* referrer, u4 ifieldIdx,
bool allowed = dvmCheckFieldAccess(referrer, (Field*)resField);
untweakLoader(referrer, resField->clazz);
if (!allowed) {
- LOGI("DexOpt: access denied from %s to field %s.%s\n",
+ LOGI("DexOpt: access denied from %s to field %s.%s",
referrer->descriptor, resField->clazz->descriptor,
resField->name);
if (pFailure != NULL)
@@ -694,14 +694,14 @@ StaticField* dvmOptResolveStaticField(ClassObject* referrer, u4 sfieldIdx,
resField = (StaticField*)dvmFindFieldHier(resClass, fieldName,
dexStringByTypeIdx(pDvmDex->pDexFile, pFieldId->typeIdx));
if (resField == NULL) {
- LOGD("DexOpt: couldn't find static field %s.%s\n",
+ LOGD("DexOpt: couldn't find static field %s.%s",
resClass->descriptor, fieldName);
if (pFailure != NULL)
*pFailure = VERIFY_ERROR_NO_FIELD;
return NULL;
}
if (!dvmIsStaticField(resField)) {
- LOGD("DexOpt: wanted static, got instance for field %s.%s\n",
+ LOGD("DexOpt: wanted static, got instance for field %s.%s",
resClass->descriptor, fieldName);
if (pFailure != NULL)
*pFailure = VERIFY_ERROR_CLASS_CHANGE;
@@ -724,7 +724,7 @@ StaticField* dvmOptResolveStaticField(ClassObject* referrer, u4 sfieldIdx,
bool allowed = dvmCheckFieldAccess(referrer, (Field*)resField);
untweakLoader(referrer, resField->clazz);
if (!allowed) {
- LOGI("DexOpt: access denied from %s to field %s.%s\n",
+ LOGI("DexOpt: access denied from %s to field %s.%s",
referrer->descriptor, resField->clazz->descriptor,
resField->name);
if (pFailure != NULL)
@@ -770,16 +770,16 @@ static void rewriteInstField(Method* method, u2* insns, Opcode quickOpc,
if (volatileOpc != OP_NOP && dvmIsVolatileField(instField)) {
updateOpcode(method, insns, volatileOpc);
- LOGV("DexOpt: rewrote ifield access %s.%s --> volatile\n",
+ LOGV("DexOpt: rewrote ifield access %s.%s --> volatile",
instField->clazz->descriptor, instField->name);
} else if (quickOpc != OP_NOP && instField->byteOffset < 65536) {
updateOpcode(method, insns, quickOpc);
dvmUpdateCodeUnit(method, insns+1, (u2) instField->byteOffset);
- LOGV("DexOpt: rewrote ifield access %s.%s --> %d\n",
+ LOGV("DexOpt: rewrote ifield access %s.%s --> %d",
instField->clazz->descriptor, instField->name,
instField->byteOffset);
} else {
- LOGV("DexOpt: no rewrite of ifield access %s.%s\n",
+ LOGV("DexOpt: no rewrite of ifield access %s.%s",
instField->clazz->descriptor, instField->name);
}
@@ -811,10 +811,10 @@ static void rewriteJumboInstField(Method* method, u2* insns, Opcode volatileOpc)
if (dvmIsVolatileField(instField)) {
updateOpcode(method, insns, volatileOpc);
- LOGV("DexOpt: rewrote jumbo ifield access %s.%s --> volatile\n",
+ LOGV("DexOpt: rewrote jumbo ifield access %s.%s --> volatile",
instField->clazz->descriptor, instField->name);
} else {
- LOGV("DexOpt: no rewrite of jumbo ifield access %s.%s\n",
+ LOGV("DexOpt: no rewrite of jumbo ifield access %s.%s",
instField->clazz->descriptor, instField->name);
}
}
@@ -844,7 +844,7 @@ static void rewriteStaticField0(Method* method, u2* insns, Opcode volatileOpc,
if (dvmIsVolatileField(staticField)) {
updateOpcode(method, insns, volatileOpc);
- LOGV("DexOpt: rewrote sfield access %s.%s --> volatile\n",
+ LOGV("DexOpt: rewrote sfield access %s.%s --> volatile",
staticField->clazz->descriptor, staticField->name);
}
}
@@ -879,7 +879,7 @@ Method* dvmOptResolveMethod(ClassObject* referrer, u4 methodIdx,
methodType == METHOD_VIRTUAL ||
methodType == METHOD_STATIC);
- LOGVV("--- resolving method %u (referrer=%s)\n", methodIdx,
+ LOGVV("--- resolving method %u (referrer=%s)", methodIdx,
referrer->descriptor);
resMethod = dvmDexGetResolvedMethod(pDvmDex, methodIdx);
@@ -895,14 +895,14 @@ Method* dvmOptResolveMethod(ClassObject* referrer, u4 methodIdx,
* Can't find the class that the method is a part of, or don't
* have permission to access the class.
*/
- LOGV("DexOpt: can't find called method's class (?.%s)\n",
+ LOGV("DexOpt: can't find called method's class (?.%s)",
dexStringById(pDvmDex->pDexFile, pMethodId->nameIdx));
if (pFailure != NULL) { assert(!VERIFY_OK(*pFailure)); }
return NULL;
}
if (dvmIsInterfaceClass(resClass)) {
/* method is part of an interface; this is wrong method for that */
- LOGW("DexOpt: method is in an interface\n");
+ LOGW("DexOpt: method is in an interface");
if (pFailure != NULL)
*pFailure = VERIFY_ERROR_GENERIC;
return NULL;
@@ -926,7 +926,7 @@ Method* dvmOptResolveMethod(ClassObject* referrer, u4 methodIdx,
}
if (resMethod == NULL) {
- LOGV("DexOpt: couldn't find method '%s'\n",
+ LOGV("DexOpt: couldn't find method '%s'",
dexStringById(pDvmDex->pDexFile, pMethodId->nameIdx));
if (pFailure != NULL)
*pFailure = VERIFY_ERROR_NO_METHOD;
@@ -934,7 +934,7 @@ Method* dvmOptResolveMethod(ClassObject* referrer, u4 methodIdx,
}
if (methodType == METHOD_STATIC) {
if (!dvmIsStaticMethod(resMethod)) {
- LOGD("DexOpt: wanted static, got instance for method %s.%s\n",
+ LOGD("DexOpt: wanted static, got instance for method %s.%s",
resClass->descriptor, resMethod->name);
if (pFailure != NULL)
*pFailure = VERIFY_ERROR_CLASS_CHANGE;
@@ -942,7 +942,7 @@ Method* dvmOptResolveMethod(ClassObject* referrer, u4 methodIdx,
}
} else if (methodType == METHOD_VIRTUAL) {
if (dvmIsStaticMethod(resMethod)) {
- LOGD("DexOpt: wanted instance, got static for method %s.%s\n",
+ LOGD("DexOpt: wanted instance, got static for method %s.%s",
resClass->descriptor, resMethod->name);
if (pFailure != NULL)
*pFailure = VERIFY_ERROR_CLASS_CHANGE;
@@ -952,7 +952,7 @@ Method* dvmOptResolveMethod(ClassObject* referrer, u4 methodIdx,
/* see if this is a pure-abstract method */
if (dvmIsAbstractMethod(resMethod) && !dvmIsAbstractClass(resClass)) {
- LOGW("DexOpt: pure-abstract method '%s' in %s\n",
+ LOGW("DexOpt: pure-abstract method '%s' in %s",
dexStringById(pDvmDex->pDexFile, pMethodId->nameIdx),
resClass->descriptor);
if (pFailure != NULL)
@@ -972,7 +972,7 @@ Method* dvmOptResolveMethod(ClassObject* referrer, u4 methodIdx,
dvmDexSetResolvedMethod(pDvmDex, methodIdx, resMethod);
}
- LOGVV("--- found method %d (%s.%s)\n",
+ LOGVV("--- found method %d (%s.%s)",
methodIdx, resMethod->clazz->descriptor, resMethod->name);
/* access allowed? */
@@ -982,7 +982,7 @@ Method* dvmOptResolveMethod(ClassObject* referrer, u4 methodIdx,
if (!allowed) {
IF_LOGI() {
char* desc = dexProtoCopyMethodDescriptor(&resMethod->prototype);
- LOGI("DexOpt: illegal method access (call %s.%s %s from %s)\n",
+ LOGI("DexOpt: illegal method access (call %s.%s %s from %s)",
resMethod->clazz->descriptor, resMethod->name, desc,
referrer->descriptor);
free(desc);
@@ -1011,7 +1011,7 @@ static void rewriteVirtualInvoke(Method* method, u2* insns, Opcode newOpc)
baseMethod = dvmOptResolveMethod(clazz, methodIdx, METHOD_VIRTUAL, NULL);
if (baseMethod == NULL) {
- LOGD("DexOpt: unable to optimize virt call 0x%04x at 0x%02x in %s.%s\n",
+ LOGD("DexOpt: unable to optimize virt call 0x%04x at 0x%02x in %s.%s",
methodIdx,
(int) (insns - method->insns), clazz->descriptor,
method->name);
@@ -1030,7 +1030,7 @@ static void rewriteVirtualInvoke(Method* method, u2* insns, Opcode newOpc)
updateOpcode(method, insns, newOpc);
dvmUpdateCodeUnit(method, insns+1, baseMethod->methodIndex);
- //LOGI("DexOpt: rewrote call to %s.%s --> %s.%s\n",
+ //LOGI("DexOpt: rewrote call to %s.%s --> %s.%s",
// method->clazz->descriptor, method->name,
// baseMethod->clazz->descriptor, baseMethod->name);
@@ -1056,7 +1056,7 @@ static bool rewriteInvokeObjectInit(Method* method, u2* insns)
calledMethod = dvmOptResolveMethod(clazz, methodIdx, METHOD_DIRECT, NULL);
if (calledMethod == NULL) {
- LOGD("DexOpt: unable to opt direct call 0x%04x at 0x%02x in %s.%s\n",
+ LOGD("DexOpt: unable to opt direct call 0x%04x at 0x%02x in %s.%s",
methodIdx, (int) (insns - method->insns),
clazz->descriptor, method->name);
return false;
@@ -1083,7 +1083,7 @@ static bool rewriteInvokeObjectInit(Method* method, u2* insns)
updateOpcode(method, insns, OP_INVOKE_OBJECT_INIT_RANGE);
}
- LOGVV("DexOpt: replaced Object.<init> in %s.%s\n",
+ LOGVV("DexOpt: replaced Object.<init> in %s.%s",
method->clazz->descriptor, method->name);
}
@@ -1101,7 +1101,7 @@ static bool rewriteJumboInvokeObjectInit(Method* method, u2* insns)
calledMethod = dvmOptResolveMethod(clazz, methodIdx, METHOD_DIRECT, NULL);
if (calledMethod == NULL) {
- LOGD("DexOpt: unable to opt direct call 0x%04x at 0x%02x in %s.%s\n",
+ LOGD("DexOpt: unable to opt direct call 0x%04x at 0x%02x in %s.%s",
methodIdx, (int) (insns - method->insns),
clazz->descriptor, method->name);
return false;
@@ -1113,7 +1113,7 @@ static bool rewriteJumboInvokeObjectInit(Method* method, u2* insns)
assert(insns[0] == ((u2) (OP_INVOKE_DIRECT_JUMBO << 8) | 0xff));
updateOpcode(method, insns, OP_INVOKE_OBJECT_INIT_JUMBO);
- LOGVV("DexOpt: replaced jumbo Object.<init> in %s.%s\n",
+ LOGVV("DexOpt: replaced jumbo Object.<init> in %s.%s",
method->clazz->descriptor, method->name);
}
@@ -1132,7 +1132,7 @@ Method* dvmOptResolveInterfaceMethod(ClassObject* referrer, u4 methodIdx)
DvmDex* pDvmDex = referrer->pDvmDex;
Method* resMethod;
- LOGVV("--- resolving interface method %d (referrer=%s)\n",
+ LOGVV("--- resolving interface method %d (referrer=%s)",
methodIdx, referrer->descriptor);
resMethod = dvmDexGetResolvedMethod(pDvmDex, methodIdx);
@@ -1150,7 +1150,7 @@ Method* dvmOptResolveInterfaceMethod(ClassObject* referrer, u4 methodIdx)
}
if (!dvmIsInterfaceClass(resClass)) {
/* whoops */
- LOGI("Interface method not part of interface class\n");
+ LOGI("Interface method not part of interface class");
return NULL;
}
@@ -1159,7 +1159,7 @@ Method* dvmOptResolveInterfaceMethod(ClassObject* referrer, u4 methodIdx)
DexProto proto;
dexProtoSetFromMethodId(&proto, pDvmDex->pDexFile, pMethodId);
- LOGVV("+++ looking for '%s' '%s' in resClass='%s'\n",
+ LOGVV("+++ looking for '%s' '%s' in resClass='%s'",
methodName, methodSig, resClass->descriptor);
resMethod = dvmFindInterfaceMethodHier(resClass, methodName, &proto);
if (resMethod == NULL) {
@@ -1169,7 +1169,7 @@ Method* dvmOptResolveInterfaceMethod(ClassObject* referrer, u4 methodIdx)
/* we're expecting this to be abstract */
if (!dvmIsAbstractMethod(resMethod)) {
char* desc = dexProtoCopyMethodDescriptor(&resMethod->prototype);
- LOGW("Found non-abstract interface method %s.%s %s\n",
+ LOGW("Found non-abstract interface method %s.%s %s",
resMethod->clazz->descriptor, resMethod->name, desc);
free(desc);
return NULL;
@@ -1181,7 +1181,7 @@ Method* dvmOptResolveInterfaceMethod(ClassObject* referrer, u4 methodIdx)
dvmDexSetResolvedMethod(pDvmDex, methodIdx, resMethod);
}
- LOGVV("--- found interface method %d (%s.%s)\n",
+ LOGVV("--- found interface method %d (%s.%s)",
methodIdx, resMethod->clazz->descriptor, resMethod->name);
/* interface methods are always public; no need to check access */
@@ -1207,14 +1207,14 @@ static bool rewriteExecuteInline(Method* method, u2* insns,
calledMethod = dvmOptResolveMethod(clazz, methodIdx, methodType, NULL);
if (calledMethod == NULL) {
- LOGV("+++ DexOpt inline: can't find %d\n", methodIdx);
+ LOGV("+++ DexOpt inline: can't find %d", methodIdx);
return false;
}
while (inlineSubs->method != NULL) {
/*
if (extra) {
- LOGI("comparing %p vs %p %s.%s %s\n",
+ LOGI("comparing %p vs %p %s.%s %s",
inlineSubs->method, calledMethod,
inlineSubs->method->clazz->descriptor,
inlineSubs->method->name,
@@ -1228,7 +1228,7 @@ static bool rewriteExecuteInline(Method* method, u2* insns,
updateOpcode(method, insns, OP_EXECUTE_INLINE);
dvmUpdateCodeUnit(method, insns+1, (u2) inlineSubs->inlineIdx);
- //LOGI("DexOpt: execute-inline %s.%s --> %s.%s\n",
+ //LOGI("DexOpt: execute-inline %s.%s --> %s.%s",
// method->clazz->descriptor, method->name,
// calledMethod->clazz->descriptor, calledMethod->name);
return true;
@@ -1256,7 +1256,7 @@ static bool rewriteExecuteInlineRange(Method* method, u2* insns,
calledMethod = dvmOptResolveMethod(clazz, methodIdx, methodType, NULL);
if (calledMethod == NULL) {
- LOGV("+++ DexOpt inline/range: can't find %d\n", methodIdx);
+ LOGV("+++ DexOpt inline/range: can't find %d", methodIdx);
return false;
}
@@ -1268,7 +1268,7 @@ static bool rewriteExecuteInlineRange(Method* method, u2* insns,
updateOpcode(method, insns, OP_EXECUTE_INLINE_RANGE);
dvmUpdateCodeUnit(method, insns+1, (u2) inlineSubs->inlineIdx);
- //LOGI("DexOpt: execute-inline/range %s.%s --> %s.%s\n",
+ //LOGI("DexOpt: execute-inline/range %s.%s --> %s.%s",
// method->clazz->descriptor, method->name,
// calledMethod->clazz->descriptor, calledMethod->name);
return true;
diff --git a/vm/analysis/RegisterMap.cpp b/vm/analysis/RegisterMap.cpp
index 37b2116c6..65fd77987 100644
--- a/vm/analysis/RegisterMap.cpp
+++ b/vm/analysis/RegisterMap.cpp
@@ -142,11 +142,11 @@ void dvmRegisterMapDumpStats()
break;
}
- LOGI("Register Map gcPointGap stats (diff count=%d, total=%d):\n",
+ LOGI("Register Map gcPointGap stats (diff count=%d, total=%d):",
pStats->gcGapCount, pStats->totalGcPointCount);
assert(pStats->gcPointGap[0] == 0);
for (i = 1; i <= end; i++) {
- LOGI(" %2d %d\n", i, pStats->gcPointGap[i]);
+ LOGI(" %2d %d", i, pStats->gcPointGap[i]);
}
@@ -155,16 +155,16 @@ void dvmRegisterMapDumpStats()
break;
}
- LOGI("Register Map bit difference stats:\n");
+ LOGI("Register Map bit difference stats:");
for (i = 0; i <= end; i++) {
- LOGI(" %2d %d\n", i, pStats->numDiffBits[i]);
+ LOGI(" %2d %d", i, pStats->numDiffBits[i]);
}
- LOGI("Register Map update position stats (lt16=%d ge16=%d):\n",
+ LOGI("Register Map update position stats (lt16=%d ge16=%d):",
pStats->updateLT16, pStats->updateGE16);
for (i = 0; i < kNumUpdatePosns; i++) {
- LOGI(" %2d %d\n", i, pStats->updatePosn[i]);
+ LOGI(" %2d %d", i, pStats->updatePosn[i]);
}
#endif
}
@@ -197,7 +197,7 @@ RegisterMap* dvmGenerateRegisterMapV(VerifierData* vdata)
int bufSize;
if (vdata->method->registersSize >= 2048) {
- LOGE("ERROR: register map can't handle %d registers\n",
+ LOGE("ERROR: register map can't handle %d registers",
vdata->method->registersSize);
goto bail;
}
@@ -231,7 +231,7 @@ RegisterMap* dvmGenerateRegisterMapV(VerifierData* vdata)
}
if (gcPointCount >= 65536) {
/* we could handle this, but in practice we don't get near this */
- LOGE("ERROR: register map can't handle %d gc points in one method\n",
+ LOGE("ERROR: register map can't handle %d gc points in one method",
gcPointCount);
goto bail;
}
@@ -241,7 +241,7 @@ RegisterMap* dvmGenerateRegisterMapV(VerifierData* vdata)
*/
bufSize = kHeaderSize + gcPointCount * (bytesForAddr + regWidth);
- LOGV("+++ grm: %s.%s (adr=%d gpc=%d rwd=%d bsz=%d)\n",
+ LOGV("+++ grm: %s.%s (adr=%d gpc=%d rwd=%d bsz=%d)",
vdata->method->clazz->descriptor, vdata->method->name,
bytesForAddr, gcPointCount, regWidth, bufSize);
@@ -270,7 +270,7 @@ RegisterMap* dvmGenerateRegisterMapV(VerifierData* vdata)
}
}
- LOGV("mapData=%p pMap=%p bufSize=%d\n", mapData, pMap, bufSize);
+ LOGV("mapData=%p pMap=%p bufSize=%d", mapData, pMap, bufSize);
assert(mapData - (const u1*) pMap == bufSize);
if (REGISTER_MAP_VERIFY && !verifyMap(vdata, pMap))
@@ -294,7 +294,7 @@ RegisterMap* dvmGenerateRegisterMapV(VerifierData* vdata)
RegisterMap* pUncompMap;
pUncompMap = uncompressMapDifferential(pCompMap);
if (pUncompMap == NULL) {
- LOGE("Map failed to uncompress - %s.%s\n",
+ LOGE("Map failed to uncompress - %s.%s",
vdata->method->clazz->descriptor,
vdata->method->name);
free(pCompMap);
@@ -302,7 +302,7 @@ RegisterMap* dvmGenerateRegisterMapV(VerifierData* vdata)
dvmAbort();
} else {
if (compareMaps(pMap, pUncompMap) != 0) {
- LOGE("Map comparison failed - %s.%s\n",
+ LOGE("Map comparison failed - %s.%s",
vdata->method->clazz->descriptor,
vdata->method->name);
free(pCompMap);
@@ -316,7 +316,7 @@ RegisterMap* dvmGenerateRegisterMapV(VerifierData* vdata)
}
if (REGISTER_MAP_VERBOSE) {
- LOGD("Good compress on %s.%s\n",
+ LOGD("Good compress on %s.%s",
vdata->method->clazz->descriptor,
vdata->method->name);
}
@@ -324,7 +324,7 @@ RegisterMap* dvmGenerateRegisterMapV(VerifierData* vdata)
pMap = pCompMap;
} else {
if (REGISTER_MAP_VERBOSE) {
- LOGD("Unable to compress %s.%s (ent=%d rw=%d)\n",
+ LOGD("Unable to compress %s.%s (ent=%d rw=%d)",
vdata->method->clazz->descriptor,
vdata->method->name,
dvmRegisterMapGetNumEntries(pMap),
@@ -413,7 +413,7 @@ static void dumpRegisterMap(const RegisterMap* pMap, int registersSize)
break;
default:
/* can't happen */
- LOGE("Can only dump Compact8 / Compact16 maps (not %d)\n", format);
+ LOGE("Can only dump Compact8 / Compact16 maps (not %d)", format);
return;
}
@@ -453,7 +453,7 @@ static void dumpRegisterMap(const RegisterMap* pMap, int registersSize)
}
hexBuf[i * 3] = '\0';
- LOGD(" %04x %s %s\n", addr, outBuf, hexBuf);
+ LOGD(" %04x %s %s", addr, outBuf, hexBuf);
}
}
@@ -479,7 +479,7 @@ static bool verifyMap(VerifierData* vdata, const RegisterMap* pMap)
{
char* desc;
desc = dexProtoCopyMethodDescriptor(&vdata->method->prototype);
- LOGI("Map for %s.%s %s\n", vdata->method->clazz->descriptor,
+ LOGI("Map for %s.%s %s", vdata->method->clazz->descriptor,
vdata->method->name, desc);
free(desc);
@@ -488,7 +488,7 @@ static bool verifyMap(VerifierData* vdata, const RegisterMap* pMap)
}
if ((vdata->method->registersSize + 7) / 8 != pMap->regWidth) {
- LOGE("GLITCH: registersSize=%d, regWidth=%d\n",
+ LOGE("GLITCH: registersSize=%d, regWidth=%d",
vdata->method->registersSize, pMap->regWidth);
return false;
}
@@ -512,7 +512,7 @@ static bool verifyMap(VerifierData* vdata, const RegisterMap* pMap)
const RegType* regs = vdata->registerLines[addr].regTypes;
if (regs == NULL) {
- LOGE("GLITCH: addr %d has no data\n", addr);
+ LOGE("GLITCH: addr %d has no data", addr);
return false;
}
@@ -534,7 +534,7 @@ static bool verifyMap(VerifierData* vdata, const RegisterMap* pMap)
regIsRef = isReferenceType(type);
if (bitIsRef != regIsRef) {
- LOGE("GLITCH: addr %d reg %d: bit=%d reg=%d(%d)\n",
+ LOGE("GLITCH: addr %d reg %d: bit=%d reg=%d(%d)",
addr, i, bitIsRef, regIsRef, type);
return false;
}
@@ -590,7 +590,7 @@ static size_t computeRegisterMapSize(const RegisterMap* pMap)
return len + (ptr - (u1*) pMap);
}
default:
- LOGE("Bad register map format %d\n", format);
+ LOGE("Bad register map format %d", format);
dvmAbort();
return 0;
}
@@ -609,7 +609,7 @@ static bool writeMapForMethod(const Method* meth, u1** pPtr)
{
if (meth->registerMap == NULL) {
if (!dvmIsAbstractMethod(meth) && !dvmIsNativeMethod(meth)) {
- LOGW("Warning: no map available for %s.%s\n",
+ LOGW("Warning: no map available for %s.%s",
meth->clazz->descriptor, meth->name);
/* weird, but keep going */
}
@@ -644,7 +644,7 @@ static bool writeMapsAllMethods(DvmDex* pDvmDex, const ClassObject* clazz,
/* artificial limit */
if (clazz->virtualMethodCount + clazz->directMethodCount >= 65536) {
- LOGE("Too many methods in %s\n", clazz->descriptor);
+ LOGE("Too many methods in %s", clazz->descriptor);
return false;
}
@@ -743,7 +743,7 @@ static size_t writeMapsAllClasses(DvmDex* pDvmDex, u1* basePtr, size_t length)
if (clazz != NULL) {
offsetTable[idx] = ptr - basePtr;
- LOGVV("%d -> offset %d (%p-%p)\n",
+ LOGVV("%d -> offset %d (%p-%p)",
idx, offsetTable[idx], ptr, basePtr);
if (!writeMapsAllMethods(pDvmDex, clazz, &ptr,
@@ -753,18 +753,18 @@ static size_t writeMapsAllClasses(DvmDex* pDvmDex, u1* basePtr, size_t length)
}
ptr = align32(ptr);
- LOGVV("Size %s (%d+%d methods): %d\n", clazz->descriptor,
+ LOGVV("Size %s (%d+%d methods): %d", clazz->descriptor,
clazz->directMethodCount, clazz->virtualMethodCount,
(ptr - basePtr) - offsetTable[idx]);
} else {
- LOGV("%4d NOT mapadding '%s'\n", idx, classDescriptor);
+ LOGV("%4d NOT mapadding '%s'", idx, classDescriptor);
assert(offsetTable[idx] == 0);
}
}
if (ptr - basePtr >= (int)length) {
/* a bit late */
- LOGE("Buffer overrun\n");
+ LOGE("Buffer overrun");
dvmAbort();
}
@@ -813,7 +813,7 @@ RegisterMapBuilder* dvmGenerateRegisterMaps(DvmDex* pDvmDex)
return NULL;
}
- LOGV("TOTAL size of register maps: %d\n", actual);
+ LOGV("TOTAL size of register maps: %d", actual);
pBuilder->data = pBuilder->memMap.addr;
pBuilder->size = actual;
@@ -849,13 +849,13 @@ const void* dvmRegisterMapGetClassData(const DexFile* pDexFile, u4 classIdx,
return NULL;
if (classIdx >= pClassPool->numClasses) {
- LOGE("bad class index (%d vs %d)\n", classIdx, pClassPool->numClasses);
+ LOGE("bad class index (%d vs %d)", classIdx, pClassPool->numClasses);
dvmAbort();
}
u4 classOffset = pClassPool->classDataOffset[classIdx];
if (classOffset == 0) {
- LOGV("+++ no map for classIdx=%d\n", classIdx);
+ LOGV("+++ no map for classIdx=%d", classIdx);
return NULL;
}
@@ -874,7 +874,7 @@ const RegisterMap* dvmRegisterMapGetNext(const void** pPtr)
const RegisterMap* pMap = (const RegisterMap*) *pPtr;
*pPtr = /*align32*/(((u1*) pMap) + computeRegisterMapSize(pMap));
- LOGVV("getNext: %p -> %p (f=0x%x w=%d e=%d)\n",
+ LOGVV("getNext: %p -> %p (f=0x%x w=%d e=%d)",
pMap, *pPtr, pMap->format, pMap->regWidth,
dvmRegisterMapGetNumEntries(pMap));
return pMap;
@@ -910,7 +910,7 @@ const u1* dvmRegisterMapGetLine(const RegisterMap* pMap, int addr)
addrWidth = 2;
break;
default:
- LOGE("Unknown format %d\n", format);
+ LOGE("Unknown format %d", format);
dvmAbort();
return NULL;
}
@@ -977,12 +977,12 @@ static int compareMaps(const RegisterMap* pMap1, const RegisterMap* pMap2)
size1 = computeRegisterMapSize(pMap1);
size2 = computeRegisterMapSize(pMap2);
if (size1 != size2) {
- LOGI("compareMaps: size mismatch (%zd vs %zd)\n", size1, size2);
+ LOGI("compareMaps: size mismatch (%zd vs %zd)", size1, size2);
return -1;
}
if (memcmp(pMap1, pMap2, size1) != 0) {
- LOGI("compareMaps: content mismatch\n");
+ LOGI("compareMaps: content mismatch");
return -1;
}
@@ -1012,7 +1012,7 @@ const RegisterMap* dvmGetExpandedRegisterMap0(Method* method)
/* (if we use this at a time other than during GC, fix/remove this test) */
if (true) {
if (!gDvm.zygote && dvmTryLockMutex(&gDvm.gcHeapLock) == 0) {
- LOGE("GLITCH: dvmGetExpandedRegisterMap not called at GC time\n");
+ LOGE("GLITCH: dvmGetExpandedRegisterMap not called at GC time");
dvmAbort();
}
}
@@ -1023,10 +1023,10 @@ const RegisterMap* dvmGetExpandedRegisterMap0(Method* method)
case kRegMapFormatCompact16:
if (REGISTER_MAP_VERBOSE) {
if (dvmRegisterMapGetOnHeap(curMap)) {
- LOGD("RegMap: already expanded: %s.%s\n",
+ LOGD("RegMap: already expanded: %s.%s",
method->clazz->descriptor, method->name);
} else {
- LOGD("RegMap: stored w/o compression: %s.%s\n",
+ LOGD("RegMap: stored w/o compression: %s.%s",
method->clazz->descriptor, method->name);
}
}
@@ -1035,13 +1035,13 @@ const RegisterMap* dvmGetExpandedRegisterMap0(Method* method)
newMap = uncompressMapDifferential(curMap);
break;
default:
- LOGE("Unknown format %d in dvmGetExpandedRegisterMap\n", format);
+ LOGE("Unknown format %d in dvmGetExpandedRegisterMap", format);
dvmAbort();
newMap = NULL; // make gcc happy
}
if (newMap == NULL) {
- LOGE("Map failed to uncompress (fmt=%d) %s.%s\n",
+ LOGE("Map failed to uncompress (fmt=%d) %s.%s",
format, method->clazz->descriptor, method->name);
return NULL;
}
@@ -1054,14 +1054,14 @@ const RegisterMap* dvmGetExpandedRegisterMap0(Method* method)
MapStats* pStats = (MapStats*) gDvm.registerMapStats;
pStats->numExpandedMaps++;
pStats->totalExpandedMapSize += computeRegisterMapSize(newMap);
- LOGD("RMAP: count=%d size=%d\n",
+ LOGD("RMAP: count=%d size=%d",
pStats->numExpandedMaps, pStats->totalExpandedMapSize);
}
#endif
IF_LOGV() {
char* desc = dexProtoCopyMethodDescriptor(&method->prototype);
- LOGV("Expanding map -> %s.%s:%s\n",
+ LOGV("Expanding map -> %s.%s:%s",
method->clazz->descriptor, method->name, desc);
free(desc);
}
@@ -1282,11 +1282,11 @@ static void computeMapStats(RegisterMap* pMap, const Method* method)
int addrDiff = addr - prevAddr;
if (addrDiff < 0) {
- LOGE("GLITCH: address went backward (0x%04x->0x%04x, %s.%s)\n",
+ LOGE("GLITCH: address went backward (0x%04x->0x%04x, %s.%s)",
prevAddr, addr, method->clazz->descriptor, method->name);
} else if (addrDiff > kMaxGcPointGap) {
if (REGISTER_MAP_VERBOSE) {
- LOGI("HEY: addrDiff is %d, max %d (0x%04x->0x%04x %s.%s)\n",
+ LOGI("HEY: addrDiff is %d, max %d (0x%04x->0x%04x %s.%s)",
addrDiff, kMaxGcPointGap, prevAddr, addr,
method->clazz->descriptor, method->name);
}
@@ -1331,14 +1331,14 @@ static void computeMapStats(RegisterMap* pMap, const Method* method)
if (bitNum >= method->registersSize) {
/* stuff off the end should be zero in both */
- LOGE("WEIRD: bit=%d (%d/%d), prev=%02x cur=%02x\n",
+ LOGE("WEIRD: bit=%d (%d/%d), prev=%02x cur=%02x",
bit, regByte, method->registersSize,
prev, cur);
assert(false);
}
int idx = (int) (bitNum * div);
if (!(idx >= 0 && idx < kNumUpdatePosns)) {
- LOGE("FAIL: bitNum=%d (of %d) div=%.3f idx=%d\n",
+ LOGE("FAIL: bitNum=%d (of %d) div=%.3f idx=%d",
bitNum, method->registersSize, div, idx);
assert(false);
}
@@ -1349,7 +1349,7 @@ static void computeMapStats(RegisterMap* pMap, const Method* method)
if (numDiff > kMaxDiffBits) {
if (REGISTER_MAP_VERBOSE) {
- LOGI("WOW: numDiff is %d, max %d\n", numDiff, kMaxDiffBits);
+ LOGI("WOW: numDiff is %d, max %d", numDiff, kMaxDiffBits);
}
} else {
pStats->numDiffBits[numDiff]++;
@@ -1464,7 +1464,7 @@ static RegisterMap* compressMapDifferential(const RegisterMap* pMap,
addrWidth = 2;
break;
default:
- LOGE("ERROR: can't compress map with format=%d\n", format);
+ LOGE("ERROR: can't compress map with format=%d", format);
return NULL;
}
@@ -1472,14 +1472,14 @@ static RegisterMap* compressMapDifferential(const RegisterMap* pMap,
numEntries = dvmRegisterMapGetNumEntries(pMap);
if (debug) {
- LOGI("COMPRESS: %s.%s aw=%d rw=%d ne=%d\n",
+ LOGI("COMPRESS: %s.%s aw=%d rw=%d ne=%d",
meth->clazz->descriptor, meth->name,
addrWidth, regWidth, numEntries);
dumpRegisterMap(pMap, -1);
}
if (numEntries <= 1) {
- LOGV("Can't compress map with 0 or 1 entries\n");
+ LOGV("Can't compress map with 0 or 1 entries");
return NULL;
}
@@ -1515,7 +1515,7 @@ static RegisterMap* compressMapDifferential(const RegisterMap* pMap,
addr |= (*mapData++) << 8;
if (addr >= 128) {
- LOGV("Can't compress map with starting address >= 128\n");
+ LOGV("Can't compress map with starting address >= 128");
return NULL;
}
@@ -1549,7 +1549,7 @@ static RegisterMap* compressMapDifferential(const RegisterMap* pMap,
addr |= (*mapData++) << 8;
if (debug)
- LOGI(" addr=0x%04x ent=%d (aw=%d)\n", addr, entry, addrWidth);
+ LOGI(" addr=0x%04x ent=%d (aw=%d)", addr, entry, addrWidth);
addrDiff = addr - prevAddr;
assert(addrDiff > 0);
@@ -1557,12 +1557,12 @@ static RegisterMap* compressMapDifferential(const RegisterMap* pMap,
/* small difference, encode in 3 bits */
key = addrDiff -1; /* set 00000AAA */
if (debug)
- LOGI(" : small %d, key=0x%02x\n", addrDiff, key);
+ LOGI(" : small %d, key=0x%02x", addrDiff, key);
} else {
/* large difference, output escape code */
key = 0x07; /* escape code for AAA */
if (debug)
- LOGI(" : large %d, key=0x%02x\n", addrDiff, key);
+ LOGI(" : large %d, key=0x%02x", addrDiff, key);
}
int numBitsChanged, firstBitChanged, lebSize;
@@ -1571,26 +1571,26 @@ static RegisterMap* compressMapDifferential(const RegisterMap* pMap,
&firstBitChanged, &numBitsChanged, NULL);
if (debug) {
- LOGI(" : diff fbc=%d nbc=%d ls=%d (rw=%d)\n",
+ LOGI(" : diff fbc=%d nbc=%d ls=%d (rw=%d)",
firstBitChanged, numBitsChanged, lebSize, regWidth);
}
if (numBitsChanged == 0) {
/* set B to 1 and CCCC to zero to indicate no bits were changed */
key |= 0x08;
- if (debug) LOGI(" : no bits changed\n");
+ if (debug) LOGI(" : no bits changed");
} else if (numBitsChanged == 1 && firstBitChanged < 16) {
/* set B to 0 and CCCC to the index of the changed bit */
key |= firstBitChanged << 4;
- if (debug) LOGI(" : 1 low bit changed\n");
+ if (debug) LOGI(" : 1 low bit changed");
} else if (numBitsChanged < 15 && lebSize < regWidth) {
/* set B to 1 and CCCC to the number of bits */
key |= 0x08 | (numBitsChanged << 4);
- if (debug) LOGI(" : some bits changed\n");
+ if (debug) LOGI(" : some bits changed");
} else {
/* set B to 1 and CCCC to 0x0f so we store the entire vector */
key |= 0x08 | 0xf0;
- if (debug) LOGI(" : encode original\n");
+ if (debug) LOGI(" : encode original");
}
/*
@@ -1628,7 +1628,7 @@ static RegisterMap* compressMapDifferential(const RegisterMap* pMap,
*/
if (tmpPtr - tmpBuf.get() >= origSize) {
if (debug) {
- LOGD("Compressed size >= original (%d vs %d): %s.%s\n",
+ LOGD("Compressed size >= original (%d vs %d): %s.%s",
tmpPtr - tmpBuf.get(), origSize,
meth->clazz->descriptor, meth->name);
}
@@ -1649,7 +1649,7 @@ static RegisterMap* compressMapDifferential(const RegisterMap* pMap,
newMapSize = kHeaderSize + unsignedLeb128Size(newDataSize) + newDataSize;
if (newMapSize >= origSize) {
if (debug) {
- LOGD("Final comp size >= original (%d vs %d): %s.%s\n",
+ LOGD("Final comp size >= original (%d vs %d): %s.%s",
newMapSize, origSize, meth->clazz->descriptor, meth->name);
}
return NULL;
@@ -1668,7 +1668,7 @@ static RegisterMap* compressMapDifferential(const RegisterMap* pMap,
memcpy(tmpPtr, tmpBuf.get(), newDataSize);
if (REGISTER_MAP_VERBOSE) {
- LOGD("Compression successful (%d -> %d) from aw=%d rw=%d ne=%d\n",
+ LOGD("Compression successful (%d -> %d) from aw=%d rw=%d ne=%d",
computeRegisterMapSize(pMap), computeRegisterMapSize(pNewMap),
addrWidth, regWidth, numEntries);
}
@@ -1700,7 +1700,7 @@ static RegisterMap* uncompressMapDifferential(const RegisterMap* pMap)
int regWidth, numEntries, newAddrWidth, newMapSize;
if (format != kRegMapFormatDifferential) {
- LOGE("Not differential (%d)\n", format);
+ LOGE("Not differential (%d)", format);
return NULL;
}
@@ -1725,7 +1725,7 @@ static RegisterMap* uncompressMapDifferential(const RegisterMap* pMap)
/* now we know enough to allocate the new map */
if (REGISTER_MAP_VERBOSE) {
- LOGI("Expanding to map aw=%d rw=%d ne=%d\n",
+ LOGI("Expanding to map aw=%d rw=%d ne=%d",
newAddrWidth, regWidth, numEntries);
}
newMapSize = kHeaderSize + (newAddrWidth + regWidth) * numEntries;
@@ -1811,21 +1811,21 @@ static RegisterMap* uncompressMapDifferential(const RegisterMap* pMap)
}
if (dstPtr - (u1*) pNewMap != newMapSize) {
- LOGE("ERROR: output %d bytes, expected %d\n",
+ LOGE("ERROR: output %d bytes, expected %d",
dstPtr - (u1*) pNewMap, newMapSize);
free(pNewMap);
return NULL;
}
if (srcPtr - srcStart != expectedSrcLen) {
- LOGE("ERROR: consumed %d bytes, expected %d\n",
+ LOGE("ERROR: consumed %d bytes, expected %d",
srcPtr - srcStart, expectedSrcLen);
free(pNewMap);
return NULL;
}
if (REGISTER_MAP_VERBOSE) {
- LOGD("Expansion successful (%d -> %d)\n",
+ LOGD("Expansion successful (%d -> %d)",
computeRegisterMapSize(pMap), computeRegisterMapSize(pNewMap));
}
diff --git a/vm/analysis/VerifySubs.cpp b/vm/analysis/VerifySubs.cpp
index 2366f688f..16801592c 100644
--- a/vm/analysis/VerifySubs.cpp
+++ b/vm/analysis/VerifySubs.cpp
@@ -58,7 +58,7 @@ void dvmLogVerifyFailure(const Method* meth, const char* format, ...)
LOG_PRI_VA(logLevel, LOG_TAG, format, ap);
if (meth != NULL) {
char* desc = dexProtoCopyMethodDescriptor(&meth->prototype);
- LOG_PRI(logLevel, LOG_TAG, "VFY: rejected %s.%s %s\n",
+ LOG_PRI(logLevel, LOG_TAG, "VFY: rejected %s.%s %s",
meth->clazz->descriptor, meth->name, desc);
free(desc);
}
@@ -81,7 +81,7 @@ void dvmLogUnableToResolveClass(const char* missingClassDescr,
char* dotFromClass = dvmHumanReadableDescriptor(meth->clazz->descriptor);
//char* methodDescr = dexProtoCopyMethodDescriptor(&meth->prototype);
- LOGE("Could not find class '%s', referenced from method %s.%s\n",
+ LOGE("Could not find class '%s', referenced from method %s.%s",
dotMissingClass, dotFromClass, meth->name/*, methodDescr*/);
free(dotMissingClass);
diff --git a/vm/analysis/VfyBasicBlock.cpp b/vm/analysis/VfyBasicBlock.cpp
index 7a6b67266..50ec46bd7 100644
--- a/vm/analysis/VfyBasicBlock.cpp
+++ b/vm/analysis/VfyBasicBlock.cpp
@@ -228,7 +228,7 @@ static bool setPredecessors(VerifierData* vdata, VfyBasicBlock* curBlock,
if (false) {
if (dvmPointerSetGetCount(curBlock->predecessors) > 256) {
- LOGI("Lots of preds at 0x%04x in %s.%s:%s\n", curIdx,
+ LOGI("Lots of preds at 0x%04x in %s.%s:%s", curIdx,
meth->clazz->descriptor, meth->name, meth->shorty);
}
}
@@ -245,7 +245,7 @@ static void dumpBasicBlocks(const VerifierData* vdata)
unsigned int idx;
int count;
- LOGI("Basic blocks for %s.%s:%s\n", vdata->method->clazz->descriptor,
+ LOGI("Basic blocks for %s.%s:%s", vdata->method->clazz->descriptor,
vdata->method->name, vdata->method->shorty);
for (idx = 0; idx < vdata->insnsSize; idx++) {
VfyBasicBlock* block = vdata->basicBlocks[idx];
@@ -309,7 +309,7 @@ bool dvmComputeVfyBasicBlocks(VerifierData* vdata)
bool verbose = false; //dvmWantVerboseVerification(meth);
if (verbose) {
- LOGI("Basic blocks for %s.%s:%s\n",
+ LOGI("Basic blocks for %s.%s:%s",
meth->clazz->descriptor, meth->name, meth->shorty);
}
@@ -382,7 +382,7 @@ bool dvmComputeVfyBasicBlocks(VerifierData* vdata)
if (numHandlers <= kHandlerStackAllocSize) {
handlerList = handlerAddrs;
} else {
- LOGD("overflow, numHandlers=%d\n", numHandlers);
+ LOGD("overflow, numHandlers=%d", numHandlers);
handlerListAlloc = (u4*) malloc(sizeof(u4) * numHandlers);
if (handlerListAlloc == NULL)
return false;
@@ -391,7 +391,7 @@ bool dvmComputeVfyBasicBlocks(VerifierData* vdata)
handlerList = handlerListAlloc;
}
- LOGV("+++ start=%x end=%x numHan=%d\n",
+ LOGV("+++ start=%x end=%x numHan=%d",
tryStart, tryEnd, numHandlers);
tryIndex++;
@@ -473,11 +473,11 @@ bool dvmComputeVfyBasicBlocks(VerifierData* vdata)
else
startEnd = "-";
- LOGI("%04x: %c%c%s #%d\n", idx, tryc, btc, startEnd, debugBBIndex);
+ LOGI("%04x: %c%c%s #%d", idx, tryc, btc, startEnd, debugBBIndex);
if (pTries != NULL && idx == tryStart) {
assert(numHandlers > 0);
- LOGI(" EXC block: [%04x, %04x) %d:(%04x...)\n",
+ LOGI(" EXC block: [%04x, %04x) %d:(%04x...)",
tryStart, tryEnd, numHandlers, handlerList[0]);
}
}
diff --git a/vm/arch/generic/Call.cpp b/vm/arch/generic/Call.cpp
index ae7441577..c23e7c823 100644
--- a/vm/arch/generic/Call.cpp
+++ b/vm/arch/generic/Call.cpp
@@ -41,7 +41,7 @@ static ffi_type* getFfiType(char sigType)
case '[':
case 'L': return &ffi_type_pointer;
default:
- LOGE("bad ffitype 0x%02x\n", sigType);
+ LOGE("bad ffitype 0x%02x", sigType);
dvmAbort();
return NULL;
}
@@ -104,7 +104,7 @@ void dvmPlatformInvoke(void* pEnv, ClassObject* clazz, int argInfo, int argc,
* Prep the CIF (Call InterFace object).
*/
if (ffi_prep_cif(&cif, FFI_DEFAULT_ABI, dstArg, retType, types) != FFI_OK) {
- LOGE("ffi_prep_cif failed\n");
+ LOGE("ffi_prep_cif failed");
dvmAbort();
}
diff --git a/vm/compiler/Compiler.cpp b/vm/compiler/Compiler.cpp
index 99533b7c2..e463ca8d5 100644
--- a/vm/compiler/Compiler.cpp
+++ b/vm/compiler/Compiler.cpp
@@ -178,7 +178,7 @@ bool dvmCompilerSetupCodeCache(void)
MAP_PRIVATE , fd, 0);
close(fd);
if (gDvmJit.codeCache == MAP_FAILED) {
- LOGE("Failed to mmap the JIT code cache: %s\n", strerror(errno));
+ LOGE("Failed to mmap the JIT code cache: %s", strerror(errno));
return false;
}
@@ -418,7 +418,7 @@ static bool compilerThreadStartup(void)
pJitTable = (JitEntry*)
calloc(gDvmJit.jitTableSize, sizeof(*pJitTable));
if (!pJitTable) {
- LOGE("jit table allocation failed\n");
+ LOGE("jit table allocation failed");
dvmUnlockMutex(&gDvmJit.tableLock);
goto fail;
}
@@ -432,7 +432,7 @@ static bool compilerThreadStartup(void)
*/
pJitProfTable = (unsigned char *)malloc(JIT_PROF_SIZE);
if (!pJitProfTable) {
- LOGE("jit prof table allocation failed\n");
+ LOGE("jit prof table allocation failed");
dvmUnlockMutex(&gDvmJit.tableLock);
goto fail;
}
@@ -447,7 +447,7 @@ static bool compilerThreadStartup(void)
pJitTraceProfCounters = (JitTraceProfCounters*)
calloc(1, sizeof(*pJitTraceProfCounters));
if (!pJitTraceProfCounters) {
- LOGE("jit trace prof counters allocation failed\n");
+ LOGE("jit trace prof counters allocation failed");
dvmUnlockMutex(&gDvmJit.tableLock);
goto fail;
}
@@ -720,7 +720,7 @@ static void *compilerThreadStart(void *arg)
dvmChangeStatus(NULL, THREAD_RUNNING);
if (gDvm.verboseShutdown)
- LOGD("Compiler thread shutting down\n");
+ LOGD("Compiler thread shutting down");
return NULL;
}
@@ -773,9 +773,9 @@ void dvmCompilerShutdown(void)
dvmUnlockMutex(&gDvmJit.compilerLock);
if (pthread_join(gDvmJit.compilerHandle, &threadReturn) != 0)
- LOGW("Compiler thread join failed\n");
+ LOGW("Compiler thread join failed");
else if (gDvm.verboseShutdown)
- LOGD("Compiler thread has shut down\n");
+ LOGD("Compiler thread has shut down");
}
/* Break loops within the translation cache */
diff --git a/vm/compiler/Frontend.cpp b/vm/compiler/Frontend.cpp
index 75be70314..6b1e139b6 100644
--- a/vm/compiler/Frontend.cpp
+++ b/vm/compiler/Frontend.cpp
@@ -49,7 +49,7 @@ static inline int parseInsn(const u2 *codePtr, DecodedInstruction *decInsn,
dexDecodeInstruction(codePtr, decInsn);
if (printMe) {
char *decodedString = dvmCompilerGetDalvikDisassembly(decInsn, NULL);
- LOGD("%p: %#06x %s\n", codePtr, opcode, decodedString);
+ LOGD("%p: %#06x %s", codePtr, opcode, decodedString);
}
return dexGetWidthFromOpcode(opcode);
}
@@ -1745,7 +1745,7 @@ bool dvmCompileTrace(JitTraceDescription *desc, int numMaxInsts,
curBB = entryCodeBB;
if (cUnit.printMe) {
- LOGD("--------\nCompiler: Building trace for %s, offset 0x%x\n",
+ LOGD("--------\nCompiler: Building trace for %s, offset 0x%x",
desc->method->name, curOffset);
}
diff --git a/vm/compiler/Utility.cpp b/vm/compiler/Utility.cpp
index c75e5fe23..b69faba89 100644
--- a/vm/compiler/Utility.cpp
+++ b/vm/compiler/Utility.cpp
@@ -27,7 +27,7 @@ bool dvmCompilerHeapInit(void)
arenaHead =
(ArenaMemBlock *) malloc(sizeof(ArenaMemBlock) + ARENA_DEFAULT_SIZE);
if (arenaHead == NULL) {
- LOGE("No memory left to create compiler heap memory\n");
+ LOGE("No memory left to create compiler heap memory");
return false;
}
arenaHead->blockSize = ARENA_DEFAULT_SIZE;
@@ -183,18 +183,18 @@ void dvmCompilerDumpCompilationUnit(CompilationUnit *cUnit)
while (true) {
bb = (BasicBlock *) dvmGrowableListIteratorNext(&iterator);
if (bb == NULL) break;
- LOGD("Block %d (%s) (insn %04x - %04x%s)\n",
+ LOGD("Block %d (%s) (insn %04x - %04x%s)",
bb->id,
blockTypeNames[bb->blockType],
bb->startOffset,
bb->lastMIRInsn ? bb->lastMIRInsn->offset : bb->startOffset,
bb->lastMIRInsn ? "" : " empty");
if (bb->taken) {
- LOGD(" Taken branch: block %d (%04x)\n",
+ LOGD(" Taken branch: block %d (%04x)",
bb->taken->id, bb->taken->startOffset);
}
if (bb->fallThrough) {
- LOGD(" Fallthrough : block %d (%04x)\n",
+ LOGD(" Fallthrough : block %d (%04x)",
bb->fallThrough->id, bb->fallThrough->startOffset);
}
}
diff --git a/vm/compiler/codegen/arm/ArchUtility.cpp b/vm/compiler/codegen/arm/ArchUtility.cpp
index f3a2a4b37..ecc67db08 100644
--- a/vm/compiler/codegen/arm/ArchUtility.cpp
+++ b/vm/compiler/codegen/arm/ArchUtility.cpp
@@ -304,69 +304,69 @@ void dvmDumpLIRInsn(LIR *arg, unsigned char *baseAddr)
/* Handle pseudo-ops individually, and all regular insns as a group */
switch(lir->opcode) {
case kArmChainingCellBottom:
- LOGD("-------- end of chaining cells (0x%04x)\n", offset);
+ LOGD("-------- end of chaining cells (0x%04x)", offset);
break;
case kArmPseudoBarrier:
LOGD("-------- BARRIER");
break;
case kArmPseudoExtended:
- LOGD("-------- %s\n", (char *) dest);
+ LOGD("-------- %s", (char *) dest);
break;
case kArmPseudoSSARep:
- DUMP_SSA_REP(LOGD("-------- %s\n", (char *) dest));
+ DUMP_SSA_REP(LOGD("-------- %s", (char *) dest));
break;
case kArmPseudoChainingCellBackwardBranch:
- LOGD("L%p:\n", lir);
- LOGD("-------- chaining cell (backward branch): 0x%04x\n", dest);
+ LOGD("L%p:", lir);
+ LOGD("-------- chaining cell (backward branch): 0x%04x", dest);
break;
case kArmPseudoChainingCellNormal:
- LOGD("L%p:\n", lir);
- LOGD("-------- chaining cell (normal): 0x%04x\n", dest);
+ LOGD("L%p:", lir);
+ LOGD("-------- chaining cell (normal): 0x%04x", dest);
break;
case kArmPseudoChainingCellHot:
- LOGD("L%p:\n", lir);
- LOGD("-------- chaining cell (hot): 0x%04x\n", dest);
+ LOGD("L%p:", lir);
+ LOGD("-------- chaining cell (hot): 0x%04x", dest);
break;
case kArmPseudoChainingCellInvokePredicted:
- LOGD("L%p:\n", lir);
- LOGD("-------- chaining cell (predicted): %s%s\n",
+ LOGD("L%p:", lir);
+ LOGD("-------- chaining cell (predicted): %s%s",
dest ? ((Method *) dest)->clazz->descriptor : "",
dest ? ((Method *) dest)->name : "N/A");
break;
case kArmPseudoChainingCellInvokeSingleton:
- LOGD("L%p:\n", lir);
- LOGD("-------- chaining cell (invoke singleton): %s%s/%p\n",
+ LOGD("L%p:", lir);
+ LOGD("-------- chaining cell (invoke singleton): %s%s/%p",
((Method *)dest)->clazz->descriptor,
((Method *)dest)->name,
((Method *)dest)->insns);
break;
case kArmPseudoEntryBlock:
- LOGD("-------- entry offset: 0x%04x\n", dest);
+ LOGD("-------- entry offset: 0x%04x", dest);
break;
case kArmPseudoDalvikByteCodeBoundary:
- LOGD("-------- dalvik offset: 0x%04x @ %s\n", dest,
+ LOGD("-------- dalvik offset: 0x%04x @ %s", dest,
(char *) lir->operands[1]);
break;
case kArmPseudoExitBlock:
- LOGD("-------- exit offset: 0x%04x\n", dest);
+ LOGD("-------- exit offset: 0x%04x", dest);
break;
case kArmPseudoPseudoAlign4:
- LOGD("%p (%04x): .align4\n", baseAddr + offset, offset);
+ LOGD("%p (%04x): .align4", baseAddr + offset, offset);
break;
case kArmPseudoPCReconstructionCell:
- LOGD("L%p:\n", lir);
- LOGD("-------- reconstruct dalvik PC : 0x%04x @ +0x%04x\n", dest,
+ LOGD("L%p:", lir);
+ LOGD("-------- reconstruct dalvik PC : 0x%04x @ +0x%04x", dest,
lir->operands[1]);
break;
case kArmPseudoPCReconstructionBlockLabel:
/* Do nothing */
break;
case kArmPseudoEHBlockLabel:
- LOGD("Exception_Handling:\n");
+ LOGD("Exception_Handling:");
break;
case kArmPseudoTargetLabel:
case kArmPseudoNormalBlockLabel:
- LOGD("L%p:\n", lir);
+ LOGD("L%p:", lir);
break;
default:
if (lir->flags.isNop && !dumpNop) {
@@ -376,7 +376,7 @@ void dvmDumpLIRInsn(LIR *arg, unsigned char *baseAddr)
baseAddr, 256);
buildInsnString(EncodingMap[lir->opcode].fmt, lir, buf, baseAddr,
256);
- LOGD("%p (%04x): %-8s%s%s\n",
+ LOGD("%p (%04x): %-8s%s%s",
baseAddr + offset, offset, opName, buf,
lir->flags.isNop ? "(nop)" : "");
break;
@@ -395,25 +395,25 @@ void dvmDumpLIRInsn(LIR *arg, unsigned char *baseAddr)
/* Dump instructions and constant pool contents */
void dvmCompilerCodegenDump(CompilationUnit *cUnit)
{
- LOGD("Dumping LIR insns\n");
+ LOGD("Dumping LIR insns");
LIR *lirInsn;
ArmLIR *armLIR;
- LOGD("installed code is at %p\n", cUnit->baseAddr);
- LOGD("total size is %d bytes\n", cUnit->totalSize);
+ LOGD("installed code is at %p", cUnit->baseAddr);
+ LOGD("total size is %d bytes", cUnit->totalSize);
for (lirInsn = cUnit->firstLIRInsn; lirInsn; lirInsn = lirInsn->next) {
dvmDumpLIRInsn(lirInsn, (unsigned char *) cUnit->baseAddr);
}
for (lirInsn = cUnit->classPointerList; lirInsn; lirInsn = lirInsn->next) {
armLIR = (ArmLIR *) lirInsn;
- LOGD("%p (%04x): .class (%s)\n",
+ LOGD("%p (%04x): .class (%s)",
(char*)cUnit->baseAddr + armLIR->generic.offset,
armLIR->generic.offset,
((CallsiteInfo *) armLIR->operands[0])->classDescriptor);
}
for (lirInsn = cUnit->literalList; lirInsn; lirInsn = lirInsn->next) {
armLIR = (ArmLIR *) lirInsn;
- LOGD("%p (%04x): .word (0x%x)\n",
+ LOGD("%p (%04x): .word (0x%x)",
(char*)cUnit->baseAddr + armLIR->generic.offset,
armLIR->generic.offset,
armLIR->operands[0]);
diff --git a/vm/compiler/codegen/arm/Assemble.cpp b/vm/compiler/codegen/arm/Assemble.cpp
index a433c31d4..47d2a0828 100644
--- a/vm/compiler/codegen/arm/Assemble.cpp
+++ b/vm/compiler/codegen/arm/Assemble.cpp
@@ -958,7 +958,7 @@ static AssemblerStatus assembleInstructions(CompilationUnit *cUnit,
intptr_t target = lirTarget->generic.offset;
int delta = target - pc;
if (delta & 0x3) {
- LOGE("PC-rel distance is not multiples of 4: %d\n", delta);
+ LOGE("PC-rel distance is not multiples of 4: %d", delta);
dvmCompilerAbort(cUnit);
}
if ((lir->opcode == kThumb2LdrPcRel12) && (delta > 4091)) {
@@ -1035,7 +1035,7 @@ static AssemblerStatus assembleInstructions(CompilationUnit *cUnit,
intptr_t target = targetLIR->generic.offset;
int delta = target - pc;
if (delta > 2046 || delta < -2048) {
- LOGE("Unconditional branch distance out of range: %d\n", delta);
+ LOGE("Unconditional branch distance out of range: %d", delta);
dvmCompilerAbort(cUnit);
}
lir->operands[0] = delta >> 1;
@@ -1437,7 +1437,7 @@ void dvmCompilerAssembleLIR(CompilationUnit *cUnit, JitTranslationInfo *info)
/* Allocate enough space for the code block */
cUnit->codeBuffer = (unsigned char *)dvmCompilerNew(chainCellOffset, true);
if (cUnit->codeBuffer == NULL) {
- LOGE("Code buffer allocation failure\n");
+ LOGE("Code buffer allocation failure");
info->discardResult = true;
return;
}
@@ -1604,7 +1604,7 @@ void* dvmJitChain(void* tgtAddr, u4* branchAddr)
gDvmJit.translationChains++;
COMPILER_TRACE_CHAINING(
- LOGD("Jit Runtime: chaining 0x%x to 0x%x\n",
+ LOGD("Jit Runtime: chaining 0x%x to 0x%x",
(int) branchAddr, (int) tgtAddr & -2));
/*
diff --git a/vm/compiler/codegen/arm/CodegenDriver.cpp b/vm/compiler/codegen/arm/CodegenDriver.cpp
index b9429a99e..af2897f06 100644
--- a/vm/compiler/codegen/arm/CodegenDriver.cpp
+++ b/vm/compiler/codegen/arm/CodegenDriver.cpp
@@ -1477,7 +1477,7 @@ static bool handleFmt10x(CompilationUnit *cUnit, MIR *mir)
{
Opcode dalvikOpcode = mir->dalvikInsn.opcode;
if ((dalvikOpcode >= OP_UNUSED_3E) && (dalvikOpcode <= OP_UNUSED_43)) {
- LOGE("Codegen: got unused opcode 0x%x\n",dalvikOpcode);
+ LOGE("Codegen: got unused opcode 0x%x",dalvikOpcode);
return true;
}
switch (dalvikOpcode) {
@@ -1491,7 +1491,7 @@ static bool handleFmt10x(CompilationUnit *cUnit, MIR *mir)
case OP_UNUSED_79:
case OP_UNUSED_7A:
case OP_DISPATCH_FF:
- LOGE("Codegen: got unused opcode 0x%x\n",dalvikOpcode);
+ LOGE("Codegen: got unused opcode 0x%x",dalvikOpcode);
return true;
case OP_NOP:
break;
@@ -2155,7 +2155,7 @@ static bool handleFmt21t(CompilationUnit *cUnit, MIR *mir, BasicBlock *bb,
break;
default:
cond = (ArmConditionCode)0;
- LOGE("Unexpected opcode (%d) for Fmt21t\n", dalvikOpcode);
+ LOGE("Unexpected opcode (%d) for Fmt21t", dalvikOpcode);
dvmCompilerAbort(cUnit);
}
genConditionalBranch(cUnit, cond, &labelList[bb->taken->id]);
@@ -2700,7 +2700,7 @@ static bool handleFmt22t(CompilationUnit *cUnit, MIR *mir, BasicBlock *bb,
break;
default:
cond = (ArmConditionCode)0;
- LOGE("Unexpected opcode (%d) for Fmt22t\n", dalvikOpcode);
+ LOGE("Unexpected opcode (%d) for Fmt22t", dalvikOpcode);
dvmCompilerAbort(cUnit);
}
genConditionalBranch(cUnit, cond, &labelList[bb->taken->id]);
@@ -4547,7 +4547,7 @@ void dvmCompilerMIR2LIR(CompilationUnit *cUnit)
}
}
if (notHandled) {
- LOGE("%#06x: Opcode 0x%x (%s) / Fmt %d not handled\n",
+ LOGE("%#06x: Opcode 0x%x (%s) / Fmt %d not handled",
mir->offset,
dalvikOpcode, dexGetOpcodeName(dalvikOpcode),
dalvikFormat);
diff --git a/vm/compiler/codegen/arm/armv7-a-neon/MethodCodegenDriver.cpp b/vm/compiler/codegen/arm/armv7-a-neon/MethodCodegenDriver.cpp
index 32065aebd..7112d10dc 100644
--- a/vm/compiler/codegen/arm/armv7-a-neon/MethodCodegenDriver.cpp
+++ b/vm/compiler/codegen/arm/armv7-a-neon/MethodCodegenDriver.cpp
@@ -400,7 +400,7 @@ static bool methodBlockCodeGen(CompilationUnit *cUnit, BasicBlock *bb)
}
if (notHandled) {
- LOGE("%#06x: Opcode 0x%x (%s) / Fmt %d not handled\n",
+ LOGE("%#06x: Opcode 0x%x (%s) / Fmt %d not handled",
mir->offset,
dalvikOpcode, dexGetOpcodeName(dalvikOpcode),
dalvikFormat);
diff --git a/vm/hprof/Hprof.cpp b/vm/hprof/Hprof.cpp
index 18439b31c..ff8e87287 100644
--- a/vm/hprof/Hprof.cpp
+++ b/vm/hprof/Hprof.cpp
@@ -43,7 +43,7 @@ hprof_context_t* hprofStartup(const char *outputFileName, int fd,
hprof_context_t *ctx = (hprof_context_t *)malloc(sizeof(*ctx));
if (ctx == NULL) {
- LOGE("hprof: can't allocate context.\n");
+ LOGE("hprof: can't allocate context.");
return NULL;
}
@@ -69,14 +69,14 @@ bool hprofShutdown(hprof_context_t *tailCtx)
*/
hprof_context_t *headCtx = (hprof_context_t *)malloc(sizeof(*headCtx));
if (headCtx == NULL) {
- LOGE("hprof: can't allocate context.\n");
+ LOGE("hprof: can't allocate context.");
hprofFreeContext(tailCtx);
return false;
}
hprofContextInit(headCtx, strdup(tailCtx->fileName), tailCtx->fd, true,
tailCtx->directToDdms);
- LOGI("hprof: dumping heap strings to \"%s\".\n", tailCtx->fileName);
+ LOGI("hprof: dumping heap strings to \"%s\".", tailCtx->fileName);
hprofDumpStrings(headCtx);
hprofDumpClasses(headCtx);
@@ -115,13 +115,13 @@ bool hprofShutdown(hprof_context_t *tailCtx)
if (headCtx->fd >= 0) {
outFd = dup(headCtx->fd);
if (outFd < 0) {
- LOGE("dup(%d) failed: %s\n", headCtx->fd, strerror(errno));
+ LOGE("dup(%d) failed: %s", headCtx->fd, strerror(errno));
/* continue to fail-handler below */
}
} else {
outFd = open(tailCtx->fileName, O_WRONLY|O_CREAT|O_TRUNC, 0644);
if (outFd < 0) {
- LOGE("can't open %s: %s\n", headCtx->fileName, strerror(errno));
+ LOGE("can't open %s: %s", headCtx->fileName, strerror(errno));
/* continue to fail-handler below */
}
}
@@ -145,7 +145,7 @@ bool hprofShutdown(hprof_context_t *tailCtx)
}
/* throw out a log message for the benefit of "runhat" */
- LOGI("hprof: heap dump completed (%dKB)\n",
+ LOGI("hprof: heap dump completed (%dKB)",
(headCtx->fileDataSize + tailCtx->fileDataSize + 1023) / 1024);
hprofFreeContext(headCtx);
diff --git a/vm/hprof/HprofOutput.cpp b/vm/hprof/HprofOutput.cpp
index 0644a887f..63934381e 100644
--- a/vm/hprof/HprofOutput.cpp
+++ b/vm/hprof/HprofOutput.cpp
@@ -74,7 +74,7 @@ void hprofContextInit(hprof_context_t *ctx, char *fileName, int fd,
FILE* fp = open_memstream(&ctx->fileDataPtr, &ctx->fileDataSize);
if (fp == NULL) {
/* not expected */
- LOGE("hprof: open_memstream failed: %s\n", strerror(errno));
+ LOGE("hprof: open_memstream failed: %s", strerror(errno));
dvmAbort();
}
diff --git a/vm/interp/Interp.cpp b/vm/interp/Interp.cpp
index 7c68e903c..32ae3ec6f 100644
--- a/vm/interp/Interp.cpp
+++ b/vm/interp/Interp.cpp
@@ -243,7 +243,7 @@ static bool dvmBreakpointSetAdd(BreakpointSet* pSet, Method* method,
int newSize = pSet->alloc + kBreakpointGrowth;
Breakpoint* newVec;
- LOGV("+++ increasing breakpoint set size to %d\n", newSize);
+ LOGV("+++ increasing breakpoint set size to %d", newSize);
/* pSet->breakpoints will be NULL on first entry */
newVec = (Breakpoint*)realloc(pSet->breakpoints, newSize * sizeof(Breakpoint));
@@ -275,10 +275,10 @@ static bool dvmBreakpointSetAdd(BreakpointSet* pSet, Method* method,
*/
assert(*(u1*)addr != OP_BREAKPOINT);
if (dvmIsClassVerified(method->clazz)) {
- LOGV("Class %s verified, adding breakpoint at %p\n",
+ LOGV("Class %s verified, adding breakpoint at %p",
method->clazz->descriptor, addr);
if (instructionIsMagicNop(addr)) {
- LOGV("Refusing to set breakpoint on %04x at %s.%s + 0x%x\n",
+ LOGV("Refusing to set breakpoint on %04x at %s.%s + 0x%x",
*addr, method->clazz->descriptor, method->name,
instrOffset);
} else {
@@ -287,7 +287,7 @@ static bool dvmBreakpointSetAdd(BreakpointSet* pSet, Method* method,
OP_BREAKPOINT);
}
} else {
- LOGV("Class %s NOT verified, deferring breakpoint at %p\n",
+ LOGV("Class %s NOT verified, deferring breakpoint at %p",
method->clazz->descriptor, addr);
}
} else {
@@ -317,11 +317,11 @@ static void dvmBreakpointSetRemove(BreakpointSet* pSet, Method* method,
if (idx < 0) {
/* breakpoint not found in set -- unexpected */
if (*(u1*)addr == OP_BREAKPOINT) {
- LOGE("Unable to restore breakpoint opcode (%s.%s +0x%x)\n",
+ LOGE("Unable to restore breakpoint opcode (%s.%s +0x%x)",
method->clazz->descriptor, method->name, instrOffset);
dvmAbort();
} else {
- LOGW("Breakpoint was already restored? (%s.%s +0x%x)\n",
+ LOGW("Breakpoint was already restored? (%s.%s +0x%x)",
method->clazz->descriptor, method->name, instrOffset);
}
} else {
@@ -372,10 +372,10 @@ static void dvmBreakpointSetFlush(BreakpointSet* pSet, ClassObject* clazz)
* It might already be there or it might not; either way,
* flush it out.
*/
- LOGV("Flushing breakpoint at %p for %s\n",
+ LOGV("Flushing breakpoint at %p for %s",
pBreak->addr, clazz->descriptor);
if (instructionIsMagicNop(pBreak->addr)) {
- LOGV("Refusing to flush breakpoint on %04x at %s.%s + 0x%x\n",
+ LOGV("Refusing to flush breakpoint on %04x at %s.%s + 0x%x",
*pBreak->addr, pBreak->method->clazz->descriptor,
pBreak->method->name, pBreak->addr - pBreak->method->insns);
} else {
@@ -396,7 +396,7 @@ void dvmInitBreakpoints()
BreakpointSet* pSet = gDvm.breakpointSet;
dvmBreakpointSetLock(pSet);
if (dvmBreakpointSetCount(pSet) != 0) {
- LOGW("WARNING: %d leftover breakpoints\n", dvmBreakpointSetCount(pSet));
+ LOGW("WARNING: %d leftover breakpoints", dvmBreakpointSetCount(pSet));
/* generally not good, but we can keep going */
}
dvmBreakpointSetUnlock(pSet);
@@ -462,7 +462,7 @@ u1 dvmGetOriginalOpcode(const u2* addr)
if (!dvmBreakpointSetOriginalOpcode(pSet, addr, &orig)) {
orig = *(u1*)addr;
if (orig == OP_BREAKPOINT) {
- LOGE("GLITCH: can't find breakpoint, opcode is still set\n");
+ LOGE("GLITCH: can't find breakpoint, opcode is still set");
dvmAbort();
}
}
@@ -505,7 +505,7 @@ bool dvmAddSingleStep(Thread* thread, int size, int depth)
StepControl* pCtrl = &gDvm.stepControl;
if (pCtrl->active && thread != pCtrl->thread) {
- LOGW("WARNING: single-step active for %p; adding %p\n",
+ LOGW("WARNING: single-step active for %p; adding %p",
pCtrl->thread, thread);
/*
@@ -552,7 +552,7 @@ bool dvmAddSingleStep(Thread* thread, int size, int depth)
prevFp = fp;
}
if (fp == NULL) {
- LOGW("Unexpected: step req in native-only threadid=%d\n",
+ LOGW("Unexpected: step req in native-only threadid=%d",
thread->threadId);
return false;
}
@@ -562,7 +562,7 @@ bool dvmAddSingleStep(Thread* thread, int size, int depth)
* frames are only inserted when calling from native->interp, so we
* don't need to worry about one being here.
*/
- LOGV("##### init step while in native method\n");
+ LOGV("##### init step while in native method");
fp = prevFp;
assert(!dvmIsBreakFrame((u4*)fp));
assert(dvmIsNativeMethod(SAVEAREA_FROM_FP(fp)->method));
@@ -592,7 +592,7 @@ bool dvmAddSingleStep(Thread* thread, int size, int depth)
dvmComputeVagueFrameDepth(thread, thread->interpSave.curFrame);
pCtrl->active = true;
- LOGV("##### step init: thread=%p meth=%p '%s' line=%d frameDepth=%d depth=%s size=%s\n",
+ LOGV("##### step init: thread=%p meth=%p '%s' line=%d frameDepth=%d depth=%s size=%s",
pCtrl->thread, pCtrl->method, pCtrl->method->name,
pCtrl->line, pCtrl->frameDepth,
dvmJdwpStepDepthStr(pCtrl->depth),
@@ -754,7 +754,7 @@ static void updateDebugger(const Method* method, const u2* pc, const u4* fp,
* we may or may not actually send a message to the debugger.
*/
if (GET_OPCODE(*pc) == OP_BREAKPOINT) {
- LOGV("+++ breakpoint hit at %p\n", pc);
+ LOGV("+++ breakpoint hit at %p", pc);
eventFlags |= DBG_BREAKPOINT;
}
@@ -829,7 +829,7 @@ static void updateDebugger(const Method* method, const u2* pc, const u4* fp,
}
if (doStop) {
- LOGV("#####S %s\n", msg);
+ LOGV("#####S %s", msg);
eventFlags |= DBG_SINGLE_STEP;
}
}
@@ -865,7 +865,7 @@ static void updateDebugger(const Method* method, const u2* pc, const u4* fp,
* during single-step.
*/
char* desc = dexProtoCopyMethodDescriptor(&method->prototype);
- LOGE("HEY: invalid 'this' ptr %p (%s.%s %s)\n", thisPtr,
+ LOGE("HEY: invalid 'this' ptr %p (%s.%s %s)", thisPtr,
method->clazz->descriptor, method->name, desc);
free(desc);
dvmAbort();
@@ -920,15 +920,15 @@ void dvmInterpCheckTrackedRefs(Thread* self, const Method* method,
count = dvmReferenceTableEntries(&self->internalLocalRefTable);
- LOGE("TRACK: unreleased internal reference (prev=%d total=%d)\n",
+ LOGE("TRACK: unreleased internal reference (prev=%d total=%d)",
debugTrackedRefStart, count);
desc = dexProtoCopyMethodDescriptor(&method->prototype);
- LOGE(" current method is %s.%s %s\n", method->clazz->descriptor,
+ LOGE(" current method is %s.%s %s", method->clazz->descriptor,
method->name, desc);
free(desc);
top = self->internalLocalRefTable.table + debugTrackedRefStart;
while (top < self->internalLocalRefTable.nextEntry) {
- LOGE(" %p (%s)\n",
+ LOGE(" %p (%s)",
*top,
((*top)->clazz != NULL) ? (*top)->clazz->descriptor : "");
top++;
@@ -937,7 +937,7 @@ void dvmInterpCheckTrackedRefs(Thread* self, const Method* method,
dvmAbort();
}
- //LOGI("TRACK OK\n");
+ //LOGI("TRACK OK");
}
#endif
@@ -952,14 +952,14 @@ void dvmDumpRegs(const Method* method, const u4* framePtr, bool inOnly)
localCount = method->registersSize - method->insSize;
- LOG(LOG_VERBOSE, LOG_TAG"i", "Registers (fp=%p):\n", framePtr);
+ LOG(LOG_VERBOSE, LOG_TAG"i", "Registers (fp=%p):", framePtr);
for (i = method->registersSize-1; i >= 0; i--) {
if (i >= localCount) {
- LOG(LOG_VERBOSE, LOG_TAG"i", " v%-2d in%-2d : 0x%08x\n",
+ LOG(LOG_VERBOSE, LOG_TAG"i", " v%-2d in%-2d : 0x%08x",
i, i-localCount, framePtr[i]);
} else {
if (inOnly) {
- LOG(LOG_VERBOSE, LOG_TAG"i", " [...]\n");
+ LOG(LOG_VERBOSE, LOG_TAG"i", " [...]");
break;
}
const char* name = "";
@@ -976,7 +976,7 @@ void dvmDumpRegs(const Method* method, const u4* framePtr, bool inOnly)
}
}
#endif
- LOG(LOG_VERBOSE, LOG_TAG"i", " v%-2d : 0x%08x %s\n",
+ LOG(LOG_VERBOSE, LOG_TAG"i", " v%-2d : 0x%08x %s",
i, framePtr[i], name);
}
}
@@ -1043,7 +1043,7 @@ s4 dvmInterpHandlePackedSwitch(const u2* switchData, s4 testVal)
firstKey |= (*switchData++) << 16;
if (testVal < firstKey || testVal >= firstKey + size) {
- LOGVV("Value %d not found in switch (%d-%d)\n",
+ LOGVV("Value %d not found in switch (%d-%d)",
testVal, firstKey, firstKey+size-1);
return kInstrLen;
}
@@ -1055,7 +1055,7 @@ s4 dvmInterpHandlePackedSwitch(const u2* switchData, s4 testVal)
assert(((u4)entries & 0x3) == 0);
assert(testVal - firstKey >= 0 && testVal - firstKey < size);
- LOGVV("Value %d found in slot %d (goto 0x%02x)\n",
+ LOGVV("Value %d found in slot %d (goto 0x%02x)",
testVal, testVal - firstKey,
s4FromSwitchData(&entries[testVal - firstKey]));
return s4FromSwitchData(&entries[testVal - firstKey]);
@@ -1120,13 +1120,13 @@ s4 dvmInterpHandleSparseSwitch(const u2* switchData, s4 testVal)
} else if (testVal > foundVal) {
lo = mid + 1;
} else {
- LOGVV("Value %d found in entry %d (goto 0x%02x)\n",
+ LOGVV("Value %d found in entry %d (goto 0x%02x)",
testVal, mid, s4FromSwitchData(&entries[mid]));
return s4FromSwitchData(&entries[mid]);
}
}
- LOGVV("Value %d not found in switch\n", testVal);
+ LOGVV("Value %d not found in switch", testVal);
return kInstrLen;
}
@@ -1179,7 +1179,7 @@ static void copySwappedArrayData(void* dest, const u2* src, u4 size, u2 width)
}
break;
default:
- LOGE("Unexpected width %d in copySwappedArrayData\n", width);
+ LOGE("Unexpected width %d in copySwappedArrayData", width);
dvmAbort();
break;
}
@@ -1251,7 +1251,7 @@ Method* dvmInterpFindInterfaceMethod(ClassObject* thisClass, u4 methodIdx,
if (absMethod == NULL) {
absMethod = dvmResolveInterfaceMethod(method->clazz, methodIdx);
if (absMethod == NULL) {
- LOGV("+ unknown method\n");
+ LOGV("+ unknown method");
return NULL;
}
}
@@ -1298,7 +1298,7 @@ Method* dvmInterpFindInterfaceMethod(ClassObject* thisClass, u4 methodIdx,
methodToCall->nativeFunc != NULL);
#endif
- LOGVV("+++ interface=%s.%s concrete=%s.%s\n",
+ LOGVV("+++ interface=%s.%s concrete=%s.%s",
absMethod->clazz->descriptor, absMethod->name,
methodToCall->clazz->descriptor, methodToCall->name);
assert(methodToCall != NULL);
@@ -1361,7 +1361,7 @@ static char* fieldNameFromIndex(const Method* method, int ref,
const char* fieldName;
if (refType != VERIFY_ERROR_REF_FIELD) {
- LOGW("Expected ref type %d, got %d\n", VERIFY_ERROR_REF_FIELD, refType);
+ LOGW("Expected ref type %d, got %d", VERIFY_ERROR_REF_FIELD, refType);
return NULL; /* no message */
}
@@ -1395,7 +1395,7 @@ static char* methodNameFromIndex(const Method* method, int ref,
const char* methodName;
if (refType != VERIFY_ERROR_REF_METHOD) {
- LOGW("Expected ref type %d, got %d\n", VERIFY_ERROR_REF_METHOD,refType);
+ LOGW("Expected ref type %d, got %d", VERIFY_ERROR_REF_METHOD,refType);
return NULL; /* no message */
}
@@ -1743,7 +1743,7 @@ void dvmCheckBefore(const u2 *pc, u4 *fp, Thread* self)
strcmp(method->name, mn) == 0 &&
strcmp(method->shorty, sg) == 0)
{
- LOGW("Reached %s.%s, enabling verbose mode\n",
+ LOGW("Reached %s.%s, enabling verbose mode",
method->clazz->descriptor, method->name);
android_setMinPriority(LOG_TAG"i", ANDROID_LOG_VERBOSE);
dumpRegs(method, fp, true);
@@ -1964,7 +1964,7 @@ void dvmInterpret(Thread* self, const Method* method, JValue* pResult)
if (method->clazz->status < CLASS_INITIALIZING ||
method->clazz->status == CLASS_ERROR)
{
- LOGE("ERROR: tried to execute code in unprepared class '%s' (%d)\n",
+ LOGE("ERROR: tried to execute code in unprepared class '%s' (%d)",
method->clazz->descriptor, method->clazz->status);
dvmDumpThread(self, false);
dvmAbort();
diff --git a/vm/interp/Stack.cpp b/vm/interp/Stack.cpp
index c65a78e13..9f6c1cf7a 100644
--- a/vm/interp/Stack.cpp
+++ b/vm/interp/Stack.cpp
@@ -114,7 +114,7 @@ static bool dvmPushInterpFrame(Thread* self, const Method* method)
saveBlock->xtra.currentPc = NULL; // not required?
saveBlock->method = method;
- LOGVV("PUSH frame: old=%p new=%p (size=%d)\n",
+ LOGVV("PUSH frame: old=%p new=%p (size=%d)",
self->interpSave.curFrame, FP_FROM_SAVEAREA(saveBlock),
(u1*)self->interpSave.curFrame - (u1*)FP_FROM_SAVEAREA(saveBlock));
@@ -193,7 +193,7 @@ bool dvmPushJNIFrame(Thread* self, const Method* method)
saveBlock->xtra.localRefCookie = self->jniLocalRefTable.segmentState.all;
saveBlock->method = method;
- LOGVV("PUSH JNI frame: old=%p new=%p (size=%d)\n",
+ LOGVV("PUSH JNI frame: old=%p new=%p (size=%d)",
self->interpSave.curFrame, FP_FROM_SAVEAREA(saveBlock),
(u1*)self->interpSave.curFrame - (u1*)FP_FROM_SAVEAREA(saveBlock));
@@ -253,7 +253,7 @@ bool dvmPushLocalFrame(Thread* self, const Method* method)
saveBlock->xtra.localRefCookie = self->jniLocalRefTable.segmentState.all;
saveBlock->method = method;
- LOGVV("PUSH JNI local frame: old=%p new=%p (size=%d)\n",
+ LOGVV("PUSH JNI local frame: old=%p new=%p (size=%d)",
self->interpSave.curFrame, FP_FROM_SAVEAREA(saveBlock),
(u1*)self->interpSave.curFrame - (u1*)FP_FROM_SAVEAREA(saveBlock));
@@ -284,7 +284,7 @@ bool dvmPopLocalFrame(Thread* self)
return false;
}
- LOGVV("POP JNI local frame: removing %s, now %s\n",
+ LOGVV("POP JNI local frame: removing %s, now %s",
saveBlock->method->name,
SAVEAREA_FROM_FP(saveBlock->prevFrame)->method->name);
dvmPopJniLocals(self, saveBlock);
@@ -320,7 +320,7 @@ static bool dvmPopFrame(Thread* self)
/* probably a native->native JNI call */
if (dvmIsNativeMethod(saveBlock->method)) {
- LOGVV("Popping JNI stack frame for %s.%s%s\n",
+ LOGVV("Popping JNI stack frame for %s.%s%s",
saveBlock->method->clazz->descriptor,
saveBlock->method->name,
(SAVEAREA_FROM_FP(saveBlock->prevFrame)->method == NULL) ?
@@ -331,12 +331,12 @@ static bool dvmPopFrame(Thread* self)
saveBlock = SAVEAREA_FROM_FP(saveBlock->prevFrame);
}
if (saveBlock->method != NULL) {
- LOGE("PopFrame missed the break\n");
+ LOGE("PopFrame missed the break");
assert(false);
dvmAbort(); // stack trashed -- nowhere to go in this thread
}
- LOGVV("POP frame: cur=%p new=%p\n",
+ LOGVV("POP frame: cur=%p new=%p",
self->interpSave.curFrame, saveBlock->prevFrame);
self->interpSave.curFrame = saveBlock->prevFrame;
@@ -355,7 +355,7 @@ static ClassObject* callPrep(Thread* self, const Method* method, Object* obj,
#ifndef NDEBUG
if (self->status != THREAD_RUNNING) {
- LOGW("threadid=%d: status=%d on call to %s.%s -\n",
+ LOGW("threadid=%d: status=%d on call to %s.%s -",
self->threadId, self->status,
method->clazz->descriptor, method->name);
}
@@ -371,7 +371,7 @@ static ClassObject* callPrep(Thread* self, const Method* method, Object* obj,
IF_LOGVV() {
char* desc = dexProtoCopyMethodDescriptor(&method->prototype);
- LOGVV("thread=%d native code calling %s.%s %s\n", self->threadId,
+ LOGVV("thread=%d native code calling %s.%s %s", self->threadId,
clazz->descriptor, method->name, desc);
free(desc);
}
@@ -451,7 +451,7 @@ void dvmCallMethodV(Thread* self, const Method* method, Object* obj,
ins = ((u4*)self->interpSave.curFrame) +
(method->registersSize - method->insSize);
- //LOGD(" FP is %p, INs live at >= %p\n", self->interpSave.curFrame, ins);
+ //LOGD(" FP is %p, INs live at >= %p", self->interpSave.curFrame, ins);
/* put "this" pointer into in0 if appropriate */
if (!dvmIsStaticMethod(method)) {
@@ -501,7 +501,7 @@ void dvmCallMethodV(Thread* self, const Method* method, Object* obj,
#ifndef NDEBUG
if (verifyCount != method->insSize) {
- LOGE("Got vfycount=%d insSize=%d for %s.%s\n", verifyCount,
+ LOGE("Got vfycount=%d insSize=%d for %s.%s", verifyCount,
method->insSize, clazz->descriptor, method->name);
assert(false);
goto bail;
@@ -597,7 +597,7 @@ void dvmCallMethodA(Thread* self, const Method* method, Object* obj,
*ins++ = args->z; /* 8 bits, zero or non-zero */
break;
default:
- LOGE("Invalid char %c in short signature of %s.%s\n",
+ LOGE("Invalid char %c in short signature of %s.%s",
*(desc-1), clazz->descriptor, method->name);
assert(false);
goto bail;
@@ -609,7 +609,7 @@ void dvmCallMethodA(Thread* self, const Method* method, Object* obj,
#ifndef NDEBUG
if (verifyCount != method->insSize) {
- LOGE("Got vfycount=%d insSize=%d for %s.%s\n", verifyCount,
+ LOGE("Got vfycount=%d insSize=%d for %s.%s", verifyCount,
method->insSize, clazz->descriptor, method->name);
assert(false);
goto bail;
@@ -692,7 +692,7 @@ Object* dvmInvokeMethod(Object* obj, const Method* method,
(method->registersSize - method->insSize);
verifyCount = 0;
- //LOGD(" FP is %p, INs live at >= %p\n", self->interpSave.curFrame, ins);
+ //LOGD(" FP is %p, INs live at >= %p", self->interpSave.curFrame, ins);
/* put "this" pointer into in0 if appropriate */
if (!dvmIsStaticMethod(method)) {
@@ -722,7 +722,7 @@ Object* dvmInvokeMethod(Object* obj, const Method* method,
#ifndef NDEBUG
if (verifyCount != method->insSize) {
- LOGE("Got vfycount=%d insSize=%d for %s.%s\n", verifyCount,
+ LOGE("Got vfycount=%d insSize=%d for %s.%s", verifyCount,
method->insSize, clazz->descriptor, method->name);
assert(false);
goto bail;
@@ -1012,22 +1012,22 @@ void dvmHandleStackOverflow(Thread* self, const Method* method)
/*
* Already did, nothing to do but bail.
*/
- LOGE("DalvikVM: double-overflow of stack in threadid=%d; aborting\n",
+ LOGE("DalvikVM: double-overflow of stack in threadid=%d; aborting",
self->threadId);
dvmDumpThread(self, false);
dvmAbort();
}
/* open it up to the full range */
- LOGI("threadid=%d: stack overflow on call to %s.%s:%s\n",
+ LOGI("threadid=%d: stack overflow on call to %s.%s:%s",
self->threadId,
method->clazz->descriptor, method->name, method->shorty);
StackSaveArea* saveArea = SAVEAREA_FROM_FP(self->interpSave.curFrame);
- LOGI(" method requires %d+%d+%d=%d bytes, fp is %p (%d left)\n",
+ LOGI(" method requires %d+%d+%d=%d bytes, fp is %p (%d left)",
method->registersSize * 4, sizeof(StackSaveArea), method->outsSize * 4,
(method->registersSize + method->outsSize) * 4 + sizeof(StackSaveArea),
saveArea, (u1*) saveArea - self->interpStackEnd);
- LOGI(" expanding stack end (%p to %p)\n", self->interpStackEnd,
+ LOGI(" expanding stack end (%p to %p)", self->interpStackEnd,
self->interpStackStart - self->interpStackSize);
//dvmDumpThread(self, false);
self->interpStackEnd = self->interpStackStart - self->interpStackSize;
@@ -1041,7 +1041,7 @@ void dvmHandleStackOverflow(Thread* self, const Method* method)
*/
Object* excep = dvmGetException(self);
if (excep != NULL) {
- LOGW("Stack overflow while throwing exception\n");
+ LOGW("Stack overflow while throwing exception");
dvmClearException(self);
}
dvmThrowChainedException(gDvm.exStackOverflowError, NULL, excep);
@@ -1065,7 +1065,7 @@ void dvmCleanupStackOverflow(Thread* self, const Object* exception)
newStackEnd = (self->interpStackStart - self->interpStackSize)
+ STACK_OVERFLOW_RESERVE;
if ((u1*)self->interpSave.curFrame <= newStackEnd) {
- LOGE("Can't shrink stack: curFrame is in reserved area (%p %p)\n",
+ LOGE("Can't shrink stack: curFrame is in reserved area (%p %p)",
self->interpStackEnd, self->interpSave.curFrame);
dvmDumpThread(self, false);
dvmAbort();
@@ -1074,7 +1074,7 @@ void dvmCleanupStackOverflow(Thread* self, const Object* exception)
self->interpStackEnd = newStackEnd;
self->stackOverflowed = false;
- LOGI("Shrank stack (to %p, curFrame is %p)\n", self->interpStackEnd,
+ LOGI("Shrank stack (to %p, curFrame is %p)", self->interpStackEnd,
self->interpSave.curFrame);
}
@@ -1105,7 +1105,7 @@ static bool extractMonitorEnterObject(Thread* thread, Object** pLockObj,
/* check Method* */
if (!dvmLinearAllocContains(method, sizeof(Method))) {
- LOGD("ExtrMon: method %p not valid\n", method);
+ LOGD("ExtrMon: method %p not valid", method);
return false;
}
@@ -1114,14 +1114,14 @@ static bool extractMonitorEnterObject(Thread* thread, Object** pLockObj,
if (currentPc < method->insns ||
currentPc >= method->insns + insnsSize)
{
- LOGD("ExtrMon: insns %p not valid (%p - %p)\n",
+ LOGD("ExtrMon: insns %p not valid (%p - %p)",
currentPc, method->insns, method->insns + insnsSize);
return false;
}
/* check the instruction */
if ((*currentPc & 0xff) != OP_MONITOR_ENTER) {
- LOGD("ExtrMon: insn at %p is not monitor-enter (0x%02x)\n",
+ LOGD("ExtrMon: insn at %p is not monitor-enter (0x%02x)",
currentPc, *currentPc & 0xff);
return false;
}
@@ -1129,7 +1129,7 @@ static bool extractMonitorEnterObject(Thread* thread, Object** pLockObj,
/* get and check the register index */
unsigned int reg = *currentPc >> 8;
if (reg >= method->registersSize) {
- LOGD("ExtrMon: invalid register %d (max %d)\n",
+ LOGD("ExtrMon: invalid register %d (max %d)",
reg, method->registersSize);
return false;
}
@@ -1138,7 +1138,7 @@ static bool extractMonitorEnterObject(Thread* thread, Object** pLockObj,
u4* fp = (u4*) framePtr;
Object* obj = (Object*) fp[reg];
if (!dvmIsValidObject(obj)) {
- LOGD("ExtrMon: invalid object %p at %p[%d]\n", obj, fp, reg);
+ LOGD("ExtrMon: invalid object %p at %p[%d]", obj, fp, reg);
return false;
}
*pLockObj = obj;
@@ -1288,7 +1288,7 @@ static void dumpFrames(const DebugOutputTarget* target, void* framePtr,
first = false;
if (saveArea->prevFrame != NULL && saveArea->prevFrame <= framePtr) {
- LOGW("Warning: loop in stack trace at frame %d (%p -> %p)\n",
+ LOGW("Warning: loop in stack trace at frame %d (%p -> %p)",
checkCount, framePtr, saveArea->prevFrame);
break;
}
@@ -1358,7 +1358,7 @@ void dvmDumpRunningThreadStack(const DebugOutputTarget* target, Thread* thread)
/*
* Run through the stack and rewrite the "prev" pointers.
*/
- //LOGI("DR: fpOff=%d (from %p %p)\n",fpOffset, origStack,
+ //LOGI("DR: fpOff=%d (from %p %p)",fpOffset, origStack,
// thread->interpSave.curFrame);
fp = stackCopy + fpOffset;
while (true) {
diff --git a/vm/jdwp/ExpandBuf.cpp b/vm/jdwp/ExpandBuf.cpp
index 8162128b8..b8ff9337a 100644
--- a/vm/jdwp/ExpandBuf.cpp
+++ b/vm/jdwp/ExpandBuf.cpp
@@ -95,7 +95,7 @@ static void ensureSpace(ExpandBuf* pBuf, int newCount)
newPtr = (u1*) realloc(pBuf->storage, pBuf->maxLen);
if (newPtr == NULL) {
- LOGE("realloc(%d) failed\n", pBuf->maxLen);
+ LOGE("realloc(%d) failed", pBuf->maxLen);
abort();
}
diff --git a/vm/jdwp/JdwpAdb.cpp b/vm/jdwp/JdwpAdb.cpp
index 4614069c4..84abe3a54 100644
--- a/vm/jdwp/JdwpAdb.cpp
+++ b/vm/jdwp/JdwpAdb.cpp
@@ -122,7 +122,7 @@ static bool startup(struct JdwpState* state, const JdwpStartupParams* pParams)
{
JdwpNetState* netState;
- LOGV("ADB transport startup\n");
+ LOGV("ADB transport startup");
state->netState = netState = adbStateAlloc();
if (netState == NULL)
@@ -172,10 +172,10 @@ static int receiveClientFd(JdwpNetState* netState)
if (ret <= 0) {
if (ret < 0) {
- LOGW("receiving file descriptor from ADB failed (socket %d): %s\n",
+ LOGW("receiving file descriptor from ADB failed (socket %d): %s",
netState->controlSock, strerror(errno));
} else {
- LOGD("adbd disconnected\n");
+ LOGD("adbd disconnected");
}
close(netState->controlSock);
netState->controlSock = -1;
@@ -210,7 +210,7 @@ retry:
netState->controlSock = socket(PF_UNIX, SOCK_STREAM, 0);
if (netState->controlSock < 0) {
- LOGE("Could not create ADB control socket:%s\n",
+ LOGE("Could not create ADB control socket:%s",
strerror(errno));
return false;
}
@@ -254,15 +254,15 @@ retry:
} while (ret < 0 && errno == EINTR);
if (ret >= 0) {
- LOGV("PID sent as '%.*s' to ADB\n", 4, buff);
+ LOGV("PID sent as '%.*s' to ADB", 4, buff);
break;
}
- LOGE("Weird, can't send JDWP process pid to ADB: %s\n",
+ LOGE("Weird, can't send JDWP process pid to ADB: %s",
strerror(errno));
return false;
}
- LOGV("Can't connect to ADB control socket:%s\n",
+ LOGV("Can't connect to ADB control socket:%s",
strerror(errno));
usleep( sleep_ms*1000 );
@@ -273,7 +273,7 @@ retry:
}
}
- LOGV("trying to receive file descriptor from ADB\n");
+ LOGV("trying to receive file descriptor from ADB");
/* now we can receive a client file descriptor */
netState->clientSock = receiveClientFd(netState);
if (netState->shuttingDown)
@@ -281,12 +281,12 @@ retry:
if (netState->clientSock < 0) {
if (++retryCount > 5) {
- LOGE("adb connection max retries exceeded\n");
+ LOGE("adb connection max retries exceeded");
return false;
}
goto retry;
} else {
- LOGV("received file descriptor %d from ADB\n", netState->clientSock);
+ LOGV("received file descriptor %d from ADB", netState->clientSock);
netState->awaitingHandshake = 1;
netState->inputCount = 0;
return true;
@@ -315,7 +315,7 @@ static void closeConnection(struct JdwpState* state)
if (netState->clientSock < 0)
return;
- LOGV("+++ closed JDWP <-> ADB connection\n");
+ LOGV("+++ closed JDWP <-> ADB connection");
close(netState->clientSock);
netState->clientSock = -1;
@@ -350,7 +350,7 @@ static void adbStateShutdown(struct JdwpNetState* netState)
}
if (netState->wakeFds[1] >= 0) {
- LOGV("+++ writing to wakePipe\n");
+ LOGV("+++ writing to wakePipe");
write(netState->wakeFds[1], "", 1);
}
}
@@ -476,20 +476,20 @@ static bool handlePacket(JdwpState* state)
cc = write(netState->clientSock, expandBufGetBuffer(pReply),
expandBufGetLength(pReply));
if (cc != (int) expandBufGetLength(pReply)) {
- LOGE("Failed sending reply to debugger: %s\n", strerror(errno));
+ LOGE("Failed sending reply to debugger: %s", strerror(errno));
expandBufFree(pReply);
return false;
}
} else {
- LOGW("No reply created for set=%d cmd=%d\n", cmdSet, cmd);
+ LOGW("No reply created for set=%d cmd=%d", cmdSet, cmd);
}
expandBufFree(pReply);
} else {
- LOGV("reply?!\n");
+ LOGV("reply?!");
assert(false);
}
- LOGV("----------\n");
+ LOGV("----------");
consumeBytes(netState, length);
return true;
@@ -547,11 +547,11 @@ static bool processIncoming(JdwpState* state)
if (maxfd < fd)
maxfd = fd;
} else {
- LOGI("NOTE: entering select w/o wakepipe\n");
+ LOGI("NOTE: entering select w/o wakepipe");
}
if (maxfd < 0) {
- LOGV("+++ all fds are closed\n");
+ LOGV("+++ all fds are closed");
return false;
}
@@ -571,14 +571,14 @@ static bool processIncoming(JdwpState* state)
if (selCount < 0) {
if (errno == EINTR)
continue;
- LOGE("select failed: %s\n", strerror(errno));
+ LOGE("select failed: %s", strerror(errno));
goto fail;
}
if (netState->wakeFds[0] >= 0 &&
FD_ISSET(netState->wakeFds[0], &readfds))
{
- LOGD("Got wake-up signal, bailing out of select\n");
+ LOGD("Got wake-up signal, bailing out of select");
goto fail;
}
if (netState->controlSock >= 0 &&
@@ -586,7 +586,7 @@ static bool processIncoming(JdwpState* state)
{
int sock = receiveClientFd(netState);
if (sock >= 0) {
- LOGI("Ignoring second debugger -- accepting and dropping\n");
+ LOGI("Ignoring second debugger -- accepting and dropping");
close(sock);
} else {
assert(netState->controlSock < 0);
@@ -607,11 +607,11 @@ static bool processIncoming(JdwpState* state)
/* read failed */
if (errno != EINTR)
goto fail;
- LOGD("+++ EINTR hit\n");
+ LOGD("+++ EINTR hit");
return true;
} else if (readCount == 0) {
/* EOF hit -- far end went away */
- LOGV("+++ peer disconnected\n");
+ LOGV("+++ peer disconnected");
goto fail;
} else
break;
@@ -637,7 +637,7 @@ static bool processIncoming(JdwpState* state)
if (memcmp(netState->inputBuffer,
kMagicHandshake, kMagicHandshakeLen) != 0)
{
- LOGE("ERROR: bad handshake '%.14s'\n", netState->inputBuffer);
+ LOGE("ERROR: bad handshake '%.14s'", netState->inputBuffer);
goto fail;
}
@@ -645,14 +645,14 @@ static bool processIncoming(JdwpState* state)
cc = write(netState->clientSock, netState->inputBuffer,
kMagicHandshakeLen);
if (cc != kMagicHandshakeLen) {
- LOGE("Failed writing handshake bytes: %s (%d of %d)\n",
+ LOGE("Failed writing handshake bytes: %s (%d of %d)",
strerror(errno), cc, (int) kMagicHandshakeLen);
goto fail;
}
consumeBytes(netState, kMagicHandshakeLen);
netState->awaitingHandshake = false;
- LOGV("+++ handshake complete\n");
+ LOGV("+++ handshake complete");
return true;
}
@@ -681,7 +681,7 @@ static bool sendRequest(JdwpState* state, ExpandBuf* pReq)
if (netState->clientSock < 0) {
/* can happen with some DDMS events */
- LOGV("NOT sending request -- no debugger is attached\n");
+ LOGV("NOT sending request -- no debugger is attached");
return false;
}
@@ -694,7 +694,7 @@ static bool sendRequest(JdwpState* state, ExpandBuf* pReq)
cc = write(netState->clientSock, expandBufGetBuffer(pReq),
expandBufGetLength(pReq));
if (cc != (int) expandBufGetLength(pReq)) {
- LOGE("Failed sending req to debugger: %s (%d of %d)\n",
+ LOGE("Failed sending req to debugger: %s (%d of %d)",
strerror(errno), cc, (int) expandBufGetLength(pReq));
return false;
}
@@ -717,7 +717,7 @@ static bool sendBufferedRequest(JdwpState* state, const struct iovec* iov,
if (netState->clientSock < 0) {
/* can happen with some DDMS events */
- LOGV("NOT sending request -- no debugger is attached\n");
+ LOGV("NOT sending request -- no debugger is attached");
return false;
}
@@ -734,7 +734,7 @@ static bool sendBufferedRequest(JdwpState* state, const struct iovec* iov,
ssize_t actual;
actual = writev(netState->clientSock, iov, iovcnt);
if ((size_t)actual != expected) {
- LOGE("Failed sending b-req to debugger: %s (%d of %zu)\n",
+ LOGE("Failed sending b-req to debugger: %s (%d of %zu)",
strerror(errno), (int) actual, expected);
return false;
}
diff --git a/vm/jdwp/JdwpEvent.cpp b/vm/jdwp/JdwpEvent.cpp
index 15f0b2af2..f11777b58 100644
--- a/vm/jdwp/JdwpEvent.cpp
+++ b/vm/jdwp/JdwpEvent.cpp
@@ -161,9 +161,9 @@ static void unlockEventMutex(JdwpState* state)
*/
static void dumpEvent(const JdwpEvent* pEvent)
{
- LOGI("Event id=0x%4x %p (prev=%p next=%p):\n",
+ LOGI("Event id=0x%4x %p (prev=%p next=%p):",
pEvent->requestId, pEvent, pEvent->prev, pEvent->next);
- LOGI(" kind=%s susp=%s modCount=%d\n",
+ LOGI(" kind=%s susp=%s modCount=%d",
dvmJdwpEventKindStr(pEvent->eventKind),
dvmJdwpSuspendPolicyStr(pEvent->suspendPolicy),
pEvent->modCount);
@@ -171,7 +171,7 @@ static void dumpEvent(const JdwpEvent* pEvent)
for (int i = 0; i < pEvent->modCount; i++) {
const JdwpEventMod* pMod = &pEvent->mods[i];
JdwpModKind kind = static_cast<JdwpModKind>(pMod->modKind);
- LOGI(" %s\n", dvmJdwpModKindStr(kind));
+ LOGI(" %s", dvmJdwpModKindStr(kind));
/* TODO - show details */
}
}
@@ -293,7 +293,7 @@ void dvmJdwpUnregisterEventById(JdwpState* state, u4 requestId)
pEvent = pEvent->next;
}
- //LOGD("Odd: no match when removing event reqId=0x%04x\n", requestId);
+ //LOGD("Odd: no match when removing event reqId=0x%04x", requestId);
done:
unlockEventMutex(state);
@@ -396,7 +396,7 @@ static void cleanupMatchList(JdwpState* state, JdwpEvent** matchList,
if (pEvent->mods[i].modKind == MK_COUNT &&
pEvent->mods[i].count.count == 0)
{
- LOGV("##### Removing expired event\n");
+ LOGV("##### Removing expired event");
unregisterEvent(state, pEvent);
dvmJdwpEventFree(pEvent);
break;
@@ -423,7 +423,7 @@ static bool patternMatch(const char* pattern, const char* target)
int targetLen = strlen(target);
patLen--;
// TODO: remove printf when we find a test case to verify this
- LOGE(">>> comparing '%s' to '%s'\n",
+ LOGE(">>> comparing '%s' to '%s'",
pattern+1, target + (targetLen-patLen));
if (targetLen < patLen)
@@ -517,7 +517,7 @@ static bool modsMatch(JdwpState* state, JdwpEvent* pEvent, ModBasket* basket)
return false;
break;
default:
- LOGE("unhandled mod kind %d\n", pMod->modKind);
+ LOGE("unhandled mod kind %d", pMod->modKind);
assert(false);
break;
}
@@ -591,7 +591,7 @@ static void suspendByPolicy(JdwpState* state, JdwpSuspendPolicy suspendPolicy)
/* this is rare but possible -- see CLASS_PREPARE handling */
if (dvmDbgGetThreadSelfId() == state->debugThreadId) {
- LOGI("NOTE: suspendByPolicy not suspending JDWP thread\n");
+ LOGI("NOTE: suspendByPolicy not suspending JDWP thread");
return;
}
@@ -606,7 +606,7 @@ static void suspendByPolicy(JdwpState* state, JdwpSuspendPolicy suspendPolicy)
* resume. See if it has left anything in our DebugInvokeReq mailbox.
*/
if (!pReq->invokeNeeded) {
- /*LOGD("suspendByPolicy: no invoke needed\n");*/
+ /*LOGD("suspendByPolicy: no invoke needed");*/
break;
}
@@ -614,7 +614,7 @@ static void suspendByPolicy(JdwpState* state, JdwpSuspendPolicy suspendPolicy)
dvmJdwpSetWaitForEventThread(state, dvmDbgGetThreadSelfId());
/* leave pReq->invokeNeeded raised so we can check reentrancy */
- LOGV("invoking method...\n");
+ LOGV("invoking method...");
dvmDbgExecuteMethod(pReq);
pReq->err = ERR_NONE;
@@ -622,7 +622,7 @@ static void suspendByPolicy(JdwpState* state, JdwpSuspendPolicy suspendPolicy)
/* clear this before signaling */
pReq->invokeNeeded = false;
- LOGV("invoke complete, signaling and self-suspending\n");
+ LOGV("invoke complete, signaling and self-suspending");
dvmDbgLockMutex(&pReq->lock);
dvmDbgCondSignal(&pReq->cv);
dvmDbgUnlockMutex(&pReq->lock);
@@ -664,14 +664,14 @@ void dvmJdwpSetWaitForEventThread(JdwpState* state, ObjectId threadId)
* go to sleep indefinitely.
*/
while (state->eventThreadId != 0) {
- LOGV("event in progress (0x%llx), 0x%llx sleeping\n",
+ LOGV("event in progress (0x%llx), 0x%llx sleeping",
state->eventThreadId, threadId);
waited = true;
dvmDbgCondWait(&state->eventThreadCond, &state->eventThreadLock);
}
if (waited || threadId != 0)
- LOGV("event token grabbed (0x%llx)\n", threadId);
+ LOGV("event token grabbed (0x%llx)", threadId);
if (threadId != 0)
state->eventThreadId = threadId;
@@ -691,7 +691,7 @@ void dvmJdwpClearWaitForEventThread(JdwpState* state)
dvmDbgLockMutex(&state->eventThreadLock);
assert(state->eventThreadId != 0);
- LOGV("cleared event token (0x%llx)\n", state->eventThreadId);
+ LOGV("cleared event token (0x%llx)", state->eventThreadId);
state->eventThreadId = 0;
@@ -757,8 +757,8 @@ bool dvmJdwpPostVMStart(JdwpState* state, bool suspend)
ExpandBuf* pReq = NULL;
if (true) {
- LOGV("EVENT: %s\n", dvmJdwpEventKindStr(EK_VM_START));
- LOGV(" suspendPolicy=%s\n", dvmJdwpSuspendPolicyStr(suspendPolicy));
+ LOGV("EVENT: %s", dvmJdwpEventKindStr(EK_VM_START));
+ LOGV(" suspendPolicy=%s", dvmJdwpSuspendPolicyStr(suspendPolicy));
pReq = eventPrep();
expandBufAdd1(pReq, suspendPolicy);
@@ -829,7 +829,7 @@ bool dvmJdwpPostLocationEvent(JdwpState* state, const JdwpLocation* pLoc,
* this is mostly paranoia.)
*/
if (basket.threadId == state->debugThreadId) {
- LOGV("Ignoring location event in JDWP thread\n");
+ LOGV("Ignoring location event in JDWP thread");
free(nameAlloc);
return false;
}
@@ -844,7 +844,7 @@ bool dvmJdwpPostLocationEvent(JdwpState* state, const JdwpLocation* pLoc,
* method invocation to complete.
*/
if (invokeInProgress(state)) {
- LOGV("Not checking breakpoints during invoke (%s)\n", basket.className);
+ LOGV("Not checking breakpoints during invoke (%s)", basket.className);
free(nameAlloc);
return false;
}
@@ -870,14 +870,14 @@ bool dvmJdwpPostLocationEvent(JdwpState* state, const JdwpLocation* pLoc,
ExpandBuf* pReq = NULL;
if (matchCount != 0) {
- LOGV("EVENT: %s(%d total) %s.%s thread=%llx code=%llx)\n",
+ LOGV("EVENT: %s(%d total) %s.%s thread=%llx code=%llx)",
dvmJdwpEventKindStr(matchList[0]->eventKind), matchCount,
basket.className,
dvmDbgGetMethodName(pLoc->classId, pLoc->methodId),
basket.threadId, pLoc->idx);
suspendPolicy = scanSuspendPolicy(matchList, matchCount);
- LOGV(" suspendPolicy=%s\n",
+ LOGV(" suspendPolicy=%s",
dvmJdwpSuspendPolicyStr(suspendPolicy));
pReq = eventPrep();
@@ -927,7 +927,7 @@ bool dvmJdwpPostThreadChange(JdwpState* state, ObjectId threadId, bool start)
* I don't think this can happen.
*/
if (invokeInProgress(state)) {
- LOGW("Not posting thread change during invoke\n");
+ LOGW("Not posting thread change during invoke");
return false;
}
@@ -950,12 +950,12 @@ bool dvmJdwpPostThreadChange(JdwpState* state, ObjectId threadId, bool start)
ExpandBuf* pReq = NULL;
if (matchCount != 0) {
- LOGV("EVENT: %s(%d total) thread=%llx)\n",
+ LOGV("EVENT: %s(%d total) thread=%llx)",
dvmJdwpEventKindStr(matchList[0]->eventKind), matchCount,
basket.threadId);
suspendPolicy = scanSuspendPolicy(matchList, matchCount);
- LOGV(" suspendPolicy=%s\n",
+ LOGV(" suspendPolicy=%s",
dvmJdwpSuspendPolicyStr(suspendPolicy));
pReq = eventPrep();
@@ -995,7 +995,7 @@ bool dvmJdwpPostThreadChange(JdwpState* state, ObjectId threadId, bool start)
*/
bool dvmJdwpPostVMDeath(JdwpState* state)
{
- LOGV("EVENT: %s\n", dvmJdwpEventKindStr(EK_VM_DEATH));
+ LOGV("EVENT: %s", dvmJdwpEventKindStr(EK_VM_DEATH));
ExpandBuf* pReq = eventPrep();
expandBufAdd1(pReq, SP_NONE);
@@ -1039,7 +1039,7 @@ bool dvmJdwpPostException(JdwpState* state, const JdwpLocation* pThrowLoc,
/* don't try to post an exception caused by the debugger */
if (invokeInProgress(state)) {
- LOGV("Not posting exception hit during invoke (%s)\n",basket.className);
+ LOGV("Not posting exception hit during invoke (%s)",basket.className);
free(nameAlloc);
return false;
}
@@ -1054,24 +1054,24 @@ bool dvmJdwpPostException(JdwpState* state, const JdwpLocation* pThrowLoc,
ExpandBuf* pReq = NULL;
if (matchCount != 0) {
- LOGV("EVENT: %s(%d total) thread=%llx exceptId=%llx caught=%d)\n",
+ LOGV("EVENT: %s(%d total) thread=%llx exceptId=%llx caught=%d)",
dvmJdwpEventKindStr(matchList[0]->eventKind), matchCount,
basket.threadId, exceptionId, basket.caught);
- LOGV(" throw: %d %llx %x %lld (%s.%s)\n", pThrowLoc->typeTag,
+ LOGV(" throw: %d %llx %x %lld (%s.%s)", pThrowLoc->typeTag,
pThrowLoc->classId, pThrowLoc->methodId, pThrowLoc->idx,
dvmDbgGetClassDescriptor(pThrowLoc->classId),
dvmDbgGetMethodName(pThrowLoc->classId, pThrowLoc->methodId));
if (pCatchLoc->classId == 0) {
- LOGV(" catch: (not caught)\n");
+ LOGV(" catch: (not caught)");
} else {
- LOGV(" catch: %d %llx %x %lld (%s.%s)\n", pCatchLoc->typeTag,
+ LOGV(" catch: %d %llx %x %lld (%s.%s)", pCatchLoc->typeTag,
pCatchLoc->classId, pCatchLoc->methodId, pCatchLoc->idx,
dvmDbgGetClassDescriptor(pCatchLoc->classId),
dvmDbgGetMethodName(pCatchLoc->classId, pCatchLoc->methodId));
}
suspendPolicy = scanSuspendPolicy(matchList, matchCount);
- LOGV(" suspendPolicy=%s\n",
+ LOGV(" suspendPolicy=%s",
dvmJdwpSuspendPolicyStr(suspendPolicy));
pReq = eventPrep();
@@ -1133,7 +1133,7 @@ bool dvmJdwpPostClassPrepare(JdwpState* state, int tag, RefTypeId refTypeId,
/* suppress class prep caused by debugger */
if (invokeInProgress(state)) {
- LOGV("Not posting class prep caused by invoke (%s)\n",basket.className);
+ LOGV("Not posting class prep caused by invoke (%s)",basket.className);
free(nameAlloc);
return false;
}
@@ -1149,12 +1149,12 @@ bool dvmJdwpPostClassPrepare(JdwpState* state, int tag, RefTypeId refTypeId,
ExpandBuf* pReq = NULL;
if (matchCount != 0) {
- LOGV("EVENT: %s(%d total) thread=%llx)\n",
+ LOGV("EVENT: %s(%d total) thread=%llx)",
dvmJdwpEventKindStr(matchList[0]->eventKind), matchCount,
basket.threadId);
suspendPolicy = scanSuspendPolicy(matchList, matchCount);
- LOGV(" suspendPolicy=%s\n",
+ LOGV(" suspendPolicy=%s",
dvmJdwpSuspendPolicyStr(suspendPolicy));
if (basket.threadId == state->debugThreadId) {
@@ -1163,7 +1163,7 @@ bool dvmJdwpPostClassPrepare(JdwpState* state, int tag, RefTypeId refTypeId,
* should set threadId to null and if any threads were supposed
* to be suspended then we suspend all other threads.
*/
- LOGV(" NOTE: class prepare in debugger thread!\n");
+ LOGV(" NOTE: class prepare in debugger thread!");
basket.threadId = 0;
if (suspendPolicy == SP_EVENT_THREAD)
suspendPolicy = SP_ALL;
diff --git a/vm/jdwp/JdwpHandler.cpp b/vm/jdwp/JdwpHandler.cpp
index 930d25e9a..4c12e25c9 100644
--- a/vm/jdwp/JdwpHandler.cpp
+++ b/vm/jdwp/JdwpHandler.cpp
@@ -108,12 +108,12 @@ static JdwpError finishInvoke(JdwpState* state,
u4 numArgs = read4BE(&buf);
- LOGV(" --> threadId=%llx objectId=%llx\n", threadId, objectId);
- LOGV(" classId=%llx methodId=%x %s.%s\n",
+ LOGV(" --> threadId=%llx objectId=%llx", threadId, objectId);
+ LOGV(" classId=%llx methodId=%x %s.%s",
classId, methodId,
dvmDbgGetClassDescriptor(classId),
dvmDbgGetMethodName(classId, methodId));
- LOGV(" %d args:\n", numArgs);
+ LOGV(" %d args:", numArgs);
u8* argArray = NULL;
if (numArgs > 0)
@@ -124,12 +124,12 @@ static JdwpError finishInvoke(JdwpState* state,
int width = dvmDbgGetTagWidth(typeTag);
u8 value = jdwpReadValue(&buf, width);
- LOGV(" '%c'(%d): 0x%llx\n", typeTag, width, value);
+ LOGV(" '%c'(%d): 0x%llx", typeTag, width, value);
argArray[i] = value;
}
u4 options = read4BE(&buf); /* enum InvokeOptions bit flags */
- LOGV(" options=0x%04x%s%s\n", options,
+ LOGV(" options=0x%04x%s%s", options,
(options & INVOKE_SINGLE_THREADED) ? " (SINGLE_THREADED)" : "",
(options & INVOKE_NONVIRTUAL) ? " (NONVIRTUAL)" : "");
@@ -157,17 +157,17 @@ static JdwpError finishInvoke(JdwpState* state,
expandBufAdd1(pReply, JT_OBJECT);
expandBufAddObjectId(pReply, exceptObjId);
- LOGV(" --> returned '%c' 0x%llx (except=%08llx)\n",
+ LOGV(" --> returned '%c' 0x%llx (except=%08llx)",
resultTag, resultValue, exceptObjId);
/* show detailed debug output */
if (resultTag == JT_STRING && exceptObjId == 0) {
if (resultValue != 0) {
char* str = dvmDbgStringToUtf8(resultValue);
- LOGV(" string '%s'\n", str);
+ LOGV(" string '%s'", str);
free(str);
} else {
- LOGV(" string (null)\n");
+ LOGV(" string (null)");
}
}
}
@@ -211,7 +211,7 @@ static JdwpError handleVM_ClassesBySignature(JdwpState* state,
{
size_t strLen;
char* classDescriptor = readNewUtf8String(&buf, &strLen);
- LOGV(" Req for class by signature '%s'\n", classDescriptor);
+ LOGV(" Req for class by signature '%s'", classDescriptor);
/*
* TODO: if a class with the same name has been loaded multiple times
@@ -223,7 +223,7 @@ static JdwpError handleVM_ClassesBySignature(JdwpState* state,
RefTypeId refTypeId;
if (!dvmDbgFindLoadedClassBySignature(classDescriptor, &refTypeId)) {
/* not currently loaded */
- LOGV(" --> no match!\n");
+ LOGV(" --> no match!");
numClasses = 0;
} else {
/* just the one */
@@ -355,7 +355,7 @@ static JdwpError handleVM_Exit(JdwpState* state,
{
u4 exitCode = get4BE(buf);
- LOGW("Debugger is telling the VM to exit with code=%d\n", exitCode);
+ LOGW("Debugger is telling the VM to exit with code=%d", exitCode);
dvmDbgExit(exitCode);
return ERR_NOT_IMPLEMENTED; // shouldn't get here
@@ -373,7 +373,7 @@ static JdwpError handleVM_CreateString(JdwpState* state,
size_t strLen;
char* str = readNewUtf8String(&buf, &strLen);
- LOGV(" Req to create string '%s'\n", str);
+ LOGV(" Req to create string '%s'", str);
ObjectId stringId = dvmDbgCreateString(str);
if (stringId == 0)
@@ -515,7 +515,7 @@ static JdwpError handleRT_Signature(JdwpState* state,
{
RefTypeId refTypeId = dvmReadRefTypeId(&buf);
- LOGV(" Req for signature of refTypeId=0x%llx\n", refTypeId);
+ LOGV(" Req for signature of refTypeId=0x%llx", refTypeId);
const char* signature = dvmDbgGetSignature(refTypeId);
expandBufAddUtf8String(pReply, (const u1*) signature);
@@ -545,7 +545,7 @@ static JdwpError handleRT_GetValues(JdwpState* state,
RefTypeId refTypeId = dvmReadRefTypeId(&buf);
u4 numFields = read4BE(&buf);
- LOGV(" RT_GetValues %u:\n", numFields);
+ LOGV(" RT_GetValues %u:", numFields);
expandBufAdd4BE(pReply, numFields);
for (u4 i = 0; i < numFields; i++) {
@@ -597,7 +597,7 @@ static JdwpError handleRT_Interfaces(JdwpState* state,
{
RefTypeId refTypeId = dvmReadRefTypeId(&buf);
- LOGV(" Req for interfaces in %llx (%s)\n", refTypeId,
+ LOGV(" Req for interfaces in %llx (%s)", refTypeId,
dvmDbgGetClassDescriptor(refTypeId));
dvmDbgOutputAllInterfaces(refTypeId, pReply);
@@ -614,7 +614,7 @@ static JdwpError handleRT_ClassObject(JdwpState* state,
RefTypeId refTypeId = dvmReadRefTypeId(&buf);
ObjectId classObjId = dvmDbgGetClassObject(refTypeId);
- LOGV(" RefTypeId %llx -> ObjectId %llx\n", refTypeId, classObjId);
+ LOGV(" RefTypeId %llx -> ObjectId %llx", refTypeId, classObjId);
expandBufAddObjectId(pReply, classObjId);
@@ -643,12 +643,12 @@ static JdwpError handleRT_SignatureWithGeneric(JdwpState* state,
RefTypeId refTypeId = dvmReadRefTypeId(&buf);
- LOGV(" Req for signature of refTypeId=0x%llx\n", refTypeId);
+ LOGV(" Req for signature of refTypeId=0x%llx", refTypeId);
const char* signature = dvmDbgGetSignature(refTypeId);
if (signature != NULL) {
expandBufAddUtf8String(pReply, (const u1*) signature);
} else {
- LOGW("No signature for refTypeId=0x%llx\n", refTypeId);
+ LOGW("No signature for refTypeId=0x%llx", refTypeId);
expandBufAddUtf8String(pReply, (const u1*) "Lunknown;");
}
expandBufAddUtf8String(pReply, genericSignature);
@@ -678,8 +678,8 @@ static JdwpError handleRT_FieldsWithGeneric(JdwpState* state,
const u1* buf, int dataLen, ExpandBuf* pReply)
{
RefTypeId refTypeId = dvmReadRefTypeId(&buf);
- LOGV(" Req for fields in refTypeId=0x%llx\n", refTypeId);
- LOGV(" --> '%s'\n", dvmDbgGetSignature(refTypeId));
+ LOGV(" Req for fields in refTypeId=0x%llx", refTypeId);
+ LOGV(" --> '%s'", dvmDbgGetSignature(refTypeId));
dvmDbgOutputAllFields(refTypeId, true, pReply);
@@ -695,8 +695,8 @@ static JdwpError handleRT_MethodsWithGeneric(JdwpState* state,
{
RefTypeId refTypeId = dvmReadRefTypeId(&buf);
- LOGV(" Req for methods in refTypeId=0x%llx\n", refTypeId);
- LOGV(" --> '%s'\n", dvmDbgGetSignature(refTypeId));
+ LOGV(" Req for methods in refTypeId=0x%llx", refTypeId);
+ LOGV(" --> '%s'", dvmDbgGetSignature(refTypeId));
dvmDbgOutputAllMethods(refTypeId, true, pReply);
@@ -727,7 +727,7 @@ static JdwpError handleCT_SetValues(JdwpState* state,
RefTypeId classId = dvmReadRefTypeId(&buf);
u4 values = read4BE(&buf);
- LOGV(" Req to set %d values in classId=%llx\n", values, classId);
+ LOGV(" Req to set %d values in classId=%llx", values, classId);
for (u4 i = 0; i < values; i++) {
FieldId fieldId = dvmReadFieldId(&buf);
@@ -735,7 +735,7 @@ static JdwpError handleCT_SetValues(JdwpState* state,
int width = dvmDbgGetTagWidth(fieldTag);
u8 value = jdwpReadValue(&buf, width);
- LOGV(" --> field=%x tag=%c -> %lld\n", fieldId, fieldTag, value);
+ LOGV(" --> field=%x tag=%c -> %lld", fieldId, fieldTag, value);
dvmDbgSetStaticFieldValue(classId, fieldId, value, width);
}
@@ -773,7 +773,7 @@ static JdwpError handleCT_NewInstance(JdwpState* state,
ObjectId threadId = dvmReadObjectId(&buf);
MethodId methodId = dvmReadMethodId(&buf);
- LOGV("Creating instance of %s\n", dvmDbgGetClassDescriptor(classId));
+ LOGV("Creating instance of %s", dvmDbgGetClassDescriptor(classId));
ObjectId objectId = dvmDbgCreateObject(classId);
if (objectId == 0)
return ERR_OUT_OF_MEMORY;
@@ -791,7 +791,7 @@ static JdwpError handleAT_newInstance(JdwpState* state,
RefTypeId arrayTypeId = dvmReadRefTypeId(&buf);
u4 length = read4BE(&buf);
- LOGV("Creating array %s[%u]\n",
+ LOGV("Creating array %s[%u]",
dvmDbgGetClassDescriptor(arrayTypeId), length);
ObjectId objectId = dvmDbgCreateArrayObject(arrayTypeId, length);
if (objectId == 0)
@@ -811,7 +811,7 @@ static JdwpError handleM_LineTable(JdwpState* state,
RefTypeId refTypeId = dvmReadRefTypeId(&buf);
MethodId methodId = dvmReadMethodId(&buf);
- LOGV(" Req for line table in %s.%s\n",
+ LOGV(" Req for line table in %s.%s",
dvmDbgGetClassDescriptor(refTypeId),
dvmDbgGetMethodName(refTypeId,methodId));
@@ -829,7 +829,7 @@ static JdwpError handleM_VariableTableWithGeneric(JdwpState* state,
RefTypeId classId = dvmReadRefTypeId(&buf);
MethodId methodId = dvmReadMethodId(&buf);
- LOGV(" Req for LocalVarTab in class=%s method=%s\n",
+ LOGV(" Req for LocalVarTab in class=%s method=%s",
dvmDbgGetClassDescriptor(classId),
dvmDbgGetMethodName(classId, methodId));
@@ -855,7 +855,7 @@ static JdwpError handleOR_ReferenceType(JdwpState* state,
const u1* buf, int dataLen, ExpandBuf* pReply)
{
ObjectId objectId = dvmReadObjectId(&buf);
- LOGV(" Req for type of objectId=0x%llx\n", objectId);
+ LOGV(" Req for type of objectId=0x%llx", objectId);
u1 refTypeTag;
RefTypeId typeId;
@@ -876,7 +876,7 @@ static JdwpError handleOR_GetValues(JdwpState* state,
ObjectId objectId = dvmReadObjectId(&buf);
u4 numFields = read4BE(&buf);
- LOGV(" Req for %d fields from objectId=0x%llx\n", numFields, objectId);
+ LOGV(" Req for %d fields from objectId=0x%llx", numFields, objectId);
expandBufAdd4BE(pReply, numFields);
@@ -897,7 +897,7 @@ static JdwpError handleOR_SetValues(JdwpState* state,
ObjectId objectId = dvmReadObjectId(&buf);
u4 numFields = read4BE(&buf);
- LOGV(" Req to set %d fields in objectId=0x%llx\n", numFields, objectId);
+ LOGV(" Req to set %d fields in objectId=0x%llx", numFields, objectId);
for (u4 i = 0; i < numFields; i++) {
FieldId fieldId = dvmReadFieldId(&buf);
@@ -906,7 +906,7 @@ static JdwpError handleOR_SetValues(JdwpState* state,
int width = dvmDbgGetTagWidth(fieldTag);
u8 value = jdwpReadValue(&buf, width);
- LOGV(" --> fieldId=%x tag='%c'(%d) value=%lld\n",
+ LOGV(" --> fieldId=%x tag='%c'(%d) value=%lld",
fieldId, fieldTag, width, value);
dvmDbgSetFieldValue(objectId, fieldId, value, width);
@@ -967,7 +967,7 @@ static JdwpError handleOR_IsCollected(JdwpState* state,
ObjectId objectId;
objectId = dvmReadObjectId(&buf);
- LOGV(" Req IsCollected(0x%llx)\n", objectId);
+ LOGV(" Req IsCollected(0x%llx)", objectId);
// TODO: currently returning false; must integrate with GC
expandBufAdd1(pReply, 0);
@@ -984,7 +984,7 @@ static JdwpError handleSR_Value(JdwpState* state,
ObjectId stringObject = dvmReadObjectId(&buf);
char* str = dvmDbgStringToUtf8(stringObject);
- LOGV(" Req for str %llx --> '%s'\n", stringObject, str);
+ LOGV(" Req for str %llx --> '%s'", stringObject, str);
expandBufAddUtf8String(pReply, (u1*) str);
free(str);
@@ -1000,7 +1000,7 @@ static JdwpError handleTR_Name(JdwpState* state,
{
ObjectId threadId = dvmReadObjectId(&buf);
- LOGV(" Req for name of thread 0x%llx\n", threadId);
+ LOGV(" Req for name of thread 0x%llx", threadId);
char* name = dvmDbgGetThreadName(threadId);
if (name == NULL)
return ERR_INVALID_THREAD;
@@ -1023,10 +1023,10 @@ static JdwpError handleTR_Suspend(JdwpState* state,
ObjectId threadId = dvmReadObjectId(&buf);
if (threadId == dvmDbgGetThreadSelfId()) {
- LOGI(" Warning: ignoring request to suspend self\n");
+ LOGI(" Warning: ignoring request to suspend self");
return ERR_THREAD_NOT_SUSPENDED;
}
- LOGV(" Req to suspend thread 0x%llx\n", threadId);
+ LOGV(" Req to suspend thread 0x%llx", threadId);
dvmDbgSuspendThread(threadId);
@@ -1042,10 +1042,10 @@ static JdwpError handleTR_Resume(JdwpState* state,
ObjectId threadId = dvmReadObjectId(&buf);
if (threadId == dvmDbgGetThreadSelfId()) {
- LOGI(" Warning: ignoring request to resume self\n");
+ LOGI(" Warning: ignoring request to resume self");
return ERR_NONE;
}
- LOGV(" Req to resume thread 0x%llx\n", threadId);
+ LOGV(" Req to resume thread 0x%llx", threadId);
dvmDbgResumeThread(threadId);
@@ -1060,14 +1060,14 @@ static JdwpError handleTR_Status(JdwpState* state,
{
ObjectId threadId = dvmReadObjectId(&buf);
- LOGV(" Req for status of thread 0x%llx\n", threadId);
+ LOGV(" Req for status of thread 0x%llx", threadId);
u4 threadStatus;
u4 suspendStatus;
if (!dvmDbgGetThreadStatus(threadId, &threadStatus, &suspendStatus))
return ERR_INVALID_THREAD;
- LOGV(" --> %s, %s\n", dvmJdwpThreadStatusStr(threadStatus),
+ LOGV(" --> %s, %s", dvmJdwpThreadStatusStr(threadStatus),
dvmJdwpSuspendStatusStr(suspendStatus));
expandBufAdd4BE(pReply, threadStatus);
@@ -1107,14 +1107,14 @@ static JdwpError handleTR_Frames(JdwpState* state,
if (!dvmDbgThreadExists(threadId))
return ERR_INVALID_THREAD;
if (!dvmDbgIsSuspended(threadId)) {
- LOGV(" Rejecting req for frames in running thread '%s' (%llx)\n",
+ LOGV(" Rejecting req for frames in running thread '%s' (%llx)",
dvmDbgGetThreadName(threadId), threadId);
return ERR_THREAD_NOT_SUSPENDED;
}
int frameCount = dvmDbgGetThreadFrameCount(threadId);
- LOGV(" Request for frames: threadId=%llx start=%d length=%d [count=%d]\n",
+ LOGV(" Request for frames: threadId=%llx start=%d length=%d [count=%d]",
threadId, startFrame, length, frameCount);
if (frameCount <= 0)
return ERR_THREAD_NOT_SUSPENDED; /* == 0 means 100% native */
@@ -1135,7 +1135,7 @@ static JdwpError handleTR_Frames(JdwpState* state,
expandBufAdd8BE(pReply, frameId);
dvmJdwpAddLocation(pReply, &loc);
- LOGVV(" Frame %d: id=%llx loc={type=%d cls=%llx mth=%x loc=%llx}\n",
+ LOGVV(" Frame %d: id=%llx loc={type=%d cls=%llx mth=%x loc=%llx}",
i, frameId, loc.typeTag, loc.classId, loc.methodId, loc.idx);
}
@@ -1153,7 +1153,7 @@ static JdwpError handleTR_FrameCount(JdwpState* state,
if (!dvmDbgThreadExists(threadId))
return ERR_INVALID_THREAD;
if (!dvmDbgIsSuspended(threadId)) {
- LOGV(" Rejecting req for frames in running thread '%s' (%llx)\n",
+ LOGV(" Rejecting req for frames in running thread '%s' (%llx)",
dvmDbgGetThreadName(threadId), threadId);
return ERR_THREAD_NOT_SUSPENDED;
}
@@ -1208,14 +1208,14 @@ static JdwpError handleTGR_Name(JdwpState* state,
const u1* buf, int dataLen, ExpandBuf* pReply)
{
ObjectId threadGroupId = dvmReadObjectId(&buf);
- LOGV(" Req for name of threadGroupId=0x%llx\n", threadGroupId);
+ LOGV(" Req for name of threadGroupId=0x%llx", threadGroupId);
char* name = dvmDbgGetThreadGroupName(threadGroupId);
if (name != NULL)
expandBufAddUtf8String(pReply, (u1*) name);
else {
expandBufAddUtf8String(pReply, (u1*) "BAD-GROUP-ID");
- LOGW("bad thread group ID\n");
+ LOGW("bad thread group ID");
}
free(name);
@@ -1246,7 +1246,7 @@ static JdwpError handleTGR_Children(JdwpState* state,
const u1* buf, int dataLen, ExpandBuf* pReply)
{
ObjectId threadGroupId = dvmReadObjectId(&buf);
- LOGV(" Req for threads in threadGroupId=0x%llx\n", threadGroupId);
+ LOGV(" Req for threads in threadGroupId=0x%llx", threadGroupId);
ObjectId* pThreadIds;
u4 threadCount;
@@ -1280,11 +1280,11 @@ static JdwpError handleAR_Length(JdwpState* state,
const u1* buf, int dataLen, ExpandBuf* pReply)
{
ObjectId arrayId = dvmReadObjectId(&buf);
- LOGV(" Req for length of array 0x%llx\n", arrayId);
+ LOGV(" Req for length of array 0x%llx", arrayId);
u4 arrayLength = dvmDbgGetArrayLength(arrayId);
- LOGV(" --> %d\n", arrayLength);
+ LOGV(" --> %d", arrayLength);
expandBufAdd4BE(pReply, arrayLength);
@@ -1302,7 +1302,7 @@ static JdwpError handleAR_GetValues(JdwpState* state,
u4 length = read4BE(&buf);
u1 tag = dvmDbgGetArrayElementTag(arrayId);
- LOGV(" Req for array values 0x%llx first=%d len=%d (elem tag=%c)\n",
+ LOGV(" Req for array values 0x%llx first=%d len=%d (elem tag=%c)",
arrayId, firstIndex, length, tag);
expandBufAdd1(pReply, tag);
@@ -1324,7 +1324,7 @@ static JdwpError handleAR_SetValues(JdwpState* state,
u4 firstIndex = read4BE(&buf);
u4 values = read4BE(&buf);
- LOGV(" Req to set array values 0x%llx first=%d count=%d\n",
+ LOGV(" Req to set array values 0x%llx first=%d count=%d",
arrayId, firstIndex, values);
if (!dvmDbgSetArrayElements(arrayId, firstIndex, values, buf))
@@ -1376,7 +1376,7 @@ static JdwpError handleER_Set(JdwpState* state,
u1 suspendPolicy = read1(&buf);
u4 modifierCount = read4BE(&buf);
- LOGVV(" Set(kind=%s(%u) suspend=%s(%u) mods=%u)\n",
+ LOGVV(" Set(kind=%s(%u) suspend=%s(%u) mods=%u)",
dvmJdwpEventKindStr(eventKind), eventKind,
dvmJdwpSuspendPolicyStr(suspendPolicy), suspendPolicy,
modifierCount);
@@ -1401,7 +1401,7 @@ static JdwpError handleER_Set(JdwpState* state,
case MK_COUNT: /* report once, when "--count" reaches 0 */
{
u4 count = read4BE(&buf);
- LOGVV(" Count: %u\n", count);
+ LOGVV(" Count: %u", count);
if (count == 0)
return ERR_INVALID_COUNT;
pEvent->mods[idx].count.count = count;
@@ -1410,21 +1410,21 @@ static JdwpError handleER_Set(JdwpState* state,
case MK_CONDITIONAL: /* conditional on expression) */
{
u4 exprId = read4BE(&buf);
- LOGVV(" Conditional: %d\n", exprId);
+ LOGVV(" Conditional: %d", exprId);
pEvent->mods[idx].conditional.exprId = exprId;
}
break;
case MK_THREAD_ONLY: /* only report events in specified thread */
{
ObjectId threadId = dvmReadObjectId(&buf);
- LOGVV(" ThreadOnly: %llx\n", threadId);
+ LOGVV(" ThreadOnly: %llx", threadId);
pEvent->mods[idx].threadOnly.threadId = threadId;
}
break;
case MK_CLASS_ONLY: /* for ClassPrepare, MethodEntry */
{
RefTypeId clazzId = dvmReadRefTypeId(&buf);
- LOGVV(" ClassOnly: %llx (%s)\n",
+ LOGVV(" ClassOnly: %llx (%s)",
clazzId, dvmDbgGetClassDescriptor(clazzId));
pEvent->mods[idx].classOnly.refTypeId = clazzId;
}
@@ -1435,7 +1435,7 @@ static JdwpError handleER_Set(JdwpState* state,
size_t strLen;
pattern = readNewUtf8String(&buf, &strLen);
- LOGVV(" ClassMatch: '%s'\n", pattern);
+ LOGVV(" ClassMatch: '%s'", pattern);
/* pattern is "java.foo.*", we want "java/foo/ *" */
pEvent->mods[idx].classMatch.classPattern =
dvmDotToSlash(pattern);
@@ -1448,7 +1448,7 @@ static JdwpError handleER_Set(JdwpState* state,
size_t strLen;
pattern = readNewUtf8String(&buf, &strLen);
- LOGVV(" ClassExclude: '%s'\n", pattern);
+ LOGVV(" ClassExclude: '%s'", pattern);
pEvent->mods[idx].classExclude.classPattern =
dvmDotToSlash(pattern);
free(pattern);
@@ -1459,7 +1459,7 @@ static JdwpError handleER_Set(JdwpState* state,
JdwpLocation loc;
jdwpReadLocation(&buf, &loc);
- LOGVV(" LocationOnly: typeTag=%d classId=%llx methodId=%x idx=%llx\n",
+ LOGVV(" LocationOnly: typeTag=%d classId=%llx methodId=%x idx=%llx",
loc.typeTag, loc.classId, loc.methodId, loc.idx);
pEvent->mods[idx].locationOnly.loc = loc;
}
@@ -1472,7 +1472,7 @@ static JdwpError handleER_Set(JdwpState* state,
exceptionOrNull = dvmReadRefTypeId(&buf);
caught = read1(&buf);
uncaught = read1(&buf);
- LOGVV(" ExceptionOnly: type=%llx(%s) caught=%d uncaught=%d\n",
+ LOGVV(" ExceptionOnly: type=%llx(%s) caught=%d uncaught=%d",
exceptionOrNull, (exceptionOrNull == 0) ? "null"
: dvmDbgGetClassDescriptor(exceptionOrNull),
caught, uncaught);
@@ -1486,7 +1486,7 @@ static JdwpError handleER_Set(JdwpState* state,
{
RefTypeId declaring = dvmReadRefTypeId(&buf);
FieldId fieldId = dvmReadFieldId(&buf);
- LOGVV(" FieldOnly: %llx %x\n", declaring, fieldId);
+ LOGVV(" FieldOnly: %llx %x", declaring, fieldId);
pEvent->mods[idx].fieldOnly.refTypeId = declaring;
pEvent->mods[idx].fieldOnly.fieldId = fieldId;
}
@@ -1499,7 +1499,7 @@ static JdwpError handleER_Set(JdwpState* state,
threadId = dvmReadObjectId(&buf);
size = read4BE(&buf);
depth = read4BE(&buf);
- LOGVV(" Step: thread=%llx size=%s depth=%s\n",
+ LOGVV(" Step: thread=%llx size=%s depth=%s",
threadId, dvmJdwpStepSizeStr(size),
dvmJdwpStepDepthStr(depth));
@@ -1511,12 +1511,12 @@ static JdwpError handleER_Set(JdwpState* state,
case MK_INSTANCE_ONLY: /* report events related to a specific obj */
{
ObjectId instance = dvmReadObjectId(&buf);
- LOGVV(" InstanceOnly: %llx\n", instance);
+ LOGVV(" InstanceOnly: %llx", instance);
pEvent->mods[idx].instanceOnly.objectId = instance;
}
break;
default:
- LOGW("GLITCH: unsupported modKind=%d\n", modKind);
+ LOGW("GLITCH: unsupported modKind=%d", modKind);
break;
}
}
@@ -1526,7 +1526,7 @@ static JdwpError handleER_Set(JdwpState* state,
* has sent us bad stuff, but for now we blame ourselves.
*/
if (buf != origBuf + dataLen) {
- LOGW("GLITCH: dataLen is %d, we have consumed %d\n", dataLen,
+ LOGW("GLITCH: dataLen is %d, we have consumed %d", dataLen,
(int) (buf - origBuf));
}
@@ -1538,14 +1538,14 @@ static JdwpError handleER_Set(JdwpState* state,
pEvent->requestId = requestId;
- LOGV(" --> event requestId=0x%x\n", requestId);
+ LOGV(" --> event requestId=0x%x", requestId);
/* add it to the list */
JdwpError err = dvmJdwpRegisterEvent(state, pEvent);
if (err != ERR_NONE) {
/* registration failed, probably because event is bogus */
dvmJdwpEventFree(pEvent);
- LOGW("WARNING: event request rejected\n");
+ LOGW("WARNING: event request rejected");
}
return err;
}
@@ -1578,7 +1578,7 @@ static JdwpError handleSF_GetValues(JdwpState* state,
FrameId frameId = dvmReadFrameId(&buf);
u4 slots = read4BE(&buf);
- LOGV(" Req for %d slots in threadId=%llx frameId=%llx\n",
+ LOGV(" Req for %d slots in threadId=%llx frameId=%llx",
slots, threadId, frameId);
expandBufAdd4BE(pReply, slots); /* "int values" */
@@ -1586,7 +1586,7 @@ static JdwpError handleSF_GetValues(JdwpState* state,
u4 slot = read4BE(&buf);
u1 reqSigByte = read1(&buf);
- LOGV(" --> slot %d '%c'\n", slot, reqSigByte);
+ LOGV(" --> slot %d '%c'", slot, reqSigByte);
int width = dvmDbgGetTagWidth(reqSigByte);
u1* ptr = expandBufAddSpace(pReply, width+1);
@@ -1606,7 +1606,7 @@ static JdwpError handleSF_SetValues(JdwpState* state,
FrameId frameId = dvmReadFrameId(&buf);
u4 slots = read4BE(&buf);
- LOGV(" Req to set %d slots in threadId=%llx frameId=%llx\n",
+ LOGV(" Req to set %d slots in threadId=%llx frameId=%llx",
slots, threadId, frameId);
for (u4 i = 0; i < slots; i++) {
@@ -1615,7 +1615,7 @@ static JdwpError handleSF_SetValues(JdwpState* state,
int width = dvmDbgGetTagWidth(sigByte);
u8 value = jdwpReadValue(&buf, width);
- LOGV(" --> slot %d '%c' %llx\n", slot, sigByte, value);
+ LOGV(" --> slot %d '%c' %llx", slot, sigByte, value);
dvmDbgSetLocalValue(threadId, frameId, slot, sigByte, value, width);
}
@@ -1636,7 +1636,7 @@ static JdwpError handleSF_ThisObject(JdwpState* state,
return ERR_INVALID_FRAMEID;
u1 objectTag = dvmDbgGetObjectTag(objectId);
- LOGV(" Req for 'this' in thread=%llx frame=%llx --> %llx %s '%c'\n",
+ LOGV(" Req for 'this' in thread=%llx frame=%llx --> %llx %s '%c'",
threadId, frameId, objectId, dvmDbgGetObjectTypeName(objectId),
(char)objectTag);
@@ -1658,7 +1658,7 @@ static JdwpError handleCOR_ReflectedType(JdwpState* state,
{
RefTypeId classObjectId = dvmReadRefTypeId(&buf);
- LOGV(" Req for refTypeId for class=%llx (%s)\n",
+ LOGV(" Req for refTypeId for class=%llx (%s)",
classObjectId, dvmDbgGetClassDescriptor(classObjectId));
/* just hand the type back to them */
@@ -1680,7 +1680,7 @@ static JdwpError handleDDM_Chunk(JdwpState* state,
u1* replyBuf = NULL;
int replyLen = -1;
- LOGV(" Handling DDM packet (%.4s)\n", buf);
+ LOGV(" Handling DDM packet (%.4s)", buf);
/*
* On first DDM packet, notify all handlers that DDM is running.
@@ -1919,7 +1919,7 @@ void dvmJdwpProcessRequest(JdwpState* state, const JdwpReqHeader* pHeader,
if (gHandlerMap[i].cmdSet == pHeader->cmdSet &&
gHandlerMap[i].cmd == pHeader->cmd)
{
- LOGV("REQ: %s (cmd=%d/%d dataLen=%d id=0x%06x)\n",
+ LOGV("REQ: %s (cmd=%d/%d dataLen=%d id=0x%06x)",
gHandlerMap[i].descr, pHeader->cmdSet, pHeader->cmd,
dataLen, pHeader->id);
result = (*gHandlerMap[i].func)(state, buf, dataLen, pReply);
@@ -1927,7 +1927,7 @@ void dvmJdwpProcessRequest(JdwpState* state, const JdwpReqHeader* pHeader,
}
}
if (i == NELEM(gHandlerMap)) {
- LOGE("REQ: UNSUPPORTED (cmd=%d/%d dataLen=%d id=0x%06x)\n",
+ LOGE("REQ: UNSUPPORTED (cmd=%d/%d dataLen=%d id=0x%06x)",
pHeader->cmdSet, pHeader->cmd, dataLen, pHeader->id);
if (dataLen > 0)
dvmPrintHexDumpDbg(buf, dataLen, LOG_TAG);
@@ -1951,7 +1951,7 @@ void dvmJdwpProcessRequest(JdwpState* state, const JdwpReqHeader* pHeader,
respLen = expandBufGetLength(pReply) - kJDWPHeaderLen;
IF_LOG(LOG_VERBOSE, LOG_TAG) {
- LOGV("reply: dataLen=%d err=%s(%d)%s\n", respLen,
+ LOGV("reply: dataLen=%d err=%s(%d)%s", respLen,
dvmJdwpErrorStr(result), result,
result != ERR_NONE ? " **FAILED**" : "");
if (respLen > 0)
diff --git a/vm/jdwp/JdwpMain.cpp b/vm/jdwp/JdwpMain.cpp
index 4a33913cd..710a937f5 100644
--- a/vm/jdwp/JdwpMain.cpp
+++ b/vm/jdwp/JdwpMain.cpp
@@ -62,16 +62,16 @@ JdwpState* dvmJdwpStartup(const JdwpStartupParams* pParams)
switch (pParams->transport) {
case kJdwpTransportSocket:
- // LOGD("prepping for JDWP over TCP\n");
+ // LOGD("prepping for JDWP over TCP");
state->transport = dvmJdwpSocketTransport();
break;
case kJdwpTransportAndroidAdb:
- // LOGD("prepping for JDWP over ADB\n");
+ // LOGD("prepping for JDWP over ADB");
state->transport = dvmJdwpAndroidAdbTransport();
/* TODO */
break;
default:
- LOGE("Unknown transport %d\n", pParams->transport);
+ LOGE("Unknown transport %d", pParams->transport);
assert(false);
goto fail;
}
@@ -124,11 +124,11 @@ JdwpState* dvmJdwpStartup(const JdwpStartupParams* pParams)
dvmChangeStatus(NULL, THREAD_RUNNING);
if (!dvmJdwpIsActive(state)) {
- LOGE("JDWP connection failed\n");
+ LOGE("JDWP connection failed");
goto fail;
}
- LOGI("JDWP connected\n");
+ LOGI("JDWP connected");
/*
* Ordinarily we would pause briefly to allow the debugger to set
@@ -163,7 +163,7 @@ void dvmJdwpResetState(JdwpState* state)
* mid-request, though, we could see this.
*/
if (state->eventThreadId != 0) {
- LOGW("WARNING: resetting state while event in progress\n");
+ LOGW("WARNING: resetting state while event in progress");
assert(false);
}
}
@@ -186,18 +186,18 @@ void dvmJdwpShutdown(JdwpState* state)
* Close down the network to inspire the thread to halt.
*/
if (gDvm.verboseShutdown)
- LOGD("JDWP shutting down net...\n");
+ LOGD("JDWP shutting down net...");
dvmJdwpNetShutdown(state);
if (state->debugThreadStarted) {
state->run = false;
if (pthread_join(state->debugThreadHandle, &threadReturn) != 0) {
- LOGW("JDWP thread join failed\n");
+ LOGW("JDWP thread join failed");
}
}
if (gDvm.verboseShutdown)
- LOGD("JDWP freeing netstate...\n");
+ LOGD("JDWP freeing netstate...");
dvmJdwpNetFree(state);
state->netState = NULL;
}
@@ -223,7 +223,7 @@ static void* jdwpThreadStart(void* arg)
{
JdwpState* state = (JdwpState*) arg;
- LOGV("JDWP: thread running\n");
+ LOGV("JDWP: thread running");
/*
* Finish initializing "state", then notify the creating thread that
@@ -282,7 +282,7 @@ static void* jdwpThreadStart(void* arg)
while (true) {
// sanity check -- shouldn't happen?
if (dvmThreadSelf()->status != THREAD_VMWAIT) {
- LOGE("JDWP thread no longer in VMWAIT (now %d); resetting\n",
+ LOGE("JDWP thread no longer in VMWAIT (now %d); resetting",
dvmThreadSelf()->status);
dvmDbgThreadWaiting();
}
@@ -332,7 +332,7 @@ static void* jdwpThreadStart(void* arg)
/* back to running, for thread shutdown */
dvmDbgThreadRunning();
- LOGV("JDWP: thread exiting\n");
+ LOGV("JDWP: thread exiting");
return NULL;
}
@@ -394,7 +394,7 @@ s8 dvmJdwpGetNowMsec()
s8 dvmJdwpLastDebuggerActivity(JdwpState* state)
{
if (!gDvm.debuggerActive) {
- LOGD("dvmJdwpLastDebuggerActivity: no active debugger\n");
+ LOGD("dvmJdwpLastDebuggerActivity: no active debugger");
return -1;
}
@@ -402,7 +402,7 @@ s8 dvmJdwpLastDebuggerActivity(JdwpState* state)
/* initializing or in the middle of something? */
if (last == 0) {
- LOGV("+++ last=busy\n");
+ LOGV("+++ last=busy");
return 0;
}
@@ -410,6 +410,6 @@ s8 dvmJdwpLastDebuggerActivity(JdwpState* state)
s8 now = dvmJdwpGetNowMsec();
assert(now > last);
- LOGV("+++ debugger interval=%lld\n", now - last);
+ LOGV("+++ debugger interval=%lld", now - last);
return now - last;
}
diff --git a/vm/jdwp/JdwpSocket.cpp b/vm/jdwp/JdwpSocket.cpp
index d318b50a5..23da1b72d 100644
--- a/vm/jdwp/JdwpSocket.cpp
+++ b/vm/jdwp/JdwpSocket.cpp
@@ -89,7 +89,7 @@ static bool prepareSocket(JdwpState* state, const JdwpStartupParams* pParams)
}
}
if (state->netState == NULL) {
- LOGE("JDWP net startup failed (req port=%d)\n", pParams->port);
+ LOGE("JDWP net startup failed (req port=%d)", pParams->port);
return false;
}
} else {
@@ -98,9 +98,9 @@ static bool prepareSocket(JdwpState* state, const JdwpStartupParams* pParams)
}
if (pParams->suspend)
- LOGI("JDWP will wait for debugger on port %d\n", port);
+ LOGI("JDWP will wait for debugger on port %d", port);
else
- LOGD("JDWP will %s on port %d\n",
+ LOGD("JDWP will %s on port %d",
pParams->server ? "listen" : "connect", port);
return true;
@@ -146,7 +146,7 @@ static JdwpNetState* netStartup(short port)
netState->listenSock = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP);
if (netState->listenSock < 0) {
- LOGE("Socket create failed: %s\n", strerror(errno));
+ LOGE("Socket create failed: %s", strerror(errno));
goto fail;
}
@@ -154,7 +154,7 @@ static JdwpNetState* netStartup(short port)
if (setsockopt(netState->listenSock, SOL_SOCKET, SO_REUSEADDR, &one,
sizeof(one)) < 0)
{
- LOGE("setsockopt(SO_REUSEADDR) failed: %s\n", strerror(errno));
+ LOGE("setsockopt(SO_REUSEADDR) failed: %s", strerror(errno));
goto fail;
}
@@ -167,15 +167,15 @@ static JdwpNetState* netStartup(short port)
inet_aton("127.0.0.1", &addr.addrInet.sin_addr);
if (bind(netState->listenSock, &addr.addrPlain, sizeof(addr)) != 0) {
- LOGV("attempt to bind to port %u failed: %s\n", port, strerror(errno));
+ LOGV("attempt to bind to port %u failed: %s", port, strerror(errno));
goto fail;
}
netState->listenPort = port;
- LOGVV("+++ bound to port %d\n", netState->listenPort);
+ LOGVV("+++ bound to port %d", netState->listenPort);
if (listen(netState->listenSock, 5) != 0) {
- LOGE("Listen failed: %s\n", strerror(errno));
+ LOGE("Listen failed: %s", strerror(errno));
goto fail;
}
@@ -221,7 +221,7 @@ static void netShutdown(JdwpNetState* netState)
/* if we might be sitting in select, kick us loose */
if (netState->wakePipe[1] >= 0) {
- LOGV("+++ writing to wakePipe\n");
+ LOGV("+++ writing to wakePipe");
(void) write(netState->wakePipe[1], "", 1);
}
}
@@ -289,7 +289,7 @@ static bool isFdReadable(int sock)
if (FD_ISSET(sock, &readfds)) /* make sure it's our fd */
return true;
- LOGE("WEIRD: odd behavior in select (count=%d)\n", count);
+ LOGE("WEIRD: odd behavior in select (count=%d)", count);
return false;
}
#endif
@@ -355,23 +355,23 @@ static bool acceptConnection(JdwpState* state)
// When we call shutdown() on the socket, accept() returns with
// EINVAL. Don't gripe about it.
if (errno == EINVAL)
- LOGVV("accept failed: %s\n", strerror(errno));
+ LOGVV("accept failed: %s", strerror(errno));
else
- LOGE("accept failed: %s\n", strerror(errno));
+ LOGE("accept failed: %s", strerror(errno));
return false;
}
} while (sock < 0);
netState->remoteAddr = addr.addrInet.sin_addr;
netState->remotePort = ntohs(addr.addrInet.sin_port);
- LOGV("+++ accepted connection from %s:%u\n",
+ LOGV("+++ accepted connection from %s:%u",
inet_ntoa(netState->remoteAddr), netState->remotePort);
netState->clientSock = sock;
netState->awaitingHandshake = true;
netState->inputCount = 0;
- LOGV("Setting TCP_NODELAY on accepted socket\n");
+ LOGV("Setting TCP_NODELAY on accepted socket");
setNoDelay(netState->clientSock);
if (pipe(netState->wakePipe) < 0) {
@@ -410,7 +410,7 @@ static bool establishConnection(JdwpState* state)
int cc = gethostbyname_r(state->params.host, &he, auxBuf, sizeof(auxBuf),
&pEntry, &h_errno);
if (cc != 0) {
- LOGW("gethostbyname_r('%s') failed: %s\n",
+ LOGW("gethostbyname_r('%s') failed: %s",
state->params.host, strerror(errno));
return false;
}
@@ -419,7 +419,7 @@ static bool establishConnection(JdwpState* state)
h_errno = 0;
pEntry = gethostbyname(state->params.host);
if (pEntry == NULL) {
- LOGW("gethostbyname('%s') failed: %s\n",
+ LOGW("gethostbyname('%s') failed: %s",
state->params.host, strerror(h_errno));
return false;
}
@@ -431,7 +431,7 @@ static bool establishConnection(JdwpState* state)
addr.addrInet.sin_port = htons(state->params.port);
- LOGI("Connecting out to '%s' %d\n",
+ LOGI("Connecting out to '%s' %d",
inet_ntoa(addr.addrInet.sin_addr), ntohs(addr.addrInet.sin_port));
/*
@@ -441,7 +441,7 @@ static bool establishConnection(JdwpState* state)
netState = state->netState;
netState->clientSock = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP);
if (netState->clientSock < 0) {
- LOGE("Unable to create socket: %s\n", strerror(errno));
+ LOGE("Unable to create socket: %s", strerror(errno));
return false;
}
@@ -449,7 +449,7 @@ static bool establishConnection(JdwpState* state)
* Try to connect.
*/
if (connect(netState->clientSock, &addr.addrPlain, sizeof(addr)) != 0) {
- LOGE("Unable to connect to %s:%d: %s\n",
+ LOGE("Unable to connect to %s:%d: %s",
inet_ntoa(addr.addrInet.sin_addr), ntohs(addr.addrInet.sin_port),
strerror(errno));
close(netState->clientSock);
@@ -457,7 +457,7 @@ static bool establishConnection(JdwpState* state)
return false;
}
- LOGI("Connection established to %s (%s:%d)\n",
+ LOGI("Connection established to %s (%s:%d)",
state->params.host, inet_ntoa(addr.addrInet.sin_addr),
ntohs(addr.addrInet.sin_port));
netState->awaitingHandshake = true;
@@ -488,7 +488,7 @@ static void closeConnection(JdwpState* state)
if (netState->clientSock < 0)
return;
- LOGV("+++ closed connection to %s:%u\n",
+ LOGV("+++ closed connection to %s:%u",
inet_ntoa(netState->remoteAddr), netState->remotePort);
close(netState->clientSock);
@@ -564,7 +564,7 @@ static void dumpPacket(const unsigned char* packetBuf)
dataLen = length - (buf - packetBuf);
- LOGV("--- %s: dataLen=%u id=0x%08x flags=0x%02x cmd=%d/%d\n",
+ LOGV("--- %s: dataLen=%u id=0x%08x flags=0x%02x cmd=%d/%d",
reply ? "reply" : "req",
dataLen, id, flags, cmdSet, cmd);
if (dataLen > 0)
@@ -624,20 +624,20 @@ static bool handlePacket(JdwpState* state)
cc = write(netState->clientSock, expandBufGetBuffer(pReply),
expandBufGetLength(pReply));
if (cc != (int) expandBufGetLength(pReply)) {
- LOGE("Failed sending reply to debugger: %s\n", strerror(errno));
+ LOGE("Failed sending reply to debugger: %s", strerror(errno));
expandBufFree(pReply);
return false;
}
} else {
- LOGW("No reply created for set=%d cmd=%d\n", cmdSet, cmd);
+ LOGW("No reply created for set=%d cmd=%d", cmdSet, cmd);
}
expandBufFree(pReply);
} else {
- LOGV("reply?!\n");
+ LOGV("reply?!");
assert(false);
}
- LOGV("----------\n");
+ LOGV("----------");
consumeBytes(netState, length);
return true;
@@ -681,7 +681,7 @@ static bool processIncoming(JdwpState* state)
maxfd = netState->wakePipe[0];
if (maxfd < 0) {
- LOGV("+++ all fds are closed\n");
+ LOGV("+++ all fds are closed");
return false;
}
@@ -698,7 +698,7 @@ static bool processIncoming(JdwpState* state)
if (fd >= 0) {
FD_SET(fd, &readfds);
} else {
- LOGI("NOTE: entering select w/o wakepipe\n");
+ LOGI("NOTE: entering select w/o wakepipe");
}
/*
@@ -717,7 +717,7 @@ static bool processIncoming(JdwpState* state)
if (selCount < 0) {
if (errno == EINTR)
continue;
- LOGE("select failed: %s\n", strerror(errno));
+ LOGE("select failed: %s", strerror(errno));
goto fail;
}
@@ -725,15 +725,15 @@ static bool processIncoming(JdwpState* state)
FD_ISSET(netState->wakePipe[0], &readfds))
{
if (netState->listenSock >= 0)
- LOGE("Exit wake set, but not exiting?\n");
+ LOGE("Exit wake set, but not exiting?");
else
- LOGD("Got wake-up signal, bailing out of select\n");
+ LOGD("Got wake-up signal, bailing out of select");
goto fail;
}
if (netState->listenSock >= 0 &&
FD_ISSET(netState->listenSock, &readfds))
{
- LOGI("Ignoring second debugger -- accepting and dropping\n");
+ LOGI("Ignoring second debugger -- accepting and dropping");
union {
struct sockaddr_in addrInet;
struct sockaddr addrPlain;
@@ -743,7 +743,7 @@ static bool processIncoming(JdwpState* state)
tmpSock = accept(netState->listenSock, &addr.addrPlain,
&addrlen);
if (tmpSock < 0)
- LOGI("Weird -- accept failed\n");
+ LOGI("Weird -- accept failed");
else
close(tmpSock);
}
@@ -757,11 +757,11 @@ static bool processIncoming(JdwpState* state)
/* read failed */
if (errno != EINTR)
goto fail;
- LOGD("+++ EINTR hit\n");
+ LOGD("+++ EINTR hit");
return true;
} else if (readCount == 0) {
/* EOF hit -- far end went away */
- LOGD("+++ peer disconnected\n");
+ LOGD("+++ peer disconnected");
goto fail;
} else
break;
@@ -787,7 +787,7 @@ static bool processIncoming(JdwpState* state)
if (memcmp(netState->inputBuffer,
kMagicHandshake, kMagicHandshakeLen) != 0)
{
- LOGE("ERROR: bad handshake '%.14s'\n", netState->inputBuffer);
+ LOGE("ERROR: bad handshake '%.14s'", netState->inputBuffer);
goto fail;
}
@@ -795,14 +795,14 @@ static bool processIncoming(JdwpState* state)
cc = write(netState->clientSock, netState->inputBuffer,
kMagicHandshakeLen);
if (cc != kMagicHandshakeLen) {
- LOGE("Failed writing handshake bytes: %s (%d of %d)\n",
+ LOGE("Failed writing handshake bytes: %s (%d of %d)",
strerror(errno), cc, (int) kMagicHandshakeLen);
goto fail;
}
consumeBytes(netState, kMagicHandshakeLen);
netState->awaitingHandshake = false;
- LOGV("+++ handshake complete\n");
+ LOGV("+++ handshake complete");
return true;
}
@@ -832,7 +832,7 @@ static bool sendRequest(JdwpState* state, ExpandBuf* pReq)
/*dumpPacket(expandBufGetBuffer(pReq));*/
if (netState->clientSock < 0) {
/* can happen with some DDMS events */
- LOGV("NOT sending request -- no debugger is attached\n");
+ LOGV("NOT sending request -- no debugger is attached");
return false;
}
@@ -845,7 +845,7 @@ static bool sendRequest(JdwpState* state, ExpandBuf* pReq)
cc = write(netState->clientSock, expandBufGetBuffer(pReq),
expandBufGetLength(pReq));
if (cc != (int) expandBufGetLength(pReq)) {
- LOGE("Failed sending req to debugger: %s (%d of %d)\n",
+ LOGE("Failed sending req to debugger: %s (%d of %d)",
strerror(errno), cc, (int) expandBufGetLength(pReq));
return false;
}
@@ -868,7 +868,7 @@ static bool sendBufferedRequest(JdwpState* state, const struct iovec* iov,
if (netState->clientSock < 0) {
/* can happen with some DDMS events */
- LOGV("NOT sending request -- no debugger is attached\n");
+ LOGV("NOT sending request -- no debugger is attached");
return false;
}
@@ -885,7 +885,7 @@ static bool sendBufferedRequest(JdwpState* state, const struct iovec* iov,
ssize_t actual;
actual = writev(netState->clientSock, iov, iovcnt);
if ((size_t)actual != expected) {
- LOGE("Failed sending b-req to debugger: %s (%d of %zu)\n",
+ LOGE("Failed sending b-req to debugger: %s (%d of %zu)",
strerror(errno), (int) actual, expected);
return false;
}
diff --git a/vm/mterp/Mterp.cpp b/vm/mterp/Mterp.cpp
index ab439d50a..6220e81f9 100644
--- a/vm/mterp/Mterp.cpp
+++ b/vm/mterp/Mterp.cpp
@@ -41,7 +41,7 @@ bool dvmCheckAsmConstants()
#include "mterp/common/asm-constants.h"
if (failed) {
- LOGE("Please correct the values in mterp/common/asm-constants.h\n");
+ LOGE("Please correct the values in mterp/common/asm-constants.h");
dvmAbort();
}
@@ -56,8 +56,8 @@ bool dvmCheckAsmConstants()
int interpSize = (uintptr_t) dvmAsmInstructionEnd -
(uintptr_t) dvmAsmInstructionStart;
if (interpSize != 0 && interpSize != kNumPackedOpcodes*width) {
- LOGE("ERROR: unexpected asm interp size %d\n", interpSize);
- LOGE("(did an instruction handler exceed %d bytes?)\n", width);
+ LOGE("ERROR: unexpected asm interp size %d", interpSize);
+ LOGE("(did an instruction handler exceed %d bytes?)", width);
dvmAbort();
}
#endif
@@ -79,16 +79,16 @@ void dvmMterpStd(Thread* self)
IF_LOGVV() {
char* desc = dexProtoCopyMethodDescriptor(
&self->interpSave.method->prototype);
- LOGVV("mterp threadid=%d : %s.%s %s\n",
+ LOGVV("mterp threadid=%d : %s.%s %s",
dvmThreadSelf()->threadId,
self->interpSave.method->clazz->descriptor,
self->interpSave.method->name,
desc);
free(desc);
}
- //LOGI("self is %p, pc=%p, fp=%p\n", self, self->interpSave.pc,
+ //LOGI("self is %p, pc=%p, fp=%p", self, self->interpSave.pc,
// self->interpSave.curFrame);
- //LOGI("first instruction is 0x%04x\n", self->interpSave.pc[0]);
+ //LOGI("first instruction is 0x%04x", self->interpSave.pc[0]);
/*
* Handle any ongoing profiling and prep for debugging
diff --git a/vm/mterp/c/OP_APUT_OBJECT.cpp b/vm/mterp/c/OP_APUT_OBJECT.cpp
index 253df2575..a6a806441 100644
--- a/vm/mterp/c/OP_APUT_OBJECT.cpp
+++ b/vm/mterp/c/OP_APUT_OBJECT.cpp
@@ -22,7 +22,7 @@ HANDLE_OPCODE(OP_APUT_OBJECT /*vAA, vBB, vCC*/)
if (!checkForNull(obj))
GOTO_exceptionThrown();
if (!dvmCanPutArrayElement(obj->clazz, arrayObj->clazz)) {
- LOGV("Can't put a '%s'(%p) into array type='%s'(%p)\n",
+ LOGV("Can't put a '%s'(%p) into array type='%s'(%p)",
obj->clazz->descriptor, obj,
arrayObj->obj.clazz->descriptor, arrayObj);
dvmThrowArrayStoreExceptionIncompatibleElement(obj->clazz, arrayObj->clazz);
diff --git a/vm/mterp/c/OP_BREAKPOINT.cpp b/vm/mterp/c/OP_BREAKPOINT.cpp
index fa0711e9d..47f9d4af7 100644
--- a/vm/mterp/c/OP_BREAKPOINT.cpp
+++ b/vm/mterp/c/OP_BREAKPOINT.cpp
@@ -16,7 +16,7 @@ HANDLE_OPCODE(OP_BREAKPOINT)
* the thread resumed.
*/
u1 originalOpcode = dvmGetOriginalOpcode(pc);
- LOGV("+++ break 0x%02x (0x%04x -> 0x%04x)\n", originalOpcode, inst,
+ LOGV("+++ break 0x%02x (0x%04x -> 0x%04x)", originalOpcode, inst,
INST_REPLACE_OP(inst, originalOpcode));
inst = INST_REPLACE_OP(inst, originalOpcode);
FINISH_BKPT(originalOpcode);
diff --git a/vm/mterp/c/OP_MONITOR_ENTER.cpp b/vm/mterp/c/OP_MONITOR_ENTER.cpp
index de3348361..976aab316 100644
--- a/vm/mterp/c/OP_MONITOR_ENTER.cpp
+++ b/vm/mterp/c/OP_MONITOR_ENTER.cpp
@@ -8,7 +8,7 @@ HANDLE_OPCODE(OP_MONITOR_ENTER /*vAA*/)
obj = (Object*)GET_REGISTER(vsrc1);
if (!checkForNullExportPC(obj, fp, pc))
GOTO_exceptionThrown();
- ILOGV("+ locking %p %s\n", obj, obj->clazz->descriptor);
+ ILOGV("+ locking %p %s", obj, obj->clazz->descriptor);
EXPORT_PC(); /* need for precise GC */
dvmLockObject(self, obj);
}
diff --git a/vm/mterp/c/OP_MONITOR_EXIT.cpp b/vm/mterp/c/OP_MONITOR_EXIT.cpp
index cb8f99bfc..c26585d3c 100644
--- a/vm/mterp/c/OP_MONITOR_EXIT.cpp
+++ b/vm/mterp/c/OP_MONITOR_EXIT.cpp
@@ -19,7 +19,7 @@ HANDLE_OPCODE(OP_MONITOR_EXIT /*vAA*/)
ADJUST_PC(1); /* monitor-exit width is 1 */
GOTO_exceptionThrown();
}
- ILOGV("+ unlocking %p %s\n", obj, obj->clazz->descriptor);
+ ILOGV("+ unlocking %p %s", obj, obj->clazz->descriptor);
if (!dvmUnlockObject(self, obj)) {
assert(dvmCheckException(self));
ADJUST_PC(1);
diff --git a/vm/mterp/c/OP_PACKED_SWITCH.cpp b/vm/mterp/c/OP_PACKED_SWITCH.cpp
index bf8cbf245..3922e46e5 100644
--- a/vm/mterp/c/OP_PACKED_SWITCH.cpp
+++ b/vm/mterp/c/OP_PACKED_SWITCH.cpp
@@ -21,7 +21,7 @@ HANDLE_OPCODE(OP_PACKED_SWITCH /*vAA, +BBBB*/)
testVal = GET_REGISTER(vsrc1);
offset = dvmInterpHandlePackedSwitch(switchData, testVal);
- ILOGV("> branch taken (0x%04x)\n", offset);
+ ILOGV("> branch taken (0x%04x)", offset);
if (offset <= 0) /* uncommon */
PERIODIC_CHECKS(offset);
FINISH(offset);
diff --git a/vm/mterp/c/OP_SPARSE_SWITCH.cpp b/vm/mterp/c/OP_SPARSE_SWITCH.cpp
index a863ef28a..f48d06e50 100644
--- a/vm/mterp/c/OP_SPARSE_SWITCH.cpp
+++ b/vm/mterp/c/OP_SPARSE_SWITCH.cpp
@@ -21,7 +21,7 @@ HANDLE_OPCODE(OP_SPARSE_SWITCH /*vAA, +BBBB*/)
testVal = GET_REGISTER(vsrc1);
offset = dvmInterpHandleSparseSwitch(switchData, testVal);
- ILOGV("> branch taken (0x%04x)\n", offset);
+ ILOGV("> branch taken (0x%04x)", offset);
if (offset <= 0) /* uncommon */
PERIODIC_CHECKS(offset);
FINISH(offset);
diff --git a/vm/mterp/c/OP_THROW.cpp b/vm/mterp/c/OP_THROW.cpp
index 0dcaced31..6fde0ccbb 100644
--- a/vm/mterp/c/OP_THROW.cpp
+++ b/vm/mterp/c/OP_THROW.cpp
@@ -14,7 +14,7 @@ HANDLE_OPCODE(OP_THROW /*vAA*/)
obj = (Object*) GET_REGISTER(vsrc1);
if (!checkForNull(obj)) {
/* will throw a null pointer exception */
- LOGVV("Bad exception\n");
+ LOGVV("Bad exception");
} else {
/* use the requested exception */
dvmSetException(self, obj);
diff --git a/vm/mterp/c/OP_UNUSED_F1FF.cpp b/vm/mterp/c/OP_UNUSED_F1FF.cpp
index a3a65d7fb..34259d37f 100644
--- a/vm/mterp/c/OP_UNUSED_F1FF.cpp
+++ b/vm/mterp/c/OP_UNUSED_F1FF.cpp
@@ -2,7 +2,7 @@ HANDLE_OPCODE(OP_UNUSED_F1FF)
/*
* In portable interp, most unused opcodes will fall through to here.
*/
- LOGE("unknown opcode 0x%04x\n", inst);
+ LOGE("unknown opcode 0x%04x", inst);
dvmAbort();
FINISH(1);
OP_END
diff --git a/vm/mterp/c/gotoTargets.cpp b/vm/mterp/c/gotoTargets.cpp
index 18f4c0435..9d9004679 100644
--- a/vm/mterp/c/gotoTargets.cpp
+++ b/vm/mterp/c/gotoTargets.cpp
@@ -66,7 +66,7 @@ GOTO_TARGET(filledNewArray, bool methodCallRange, bool jumboFormat)
/*
* Create an array of the specified type.
*/
- LOGVV("+++ filled-new-array type is '%s'\n", arrayClass->descriptor);
+ LOGVV("+++ filled-new-array type is '%s'", arrayClass->descriptor);
typeCh = arrayClass->descriptor[1];
if (typeCh == 'D' || typeCh == 'J') {
/* category 2 primitives not allowed */
@@ -74,7 +74,7 @@ GOTO_TARGET(filledNewArray, bool methodCallRange, bool jumboFormat)
GOTO_exceptionThrown();
} else if (typeCh != 'L' && typeCh != '[' && typeCh != 'I') {
/* TODO: requires multiple "fill in" loops with different widths */
- LOGE("non-int primitives not implemented\n");
+ LOGE("non-int primitives not implemented");
dvmThrowInternalError(
"filled-new-array not implemented for anything but 'int'");
GOTO_exceptionThrown();
@@ -164,7 +164,7 @@ GOTO_TARGET(invokeVirtual, bool methodCallRange, bool jumboFormat)
if (baseMethod == NULL) {
baseMethod = dvmResolveMethod(curMethod->clazz, ref,METHOD_VIRTUAL);
if (baseMethod == NULL) {
- ILOGV("+ unknown method or access denied\n");
+ ILOGV("+ unknown method or access denied");
GOTO_exceptionThrown();
}
}
@@ -200,7 +200,7 @@ GOTO_TARGET(invokeVirtual, bool methodCallRange, bool jumboFormat)
methodToCall->nativeFunc != NULL);
#endif
- LOGVV("+++ base=%s.%s virtual[%d]=%s.%s\n",
+ LOGVV("+++ base=%s.%s virtual[%d]=%s.%s",
baseMethod->clazz->descriptor, baseMethod->name,
(u4) baseMethod->methodIndex,
methodToCall->clazz->descriptor, methodToCall->name);
@@ -208,7 +208,7 @@ GOTO_TARGET(invokeVirtual, bool methodCallRange, bool jumboFormat)
#if 0
if (vsrc1 != methodToCall->insSize) {
- LOGW("WRONG METHOD: base=%s.%s virtual[%d]=%s.%s\n",
+ LOGW("WRONG METHOD: base=%s.%s virtual[%d]=%s.%s",
baseMethod->clazz->descriptor, baseMethod->name,
(u4) baseMethod->methodIndex,
methodToCall->clazz->descriptor, methodToCall->name);
@@ -268,7 +268,7 @@ GOTO_TARGET(invokeSuper, bool methodCallRange, bool jumboFormat)
if (baseMethod == NULL) {
baseMethod = dvmResolveMethod(curMethod->clazz, ref,METHOD_VIRTUAL);
if (baseMethod == NULL) {
- ILOGV("+ unknown method or access denied\n");
+ ILOGV("+ unknown method or access denied");
GOTO_exceptionThrown();
}
}
@@ -301,7 +301,7 @@ GOTO_TARGET(invokeSuper, bool methodCallRange, bool jumboFormat)
assert(!dvmIsAbstractMethod(methodToCall) ||
methodToCall->nativeFunc != NULL);
#endif
- LOGVV("+++ base=%s.%s super-virtual=%s.%s\n",
+ LOGVV("+++ base=%s.%s super-virtual=%s.%s",
baseMethod->clazz->descriptor, baseMethod->name,
methodToCall->clazz->descriptor, methodToCall->name);
assert(methodToCall != NULL);
@@ -410,7 +410,7 @@ GOTO_TARGET(invokeDirect, bool methodCallRange, bool jumboFormat)
methodToCall = dvmResolveMethod(curMethod->clazz, ref,
METHOD_DIRECT);
if (methodToCall == NULL) {
- ILOGV("+ unknown direct method\n"); // should be impossible
+ ILOGV("+ unknown direct method"); // should be impossible
GOTO_exceptionThrown();
}
}
@@ -445,7 +445,7 @@ GOTO_TARGET(invokeStatic, bool methodCallRange, bool jumboFormat)
if (methodToCall == NULL) {
methodToCall = dvmResolveMethod(curMethod->clazz, ref, METHOD_STATIC);
if (methodToCall == NULL) {
- ILOGV("+ unknown method\n");
+ ILOGV("+ unknown method");
GOTO_exceptionThrown();
}
@@ -516,7 +516,7 @@ GOTO_TARGET(invokeVirtualQuick, bool methodCallRange, bool jumboFormat)
methodToCall->nativeFunc != NULL);
#endif
- LOGVV("+++ virtual[%d]=%s.%s\n",
+ LOGVV("+++ virtual[%d]=%s.%s",
ref, methodToCall->clazz->descriptor, methodToCall->name);
assert(methodToCall != NULL);
@@ -576,7 +576,7 @@ GOTO_TARGET(invokeSuperQuick, bool methodCallRange, bool jumboFormat)
assert(!dvmIsAbstractMethod(methodToCall) ||
methodToCall->nativeFunc != NULL);
#endif
- LOGVV("+++ super-virtual[%d]=%s.%s\n",
+ LOGVV("+++ super-virtual[%d]=%s.%s",
ref, methodToCall->clazz->descriptor, methodToCall->name);
assert(methodToCall != NULL);
GOTO_invokeMethod(methodCallRange, methodToCall, vsrc1, vdst);
@@ -624,7 +624,7 @@ GOTO_TARGET(returnFromMethod)
if (dvmIsBreakFrame(fp)) {
/* bail without popping the method frame from stack */
- LOGVV("+++ returned into break frame\n");
+ LOGVV("+++ returned into break frame");
GOTO_bail();
}
@@ -645,7 +645,7 @@ GOTO_TARGET(returnFromMethod)
{
FINISH(3);
} else {
- //LOGE("Unknown invoke instr %02x at %d\n",
+ //LOGE("Unknown invoke instr %02x at %d",
// invokeInstr, (int) (pc - curMethod->insns));
assert(false);
}
@@ -677,7 +677,7 @@ GOTO_TARGET(exceptionThrown)
dvmAddTrackedAlloc(exception, self);
dvmClearException(self);
- LOGV("Handling exception %s at %s:%d\n",
+ LOGV("Handling exception %s at %s:%d",
exception->clazz->descriptor, curMethod->name,
dvmLineNumFromPC(curMethod, pc - curMethod->insns));
@@ -745,7 +745,7 @@ GOTO_TARGET(exceptionThrown)
if (catchRelPc < 0) {
/* falling through to JNI code or off the bottom of the stack */
#if DVM_SHOW_EXCEPTION >= 2
- LOGD("Exception %s from %s:%d not caught locally\n",
+ LOGD("Exception %s from %s:%d not caught locally",
exception->clazz->descriptor, dvmGetMethodSourceFile(curMethod),
dvmLineNumFromPC(curMethod, pc - curMethod->insns));
#endif
@@ -757,7 +757,7 @@ GOTO_TARGET(exceptionThrown)
#if DVM_SHOW_EXCEPTION >= 3
{
const Method* catchMethod = SAVEAREA_FROM_FP(fp)->method;
- LOGD("Exception %s thrown from %s:%d to %s:%d\n",
+ LOGD("Exception %s thrown from %s:%d to %s:%d",
exception->clazz->descriptor, dvmGetMethodSourceFile(curMethod),
dvmLineNumFromPC(curMethod, pc - curMethod->insns),
dvmGetMethodSourceFile(catchMethod),
@@ -907,7 +907,7 @@ GOTO_TARGET(invokeMethod, bool methodCallRange, const Method* _methodToCall,
bottom = (u1*) newSaveArea - methodToCall->outsSize * sizeof(u4);
if (bottom < self->interpStackEnd) {
/* stack overflow */
- LOGV("Stack overflow on method call (start=%p end=%p newBot=%p(%d) size=%d '%s')\n",
+ LOGV("Stack overflow on method call (start=%p end=%p newBot=%p(%d) size=%d '%s')",
self->interpStackStart, self->interpStackEnd, bottom,
(u1*) fp - bottom, self->interpStackSize,
methodToCall->name);
@@ -915,7 +915,7 @@ GOTO_TARGET(invokeMethod, bool methodCallRange, const Method* _methodToCall,
assert(dvmCheckException(self));
GOTO_exceptionThrown();
}
- //LOGD("+++ fp=%p newFp=%p newSave=%p bottom=%p\n",
+ //LOGD("+++ fp=%p newFp=%p newSave=%p bottom=%p",
// fp, newFp, newSaveArea, bottom);
}
@@ -1006,7 +1006,7 @@ GOTO_TARGET(invokeMethod, bool methodCallRange, const Method* _methodToCall,
* it, jump to our local exception handling.
*/
if (dvmCheckException(self)) {
- LOGV("Exception thrown by/below native code\n");
+ LOGV("Exception thrown by/below native code");
GOTO_exceptionThrown();
}
@@ -1022,7 +1022,7 @@ GOTO_TARGET(invokeMethod, bool methodCallRange, const Method* _methodToCall,
{
FINISH(3);
} else {
- //LOGE("Unknown invoke instr %02x at %d\n",
+ //LOGE("Unknown invoke instr %02x at %d",
// invokeInstr, (int) (pc - curMethod->insns));
assert(false);
}
diff --git a/vm/mterp/c/header.cpp b/vm/mterp/c/header.cpp
index 70baa0207..d17915aa4 100644
--- a/vm/mterp/c/header.cpp
+++ b/vm/mterp/c/header.cpp
@@ -95,7 +95,7 @@
{ \
char* desc; \
desc = dexProtoCopyMethodDescriptor(&curMethod->prototype); \
- LOGE("Invalid branch %d at 0x%04x in %s.%s %s\n", \
+ LOGE("Invalid branch %d at 0x%04x in %s.%s %s", \
myoff, (int) (pc - curMethod->insns), \
curMethod->clazz->descriptor, curMethod->name, desc); \
free(desc); \
@@ -120,11 +120,11 @@
# define ILOG(_level, ...) do { \
char debugStrBuf[128]; \
snprintf(debugStrBuf, sizeof(debugStrBuf), __VA_ARGS__); \
- if (curMethod != NULL) \
- LOG(_level, LOG_TAG"i", "%-2d|%04x%s\n", \
+ if (curMethod != NULL) \
+ LOG(_level, LOG_TAG"i", "%-2d|%04x%s", \
self->threadId, (int)(pc - curMethod->insns), debugStrBuf); \
else \
- LOG(_level, LOG_TAG"i", "%-2d|####%s\n", \
+ LOG(_level, LOG_TAG"i", "%-2d|####%s", \
self->threadId, debugStrBuf); \
} while(false)
void dvmDumpRegs(const Method* method, const u4* framePtr, bool inOnly);
@@ -314,14 +314,14 @@ static inline bool checkForNull(Object* obj)
}
#ifdef WITH_EXTRA_OBJECT_VALIDATION
if (!dvmIsValidObject(obj)) {
- LOGE("Invalid object %p\n", obj);
+ LOGE("Invalid object %p", obj);
dvmAbort();
}
#endif
#ifndef NDEBUG
if (obj->clazz == NULL || ((u4) obj->clazz) <= 65536) {
/* probable heap corruption */
- LOGE("Invalid object class %p (in %p)\n", obj->clazz, obj);
+ LOGE("Invalid object class %p (in %p)", obj->clazz, obj);
dvmAbort();
}
#endif
@@ -346,14 +346,14 @@ static inline bool checkForNullExportPC(Object* obj, u4* fp, const u2* pc)
}
#ifdef WITH_EXTRA_OBJECT_VALIDATION
if (!dvmIsValidObject(obj)) {
- LOGE("Invalid object %p\n", obj);
+ LOGE("Invalid object %p", obj);
dvmAbort();
}
#endif
#ifndef NDEBUG
if (obj->clazz == NULL || ((u4) obj->clazz) <= 65536) {
/* probable heap corruption */
- LOGE("Invalid object class %p (in %p)\n", obj->clazz, obj);
+ LOGE("Invalid object class %p (in %p)", obj->clazz, obj);
dvmAbort();
}
#endif
diff --git a/vm/mterp/c/opcommon.cpp b/vm/mterp/c/opcommon.cpp
index 25ea5e3a5..296776f91 100644
--- a/vm/mterp/c/opcommon.cpp
+++ b/vm/mterp/c/opcommon.cpp
@@ -89,7 +89,7 @@ GOTO_TARGET_DECL(exceptionThrown);
result = 1; \
else \
result = (_nanVal); \
- ILOGV("+ result=%d\n", result); \
+ ILOGV("+ result=%d", result); \
SET_REGISTER(vdst, result); \
} \
FINISH(2);
@@ -668,7 +668,7 @@ GOTO_TARGET_DECL(exceptionThrown);
if (sfield == NULL) \
GOTO_exceptionThrown(); \
if (dvmDexGetResolvedField(methodClassDex, ref) == NULL) { \
- JIT_STUB_HACK(dvmJitEndTraceSelect(self,pc)); \
+ JIT_STUB_HACK(dvmJitEndTraceSelect(self,pc)); \
} \
} \
SET_REGISTER##_regsize(vdst, dvmGetStaticField##_ftype(sfield)); \
@@ -691,7 +691,7 @@ GOTO_TARGET_DECL(exceptionThrown);
if (sfield == NULL) \
GOTO_exceptionThrown(); \
if (dvmDexGetResolvedField(methodClassDex, ref) == NULL) { \
- JIT_STUB_HACK(dvmJitEndTraceSelect(self,pc)); \
+ JIT_STUB_HACK(dvmJitEndTraceSelect(self,pc)); \
} \
} \
SET_REGISTER##_regsize(vdst, dvmGetStaticField##_ftype(sfield)); \
@@ -714,7 +714,7 @@ GOTO_TARGET_DECL(exceptionThrown);
if (sfield == NULL) \
GOTO_exceptionThrown(); \
if (dvmDexGetResolvedField(methodClassDex, ref) == NULL) { \
- JIT_STUB_HACK(dvmJitEndTraceSelect(self,pc)); \
+ JIT_STUB_HACK(dvmJitEndTraceSelect(self,pc)); \
} \
} \
dvmSetStaticField##_ftype(sfield, GET_REGISTER##_regsize(vdst)); \
@@ -737,7 +737,7 @@ GOTO_TARGET_DECL(exceptionThrown);
if (sfield == NULL) \
GOTO_exceptionThrown(); \
if (dvmDexGetResolvedField(methodClassDex, ref) == NULL) { \
- JIT_STUB_HACK(dvmJitEndTraceSelect(self,pc)); \
+ JIT_STUB_HACK(dvmJitEndTraceSelect(self,pc)); \
} \
} \
dvmSetStaticField##_ftype(sfield, GET_REGISTER##_regsize(vdst)); \
diff --git a/vm/mterp/common/asm-constants.h b/vm/mterp/common/asm-constants.h
index bee7d11a0..1313de649 100644
--- a/vm/mterp/common/asm-constants.h
+++ b/vm/mterp/common/asm-constants.h
@@ -12,19 +12,19 @@
*/
# define MTERP_OFFSET(_name, _type, _field, _offset) \
if (OFFSETOF_MEMBER(_type, _field) != _offset) { \
- LOGE("Bad asm offset %s (%d), should be %d\n", \
+ LOGE("Bad asm offset %s (%d), should be %d", \
#_name, _offset, OFFSETOF_MEMBER(_type, _field)); \
failed = true; \
}
# define MTERP_SIZEOF(_name, _type, _size) \
if (sizeof(_type) != (_size)) { \
- LOGE("Bad asm sizeof %s (%d), should be %d\n", \
+ LOGE("Bad asm sizeof %s (%d), should be %d", \
#_name, (_size), sizeof(_type)); \
failed = true; \
}
# define MTERP_CONSTANT(_name, _value) \
if ((_name) != (_value)) { \
- LOGE("Bad asm constant %s (%d), should be %d\n", \
+ LOGE("Bad asm constant %s (%d), should be %d", \
#_name, (_value), (_name)); \
failed = true; \
}
diff --git a/vm/mterp/cstubs/entry.cpp b/vm/mterp/cstubs/entry.cpp
index 3123e6d04..350bd8603 100644
--- a/vm/mterp/cstubs/entry.cpp
+++ b/vm/mterp/cstubs/entry.cpp
@@ -25,7 +25,7 @@ void dvmMterpStdRun(Thread* self)
/* We exit via a longjmp */
if (setjmp(jmpBuf)) {
- LOGVV("mterp threadid=%d returning\n", dvmThreadSelf()->threadId);
+ LOGVV("mterp threadid=%d returning", dvmThreadSelf()->threadId);
return
}
@@ -45,7 +45,7 @@ void dvmMterpStdRun(Thread* self)
}
Handler handler = (Handler) gDvmMterpHandlers[inst & 0xff];
(void) gDvmMterpHandlerNames; /* avoid gcc "defined but not used" */
- LOGVV("handler %p %s\n",
+ LOGVV("handler %p %s",
handler, (const char*) gDvmMterpHandlerNames[inst & 0xff]);
(*handler)(self);
}
diff --git a/vm/mterp/out/InterpC-allstubs.cpp b/vm/mterp/out/InterpC-allstubs.cpp
index 2f037b4df..53a6ec2a1 100644
--- a/vm/mterp/out/InterpC-allstubs.cpp
+++ b/vm/mterp/out/InterpC-allstubs.cpp
@@ -102,7 +102,7 @@
{ \
char* desc; \
desc = dexProtoCopyMethodDescriptor(&curMethod->prototype); \
- LOGE("Invalid branch %d at 0x%04x in %s.%s %s\n", \
+ LOGE("Invalid branch %d at 0x%04x in %s.%s %s", \
myoff, (int) (pc - curMethod->insns), \
curMethod->clazz->descriptor, curMethod->name, desc); \
free(desc); \
@@ -127,11 +127,11 @@
# define ILOG(_level, ...) do { \
char debugStrBuf[128]; \
snprintf(debugStrBuf, sizeof(debugStrBuf), __VA_ARGS__); \
- if (curMethod != NULL) \
- LOG(_level, LOG_TAG"i", "%-2d|%04x%s\n", \
+ if (curMethod != NULL) \
+ LOG(_level, LOG_TAG"i", "%-2d|%04x%s", \
self->threadId, (int)(pc - curMethod->insns), debugStrBuf); \
else \
- LOG(_level, LOG_TAG"i", "%-2d|####%s\n", \
+ LOG(_level, LOG_TAG"i", "%-2d|####%s", \
self->threadId, debugStrBuf); \
} while(false)
void dvmDumpRegs(const Method* method, const u4* framePtr, bool inOnly);
@@ -321,14 +321,14 @@ static inline bool checkForNull(Object* obj)
}
#ifdef WITH_EXTRA_OBJECT_VALIDATION
if (!dvmIsValidObject(obj)) {
- LOGE("Invalid object %p\n", obj);
+ LOGE("Invalid object %p", obj);
dvmAbort();
}
#endif
#ifndef NDEBUG
if (obj->clazz == NULL || ((u4) obj->clazz) <= 65536) {
/* probable heap corruption */
- LOGE("Invalid object class %p (in %p)\n", obj->clazz, obj);
+ LOGE("Invalid object class %p (in %p)", obj->clazz, obj);
dvmAbort();
}
#endif
@@ -353,14 +353,14 @@ static inline bool checkForNullExportPC(Object* obj, u4* fp, const u2* pc)
}
#ifdef WITH_EXTRA_OBJECT_VALIDATION
if (!dvmIsValidObject(obj)) {
- LOGE("Invalid object %p\n", obj);
+ LOGE("Invalid object %p", obj);
dvmAbort();
}
#endif
#ifndef NDEBUG
if (obj->clazz == NULL || ((u4) obj->clazz) <= 65536) {
/* probable heap corruption */
- LOGE("Invalid object class %p (in %p)\n", obj->clazz, obj);
+ LOGE("Invalid object class %p (in %p)", obj->clazz, obj);
dvmAbort();
}
#endif
@@ -595,7 +595,7 @@ GOTO_TARGET_DECL(exceptionThrown);
result = 1; \
else \
result = (_nanVal); \
- ILOGV("+ result=%d\n", result); \
+ ILOGV("+ result=%d", result); \
SET_REGISTER(vdst, result); \
} \
FINISH(2);
@@ -1174,7 +1174,7 @@ GOTO_TARGET_DECL(exceptionThrown);
if (sfield == NULL) \
GOTO_exceptionThrown(); \
if (dvmDexGetResolvedField(methodClassDex, ref) == NULL) { \
- JIT_STUB_HACK(dvmJitEndTraceSelect(self,pc)); \
+ JIT_STUB_HACK(dvmJitEndTraceSelect(self,pc)); \
} \
} \
SET_REGISTER##_regsize(vdst, dvmGetStaticField##_ftype(sfield)); \
@@ -1197,7 +1197,7 @@ GOTO_TARGET_DECL(exceptionThrown);
if (sfield == NULL) \
GOTO_exceptionThrown(); \
if (dvmDexGetResolvedField(methodClassDex, ref) == NULL) { \
- JIT_STUB_HACK(dvmJitEndTraceSelect(self,pc)); \
+ JIT_STUB_HACK(dvmJitEndTraceSelect(self,pc)); \
} \
} \
SET_REGISTER##_regsize(vdst, dvmGetStaticField##_ftype(sfield)); \
@@ -1220,7 +1220,7 @@ GOTO_TARGET_DECL(exceptionThrown);
if (sfield == NULL) \
GOTO_exceptionThrown(); \
if (dvmDexGetResolvedField(methodClassDex, ref) == NULL) { \
- JIT_STUB_HACK(dvmJitEndTraceSelect(self,pc)); \
+ JIT_STUB_HACK(dvmJitEndTraceSelect(self,pc)); \
} \
} \
dvmSetStaticField##_ftype(sfield, GET_REGISTER##_regsize(vdst)); \
@@ -1243,7 +1243,7 @@ GOTO_TARGET_DECL(exceptionThrown);
if (sfield == NULL) \
GOTO_exceptionThrown(); \
if (dvmDexGetResolvedField(methodClassDex, ref) == NULL) { \
- JIT_STUB_HACK(dvmJitEndTraceSelect(self,pc)); \
+ JIT_STUB_HACK(dvmJitEndTraceSelect(self,pc)); \
} \
} \
dvmSetStaticField##_ftype(sfield, GET_REGISTER##_regsize(vdst)); \
@@ -1604,7 +1604,7 @@ HANDLE_OPCODE(OP_MONITOR_ENTER /*vAA*/)
obj = (Object*)GET_REGISTER(vsrc1);
if (!checkForNullExportPC(obj, fp, pc))
GOTO_exceptionThrown();
- ILOGV("+ locking %p %s\n", obj, obj->clazz->descriptor);
+ ILOGV("+ locking %p %s", obj, obj->clazz->descriptor);
EXPORT_PC(); /* need for precise GC */
dvmLockObject(self, obj);
}
@@ -1633,7 +1633,7 @@ HANDLE_OPCODE(OP_MONITOR_EXIT /*vAA*/)
ADJUST_PC(1); /* monitor-exit width is 1 */
GOTO_exceptionThrown();
}
- ILOGV("+ unlocking %p %s\n", obj, obj->clazz->descriptor);
+ ILOGV("+ unlocking %p %s", obj, obj->clazz->descriptor);
if (!dvmUnlockObject(self, obj)) {
assert(dvmCheckException(self));
ADJUST_PC(1);
@@ -1868,7 +1868,7 @@ HANDLE_OPCODE(OP_THROW /*vAA*/)
obj = (Object*) GET_REGISTER(vsrc1);
if (!checkForNull(obj)) {
/* will throw a null pointer exception */
- LOGVV("Bad exception\n");
+ LOGVV("Bad exception");
} else {
/* use the requested exception */
dvmSetException(self, obj);
@@ -1947,7 +1947,7 @@ HANDLE_OPCODE(OP_PACKED_SWITCH /*vAA, +BBBB*/)
testVal = GET_REGISTER(vsrc1);
offset = dvmInterpHandlePackedSwitch(switchData, testVal);
- ILOGV("> branch taken (0x%04x)\n", offset);
+ ILOGV("> branch taken (0x%04x)", offset);
if (offset <= 0) /* uncommon */
PERIODIC_CHECKS(offset);
FINISH(offset);
@@ -1978,7 +1978,7 @@ HANDLE_OPCODE(OP_SPARSE_SWITCH /*vAA, +BBBB*/)
testVal = GET_REGISTER(vsrc1);
offset = dvmInterpHandleSparseSwitch(switchData, testVal);
- ILOGV("> branch taken (0x%04x)\n", offset);
+ ILOGV("> branch taken (0x%04x)", offset);
if (offset <= 0) /* uncommon */
PERIODIC_CHECKS(offset);
FINISH(offset);
@@ -2138,7 +2138,7 @@ HANDLE_OPCODE(OP_APUT_OBJECT /*vAA, vBB, vCC*/)
if (!checkForNull(obj))
GOTO_exceptionThrown();
if (!dvmCanPutArrayElement(obj->clazz, arrayObj->clazz)) {
- LOGV("Can't put a '%s'(%p) into array type='%s'(%p)\n",
+ LOGV("Can't put a '%s'(%p) into array type='%s'(%p)",
obj->clazz->descriptor, obj,
arrayObj->obj.clazz->descriptor, arrayObj);
dvmThrowArrayStoreExceptionIncompatibleElement(obj->clazz, arrayObj->clazz);
@@ -2881,7 +2881,7 @@ HANDLE_OPCODE(OP_BREAKPOINT)
* the thread resumed.
*/
u1 originalOpcode = dvmGetOriginalOpcode(pc);
- LOGV("+++ break 0x%02x (0x%04x -> 0x%04x)\n", originalOpcode, inst,
+ LOGV("+++ break 0x%02x (0x%04x -> 0x%04x)", originalOpcode, inst,
INST_REPLACE_OP(inst, originalOpcode));
inst = INST_REPLACE_OP(inst, originalOpcode);
FINISH_BKPT(originalOpcode);
@@ -4246,7 +4246,7 @@ HANDLE_OPCODE(OP_UNUSED_F1FF)
/*
* In portable interp, most unused opcodes will fall through to here.
*/
- LOGE("unknown opcode 0x%04x\n", inst);
+ LOGE("unknown opcode 0x%04x", inst);
dvmAbort();
FINISH(1);
OP_END
@@ -4367,7 +4367,7 @@ void dvmMterpStdRun(Thread* self)
/* We exit via a longjmp */
if (setjmp(jmpBuf)) {
- LOGVV("mterp threadid=%d returning\n", dvmThreadSelf()->threadId);
+ LOGVV("mterp threadid=%d returning", dvmThreadSelf()->threadId);
return
}
@@ -4387,7 +4387,7 @@ void dvmMterpStdRun(Thread* self)
}
Handler handler = (Handler) gDvmMterpHandlers[inst & 0xff];
(void) gDvmMterpHandlerNames; /* avoid gcc "defined but not used" */
- LOGVV("handler %p %s\n",
+ LOGVV("handler %p %s",
handler, (const char*) gDvmMterpHandlerNames[inst & 0xff]);
(*handler)(self);
}
@@ -4471,7 +4471,7 @@ GOTO_TARGET(filledNewArray, bool methodCallRange, bool jumboFormat)
/*
* Create an array of the specified type.
*/
- LOGVV("+++ filled-new-array type is '%s'\n", arrayClass->descriptor);
+ LOGVV("+++ filled-new-array type is '%s'", arrayClass->descriptor);
typeCh = arrayClass->descriptor[1];
if (typeCh == 'D' || typeCh == 'J') {
/* category 2 primitives not allowed */
@@ -4479,7 +4479,7 @@ GOTO_TARGET(filledNewArray, bool methodCallRange, bool jumboFormat)
GOTO_exceptionThrown();
} else if (typeCh != 'L' && typeCh != '[' && typeCh != 'I') {
/* TODO: requires multiple "fill in" loops with different widths */
- LOGE("non-int primitives not implemented\n");
+ LOGE("non-int primitives not implemented");
dvmThrowInternalError(
"filled-new-array not implemented for anything but 'int'");
GOTO_exceptionThrown();
@@ -4569,7 +4569,7 @@ GOTO_TARGET(invokeVirtual, bool methodCallRange, bool jumboFormat)
if (baseMethod == NULL) {
baseMethod = dvmResolveMethod(curMethod->clazz, ref,METHOD_VIRTUAL);
if (baseMethod == NULL) {
- ILOGV("+ unknown method or access denied\n");
+ ILOGV("+ unknown method or access denied");
GOTO_exceptionThrown();
}
}
@@ -4605,7 +4605,7 @@ GOTO_TARGET(invokeVirtual, bool methodCallRange, bool jumboFormat)
methodToCall->nativeFunc != NULL);
#endif
- LOGVV("+++ base=%s.%s virtual[%d]=%s.%s\n",
+ LOGVV("+++ base=%s.%s virtual[%d]=%s.%s",
baseMethod->clazz->descriptor, baseMethod->name,
(u4) baseMethod->methodIndex,
methodToCall->clazz->descriptor, methodToCall->name);
@@ -4613,7 +4613,7 @@ GOTO_TARGET(invokeVirtual, bool methodCallRange, bool jumboFormat)
#if 0
if (vsrc1 != methodToCall->insSize) {
- LOGW("WRONG METHOD: base=%s.%s virtual[%d]=%s.%s\n",
+ LOGW("WRONG METHOD: base=%s.%s virtual[%d]=%s.%s",
baseMethod->clazz->descriptor, baseMethod->name,
(u4) baseMethod->methodIndex,
methodToCall->clazz->descriptor, methodToCall->name);
@@ -4673,7 +4673,7 @@ GOTO_TARGET(invokeSuper, bool methodCallRange, bool jumboFormat)
if (baseMethod == NULL) {
baseMethod = dvmResolveMethod(curMethod->clazz, ref,METHOD_VIRTUAL);
if (baseMethod == NULL) {
- ILOGV("+ unknown method or access denied\n");
+ ILOGV("+ unknown method or access denied");
GOTO_exceptionThrown();
}
}
@@ -4706,7 +4706,7 @@ GOTO_TARGET(invokeSuper, bool methodCallRange, bool jumboFormat)
assert(!dvmIsAbstractMethod(methodToCall) ||
methodToCall->nativeFunc != NULL);
#endif
- LOGVV("+++ base=%s.%s super-virtual=%s.%s\n",
+ LOGVV("+++ base=%s.%s super-virtual=%s.%s",
baseMethod->clazz->descriptor, baseMethod->name,
methodToCall->clazz->descriptor, methodToCall->name);
assert(methodToCall != NULL);
@@ -4815,7 +4815,7 @@ GOTO_TARGET(invokeDirect, bool methodCallRange, bool jumboFormat)
methodToCall = dvmResolveMethod(curMethod->clazz, ref,
METHOD_DIRECT);
if (methodToCall == NULL) {
- ILOGV("+ unknown direct method\n"); // should be impossible
+ ILOGV("+ unknown direct method"); // should be impossible
GOTO_exceptionThrown();
}
}
@@ -4850,7 +4850,7 @@ GOTO_TARGET(invokeStatic, bool methodCallRange, bool jumboFormat)
if (methodToCall == NULL) {
methodToCall = dvmResolveMethod(curMethod->clazz, ref, METHOD_STATIC);
if (methodToCall == NULL) {
- ILOGV("+ unknown method\n");
+ ILOGV("+ unknown method");
GOTO_exceptionThrown();
}
@@ -4921,7 +4921,7 @@ GOTO_TARGET(invokeVirtualQuick, bool methodCallRange, bool jumboFormat)
methodToCall->nativeFunc != NULL);
#endif
- LOGVV("+++ virtual[%d]=%s.%s\n",
+ LOGVV("+++ virtual[%d]=%s.%s",
ref, methodToCall->clazz->descriptor, methodToCall->name);
assert(methodToCall != NULL);
@@ -4981,7 +4981,7 @@ GOTO_TARGET(invokeSuperQuick, bool methodCallRange, bool jumboFormat)
assert(!dvmIsAbstractMethod(methodToCall) ||
methodToCall->nativeFunc != NULL);
#endif
- LOGVV("+++ super-virtual[%d]=%s.%s\n",
+ LOGVV("+++ super-virtual[%d]=%s.%s",
ref, methodToCall->clazz->descriptor, methodToCall->name);
assert(methodToCall != NULL);
GOTO_invokeMethod(methodCallRange, methodToCall, vsrc1, vdst);
@@ -5029,7 +5029,7 @@ GOTO_TARGET(returnFromMethod)
if (dvmIsBreakFrame(fp)) {
/* bail without popping the method frame from stack */
- LOGVV("+++ returned into break frame\n");
+ LOGVV("+++ returned into break frame");
GOTO_bail();
}
@@ -5050,7 +5050,7 @@ GOTO_TARGET(returnFromMethod)
{
FINISH(3);
} else {
- //LOGE("Unknown invoke instr %02x at %d\n",
+ //LOGE("Unknown invoke instr %02x at %d",
// invokeInstr, (int) (pc - curMethod->insns));
assert(false);
}
@@ -5082,7 +5082,7 @@ GOTO_TARGET(exceptionThrown)
dvmAddTrackedAlloc(exception, self);
dvmClearException(self);
- LOGV("Handling exception %s at %s:%d\n",
+ LOGV("Handling exception %s at %s:%d",
exception->clazz->descriptor, curMethod->name,
dvmLineNumFromPC(curMethod, pc - curMethod->insns));
@@ -5150,7 +5150,7 @@ GOTO_TARGET(exceptionThrown)
if (catchRelPc < 0) {
/* falling through to JNI code or off the bottom of the stack */
#if DVM_SHOW_EXCEPTION >= 2
- LOGD("Exception %s from %s:%d not caught locally\n",
+ LOGD("Exception %s from %s:%d not caught locally",
exception->clazz->descriptor, dvmGetMethodSourceFile(curMethod),
dvmLineNumFromPC(curMethod, pc - curMethod->insns));
#endif
@@ -5162,7 +5162,7 @@ GOTO_TARGET(exceptionThrown)
#if DVM_SHOW_EXCEPTION >= 3
{
const Method* catchMethod = SAVEAREA_FROM_FP(fp)->method;
- LOGD("Exception %s thrown from %s:%d to %s:%d\n",
+ LOGD("Exception %s thrown from %s:%d to %s:%d",
exception->clazz->descriptor, dvmGetMethodSourceFile(curMethod),
dvmLineNumFromPC(curMethod, pc - curMethod->insns),
dvmGetMethodSourceFile(catchMethod),
@@ -5312,7 +5312,7 @@ GOTO_TARGET(invokeMethod, bool methodCallRange, const Method* _methodToCall,
bottom = (u1*) newSaveArea - methodToCall->outsSize * sizeof(u4);
if (bottom < self->interpStackEnd) {
/* stack overflow */
- LOGV("Stack overflow on method call (start=%p end=%p newBot=%p(%d) size=%d '%s')\n",
+ LOGV("Stack overflow on method call (start=%p end=%p newBot=%p(%d) size=%d '%s')",
self->interpStackStart, self->interpStackEnd, bottom,
(u1*) fp - bottom, self->interpStackSize,
methodToCall->name);
@@ -5320,7 +5320,7 @@ GOTO_TARGET(invokeMethod, bool methodCallRange, const Method* _methodToCall,
assert(dvmCheckException(self));
GOTO_exceptionThrown();
}
- //LOGD("+++ fp=%p newFp=%p newSave=%p bottom=%p\n",
+ //LOGD("+++ fp=%p newFp=%p newSave=%p bottom=%p",
// fp, newFp, newSaveArea, bottom);
}
@@ -5411,7 +5411,7 @@ GOTO_TARGET(invokeMethod, bool methodCallRange, const Method* _methodToCall,
* it, jump to our local exception handling.
*/
if (dvmCheckException(self)) {
- LOGV("Exception thrown by/below native code\n");
+ LOGV("Exception thrown by/below native code");
GOTO_exceptionThrown();
}
@@ -5427,7 +5427,7 @@ GOTO_TARGET(invokeMethod, bool methodCallRange, const Method* _methodToCall,
{
FINISH(3);
} else {
- //LOGE("Unknown invoke instr %02x at %d\n",
+ //LOGE("Unknown invoke instr %02x at %d",
// invokeInstr, (int) (pc - curMethod->insns));
assert(false);
}
diff --git a/vm/mterp/out/InterpC-armv5te-vfp.cpp b/vm/mterp/out/InterpC-armv5te-vfp.cpp
index 2877f51a0..50bde595b 100644
--- a/vm/mterp/out/InterpC-armv5te-vfp.cpp
+++ b/vm/mterp/out/InterpC-armv5te-vfp.cpp
@@ -102,7 +102,7 @@
{ \
char* desc; \
desc = dexProtoCopyMethodDescriptor(&curMethod->prototype); \
- LOGE("Invalid branch %d at 0x%04x in %s.%s %s\n", \
+ LOGE("Invalid branch %d at 0x%04x in %s.%s %s", \
myoff, (int) (pc - curMethod->insns), \
curMethod->clazz->descriptor, curMethod->name, desc); \
free(desc); \
@@ -127,11 +127,11 @@
# define ILOG(_level, ...) do { \
char debugStrBuf[128]; \
snprintf(debugStrBuf, sizeof(debugStrBuf), __VA_ARGS__); \
- if (curMethod != NULL) \
- LOG(_level, LOG_TAG"i", "%-2d|%04x%s\n", \
+ if (curMethod != NULL) \
+ LOG(_level, LOG_TAG"i", "%-2d|%04x%s", \
self->threadId, (int)(pc - curMethod->insns), debugStrBuf); \
else \
- LOG(_level, LOG_TAG"i", "%-2d|####%s\n", \
+ LOG(_level, LOG_TAG"i", "%-2d|####%s", \
self->threadId, debugStrBuf); \
} while(false)
void dvmDumpRegs(const Method* method, const u4* framePtr, bool inOnly);
@@ -321,14 +321,14 @@ static inline bool checkForNull(Object* obj)
}
#ifdef WITH_EXTRA_OBJECT_VALIDATION
if (!dvmIsValidObject(obj)) {
- LOGE("Invalid object %p\n", obj);
+ LOGE("Invalid object %p", obj);
dvmAbort();
}
#endif
#ifndef NDEBUG
if (obj->clazz == NULL || ((u4) obj->clazz) <= 65536) {
/* probable heap corruption */
- LOGE("Invalid object class %p (in %p)\n", obj->clazz, obj);
+ LOGE("Invalid object class %p (in %p)", obj->clazz, obj);
dvmAbort();
}
#endif
@@ -353,14 +353,14 @@ static inline bool checkForNullExportPC(Object* obj, u4* fp, const u2* pc)
}
#ifdef WITH_EXTRA_OBJECT_VALIDATION
if (!dvmIsValidObject(obj)) {
- LOGE("Invalid object %p\n", obj);
+ LOGE("Invalid object %p", obj);
dvmAbort();
}
#endif
#ifndef NDEBUG
if (obj->clazz == NULL || ((u4) obj->clazz) <= 65536) {
/* probable heap corruption */
- LOGE("Invalid object class %p (in %p)\n", obj->clazz, obj);
+ LOGE("Invalid object class %p (in %p)", obj->clazz, obj);
dvmAbort();
}
#endif
@@ -595,7 +595,7 @@ GOTO_TARGET_DECL(exceptionThrown);
result = 1; \
else \
result = (_nanVal); \
- ILOGV("+ result=%d\n", result); \
+ ILOGV("+ result=%d", result); \
SET_REGISTER(vdst, result); \
} \
FINISH(2);
@@ -1174,7 +1174,7 @@ GOTO_TARGET_DECL(exceptionThrown);
if (sfield == NULL) \
GOTO_exceptionThrown(); \
if (dvmDexGetResolvedField(methodClassDex, ref) == NULL) { \
- JIT_STUB_HACK(dvmJitEndTraceSelect(self,pc)); \
+ JIT_STUB_HACK(dvmJitEndTraceSelect(self,pc)); \
} \
} \
SET_REGISTER##_regsize(vdst, dvmGetStaticField##_ftype(sfield)); \
@@ -1197,7 +1197,7 @@ GOTO_TARGET_DECL(exceptionThrown);
if (sfield == NULL) \
GOTO_exceptionThrown(); \
if (dvmDexGetResolvedField(methodClassDex, ref) == NULL) { \
- JIT_STUB_HACK(dvmJitEndTraceSelect(self,pc)); \
+ JIT_STUB_HACK(dvmJitEndTraceSelect(self,pc)); \
} \
} \
SET_REGISTER##_regsize(vdst, dvmGetStaticField##_ftype(sfield)); \
@@ -1220,7 +1220,7 @@ GOTO_TARGET_DECL(exceptionThrown);
if (sfield == NULL) \
GOTO_exceptionThrown(); \
if (dvmDexGetResolvedField(methodClassDex, ref) == NULL) { \
- JIT_STUB_HACK(dvmJitEndTraceSelect(self,pc)); \
+ JIT_STUB_HACK(dvmJitEndTraceSelect(self,pc)); \
} \
} \
dvmSetStaticField##_ftype(sfield, GET_REGISTER##_regsize(vdst)); \
@@ -1243,7 +1243,7 @@ GOTO_TARGET_DECL(exceptionThrown);
if (sfield == NULL) \
GOTO_exceptionThrown(); \
if (dvmDexGetResolvedField(methodClassDex, ref) == NULL) { \
- JIT_STUB_HACK(dvmJitEndTraceSelect(self,pc)); \
+ JIT_STUB_HACK(dvmJitEndTraceSelect(self,pc)); \
} \
} \
dvmSetStaticField##_ftype(sfield, GET_REGISTER##_regsize(vdst)); \
diff --git a/vm/mterp/out/InterpC-armv5te.cpp b/vm/mterp/out/InterpC-armv5te.cpp
index 5f7ffedfe..778c00092 100644
--- a/vm/mterp/out/InterpC-armv5te.cpp
+++ b/vm/mterp/out/InterpC-armv5te.cpp
@@ -102,7 +102,7 @@
{ \
char* desc; \
desc = dexProtoCopyMethodDescriptor(&curMethod->prototype); \
- LOGE("Invalid branch %d at 0x%04x in %s.%s %s\n", \
+ LOGE("Invalid branch %d at 0x%04x in %s.%s %s", \
myoff, (int) (pc - curMethod->insns), \
curMethod->clazz->descriptor, curMethod->name, desc); \
free(desc); \
@@ -127,11 +127,11 @@
# define ILOG(_level, ...) do { \
char debugStrBuf[128]; \
snprintf(debugStrBuf, sizeof(debugStrBuf), __VA_ARGS__); \
- if (curMethod != NULL) \
- LOG(_level, LOG_TAG"i", "%-2d|%04x%s\n", \
+ if (curMethod != NULL) \
+ LOG(_level, LOG_TAG"i", "%-2d|%04x%s", \
self->threadId, (int)(pc - curMethod->insns), debugStrBuf); \
else \
- LOG(_level, LOG_TAG"i", "%-2d|####%s\n", \
+ LOG(_level, LOG_TAG"i", "%-2d|####%s", \
self->threadId, debugStrBuf); \
} while(false)
void dvmDumpRegs(const Method* method, const u4* framePtr, bool inOnly);
@@ -321,14 +321,14 @@ static inline bool checkForNull(Object* obj)
}
#ifdef WITH_EXTRA_OBJECT_VALIDATION
if (!dvmIsValidObject(obj)) {
- LOGE("Invalid object %p\n", obj);
+ LOGE("Invalid object %p", obj);
dvmAbort();
}
#endif
#ifndef NDEBUG
if (obj->clazz == NULL || ((u4) obj->clazz) <= 65536) {
/* probable heap corruption */
- LOGE("Invalid object class %p (in %p)\n", obj->clazz, obj);
+ LOGE("Invalid object class %p (in %p)", obj->clazz, obj);
dvmAbort();
}
#endif
@@ -353,14 +353,14 @@ static inline bool checkForNullExportPC(Object* obj, u4* fp, const u2* pc)
}
#ifdef WITH_EXTRA_OBJECT_VALIDATION
if (!dvmIsValidObject(obj)) {
- LOGE("Invalid object %p\n", obj);
+ LOGE("Invalid object %p", obj);
dvmAbort();
}
#endif
#ifndef NDEBUG
if (obj->clazz == NULL || ((u4) obj->clazz) <= 65536) {
/* probable heap corruption */
- LOGE("Invalid object class %p (in %p)\n", obj->clazz, obj);
+ LOGE("Invalid object class %p (in %p)", obj->clazz, obj);
dvmAbort();
}
#endif
@@ -595,7 +595,7 @@ GOTO_TARGET_DECL(exceptionThrown);
result = 1; \
else \
result = (_nanVal); \
- ILOGV("+ result=%d\n", result); \
+ ILOGV("+ result=%d", result); \
SET_REGISTER(vdst, result); \
} \
FINISH(2);
@@ -1174,7 +1174,7 @@ GOTO_TARGET_DECL(exceptionThrown);
if (sfield == NULL) \
GOTO_exceptionThrown(); \
if (dvmDexGetResolvedField(methodClassDex, ref) == NULL) { \
- JIT_STUB_HACK(dvmJitEndTraceSelect(self,pc)); \
+ JIT_STUB_HACK(dvmJitEndTraceSelect(self,pc)); \
} \
} \
SET_REGISTER##_regsize(vdst, dvmGetStaticField##_ftype(sfield)); \
@@ -1197,7 +1197,7 @@ GOTO_TARGET_DECL(exceptionThrown);
if (sfield == NULL) \
GOTO_exceptionThrown(); \
if (dvmDexGetResolvedField(methodClassDex, ref) == NULL) { \
- JIT_STUB_HACK(dvmJitEndTraceSelect(self,pc)); \
+ JIT_STUB_HACK(dvmJitEndTraceSelect(self,pc)); \
} \
} \
SET_REGISTER##_regsize(vdst, dvmGetStaticField##_ftype(sfield)); \
@@ -1220,7 +1220,7 @@ GOTO_TARGET_DECL(exceptionThrown);
if (sfield == NULL) \
GOTO_exceptionThrown(); \
if (dvmDexGetResolvedField(methodClassDex, ref) == NULL) { \
- JIT_STUB_HACK(dvmJitEndTraceSelect(self,pc)); \
+ JIT_STUB_HACK(dvmJitEndTraceSelect(self,pc)); \
} \
} \
dvmSetStaticField##_ftype(sfield, GET_REGISTER##_regsize(vdst)); \
@@ -1243,7 +1243,7 @@ GOTO_TARGET_DECL(exceptionThrown);
if (sfield == NULL) \
GOTO_exceptionThrown(); \
if (dvmDexGetResolvedField(methodClassDex, ref) == NULL) { \
- JIT_STUB_HACK(dvmJitEndTraceSelect(self,pc)); \
+ JIT_STUB_HACK(dvmJitEndTraceSelect(self,pc)); \
} \
} \
dvmSetStaticField##_ftype(sfield, GET_REGISTER##_regsize(vdst)); \
diff --git a/vm/mterp/out/InterpC-armv7-a-neon.cpp b/vm/mterp/out/InterpC-armv7-a-neon.cpp
index 805b39c58..d8ee98dd9 100644
--- a/vm/mterp/out/InterpC-armv7-a-neon.cpp
+++ b/vm/mterp/out/InterpC-armv7-a-neon.cpp
@@ -102,7 +102,7 @@
{ \
char* desc; \
desc = dexProtoCopyMethodDescriptor(&curMethod->prototype); \
- LOGE("Invalid branch %d at 0x%04x in %s.%s %s\n", \
+ LOGE("Invalid branch %d at 0x%04x in %s.%s %s", \
myoff, (int) (pc - curMethod->insns), \
curMethod->clazz->descriptor, curMethod->name, desc); \
free(desc); \
@@ -127,11 +127,11 @@
# define ILOG(_level, ...) do { \
char debugStrBuf[128]; \
snprintf(debugStrBuf, sizeof(debugStrBuf), __VA_ARGS__); \
- if (curMethod != NULL) \
- LOG(_level, LOG_TAG"i", "%-2d|%04x%s\n", \
+ if (curMethod != NULL) \
+ LOG(_level, LOG_TAG"i", "%-2d|%04x%s", \
self->threadId, (int)(pc - curMethod->insns), debugStrBuf); \
else \
- LOG(_level, LOG_TAG"i", "%-2d|####%s\n", \
+ LOG(_level, LOG_TAG"i", "%-2d|####%s", \
self->threadId, debugStrBuf); \
} while(false)
void dvmDumpRegs(const Method* method, const u4* framePtr, bool inOnly);
@@ -321,14 +321,14 @@ static inline bool checkForNull(Object* obj)
}
#ifdef WITH_EXTRA_OBJECT_VALIDATION
if (!dvmIsValidObject(obj)) {
- LOGE("Invalid object %p\n", obj);
+ LOGE("Invalid object %p", obj);
dvmAbort();
}
#endif
#ifndef NDEBUG
if (obj->clazz == NULL || ((u4) obj->clazz) <= 65536) {
/* probable heap corruption */
- LOGE("Invalid object class %p (in %p)\n", obj->clazz, obj);
+ LOGE("Invalid object class %p (in %p)", obj->clazz, obj);
dvmAbort();
}
#endif
@@ -353,14 +353,14 @@ static inline bool checkForNullExportPC(Object* obj, u4* fp, const u2* pc)
}
#ifdef WITH_EXTRA_OBJECT_VALIDATION
if (!dvmIsValidObject(obj)) {
- LOGE("Invalid object %p\n", obj);
+ LOGE("Invalid object %p", obj);
dvmAbort();
}
#endif
#ifndef NDEBUG
if (obj->clazz == NULL || ((u4) obj->clazz) <= 65536) {
/* probable heap corruption */
- LOGE("Invalid object class %p (in %p)\n", obj->clazz, obj);
+ LOGE("Invalid object class %p (in %p)", obj->clazz, obj);
dvmAbort();
}
#endif
@@ -595,7 +595,7 @@ GOTO_TARGET_DECL(exceptionThrown);
result = 1; \
else \
result = (_nanVal); \
- ILOGV("+ result=%d\n", result); \
+ ILOGV("+ result=%d", result); \
SET_REGISTER(vdst, result); \
} \
FINISH(2);
@@ -1174,7 +1174,7 @@ GOTO_TARGET_DECL(exceptionThrown);
if (sfield == NULL) \
GOTO_exceptionThrown(); \
if (dvmDexGetResolvedField(methodClassDex, ref) == NULL) { \
- JIT_STUB_HACK(dvmJitEndTraceSelect(self,pc)); \
+ JIT_STUB_HACK(dvmJitEndTraceSelect(self,pc)); \
} \
} \
SET_REGISTER##_regsize(vdst, dvmGetStaticField##_ftype(sfield)); \
@@ -1197,7 +1197,7 @@ GOTO_TARGET_DECL(exceptionThrown);
if (sfield == NULL) \
GOTO_exceptionThrown(); \
if (dvmDexGetResolvedField(methodClassDex, ref) == NULL) { \
- JIT_STUB_HACK(dvmJitEndTraceSelect(self,pc)); \
+ JIT_STUB_HACK(dvmJitEndTraceSelect(self,pc)); \
} \
} \
SET_REGISTER##_regsize(vdst, dvmGetStaticField##_ftype(sfield)); \
@@ -1220,7 +1220,7 @@ GOTO_TARGET_DECL(exceptionThrown);
if (sfield == NULL) \
GOTO_exceptionThrown(); \
if (dvmDexGetResolvedField(methodClassDex, ref) == NULL) { \
- JIT_STUB_HACK(dvmJitEndTraceSelect(self,pc)); \
+ JIT_STUB_HACK(dvmJitEndTraceSelect(self,pc)); \
} \
} \
dvmSetStaticField##_ftype(sfield, GET_REGISTER##_regsize(vdst)); \
@@ -1243,7 +1243,7 @@ GOTO_TARGET_DECL(exceptionThrown);
if (sfield == NULL) \
GOTO_exceptionThrown(); \
if (dvmDexGetResolvedField(methodClassDex, ref) == NULL) { \
- JIT_STUB_HACK(dvmJitEndTraceSelect(self,pc)); \
+ JIT_STUB_HACK(dvmJitEndTraceSelect(self,pc)); \
} \
} \
dvmSetStaticField##_ftype(sfield, GET_REGISTER##_regsize(vdst)); \
diff --git a/vm/mterp/out/InterpC-armv7-a.cpp b/vm/mterp/out/InterpC-armv7-a.cpp
index 97a7a4cee..5fe21495c 100644
--- a/vm/mterp/out/InterpC-armv7-a.cpp
+++ b/vm/mterp/out/InterpC-armv7-a.cpp
@@ -102,7 +102,7 @@
{ \
char* desc; \
desc = dexProtoCopyMethodDescriptor(&curMethod->prototype); \
- LOGE("Invalid branch %d at 0x%04x in %s.%s %s\n", \
+ LOGE("Invalid branch %d at 0x%04x in %s.%s %s", \
myoff, (int) (pc - curMethod->insns), \
curMethod->clazz->descriptor, curMethod->name, desc); \
free(desc); \
@@ -127,11 +127,11 @@
# define ILOG(_level, ...) do { \
char debugStrBuf[128]; \
snprintf(debugStrBuf, sizeof(debugStrBuf), __VA_ARGS__); \
- if (curMethod != NULL) \
- LOG(_level, LOG_TAG"i", "%-2d|%04x%s\n", \
+ if (curMethod != NULL) \
+ LOG(_level, LOG_TAG"i", "%-2d|%04x%s", \
self->threadId, (int)(pc - curMethod->insns), debugStrBuf); \
else \
- LOG(_level, LOG_TAG"i", "%-2d|####%s\n", \
+ LOG(_level, LOG_TAG"i", "%-2d|####%s", \
self->threadId, debugStrBuf); \
} while(false)
void dvmDumpRegs(const Method* method, const u4* framePtr, bool inOnly);
@@ -321,14 +321,14 @@ static inline bool checkForNull(Object* obj)
}
#ifdef WITH_EXTRA_OBJECT_VALIDATION
if (!dvmIsValidObject(obj)) {
- LOGE("Invalid object %p\n", obj);
+ LOGE("Invalid object %p", obj);
dvmAbort();
}
#endif
#ifndef NDEBUG
if (obj->clazz == NULL || ((u4) obj->clazz) <= 65536) {
/* probable heap corruption */
- LOGE("Invalid object class %p (in %p)\n", obj->clazz, obj);
+ LOGE("Invalid object class %p (in %p)", obj->clazz, obj);
dvmAbort();
}
#endif
@@ -353,14 +353,14 @@ static inline bool checkForNullExportPC(Object* obj, u4* fp, const u2* pc)
}
#ifdef WITH_EXTRA_OBJECT_VALIDATION
if (!dvmIsValidObject(obj)) {
- LOGE("Invalid object %p\n", obj);
+ LOGE("Invalid object %p", obj);
dvmAbort();
}
#endif
#ifndef NDEBUG
if (obj->clazz == NULL || ((u4) obj->clazz) <= 65536) {
/* probable heap corruption */
- LOGE("Invalid object class %p (in %p)\n", obj->clazz, obj);
+ LOGE("Invalid object class %p (in %p)", obj->clazz, obj);
dvmAbort();
}
#endif
@@ -595,7 +595,7 @@ GOTO_TARGET_DECL(exceptionThrown);
result = 1; \
else \
result = (_nanVal); \
- ILOGV("+ result=%d\n", result); \
+ ILOGV("+ result=%d", result); \
SET_REGISTER(vdst, result); \
} \
FINISH(2);
@@ -1174,7 +1174,7 @@ GOTO_TARGET_DECL(exceptionThrown);
if (sfield == NULL) \
GOTO_exceptionThrown(); \
if (dvmDexGetResolvedField(methodClassDex, ref) == NULL) { \
- JIT_STUB_HACK(dvmJitEndTraceSelect(self,pc)); \
+ JIT_STUB_HACK(dvmJitEndTraceSelect(self,pc)); \
} \
} \
SET_REGISTER##_regsize(vdst, dvmGetStaticField##_ftype(sfield)); \
@@ -1197,7 +1197,7 @@ GOTO_TARGET_DECL(exceptionThrown);
if (sfield == NULL) \
GOTO_exceptionThrown(); \
if (dvmDexGetResolvedField(methodClassDex, ref) == NULL) { \
- JIT_STUB_HACK(dvmJitEndTraceSelect(self,pc)); \
+ JIT_STUB_HACK(dvmJitEndTraceSelect(self,pc)); \
} \
} \
SET_REGISTER##_regsize(vdst, dvmGetStaticField##_ftype(sfield)); \
@@ -1220,7 +1220,7 @@ GOTO_TARGET_DECL(exceptionThrown);
if (sfield == NULL) \
GOTO_exceptionThrown(); \
if (dvmDexGetResolvedField(methodClassDex, ref) == NULL) { \
- JIT_STUB_HACK(dvmJitEndTraceSelect(self,pc)); \
+ JIT_STUB_HACK(dvmJitEndTraceSelect(self,pc)); \
} \
} \
dvmSetStaticField##_ftype(sfield, GET_REGISTER##_regsize(vdst)); \
@@ -1243,7 +1243,7 @@ GOTO_TARGET_DECL(exceptionThrown);
if (sfield == NULL) \
GOTO_exceptionThrown(); \
if (dvmDexGetResolvedField(methodClassDex, ref) == NULL) { \
- JIT_STUB_HACK(dvmJitEndTraceSelect(self,pc)); \
+ JIT_STUB_HACK(dvmJitEndTraceSelect(self,pc)); \
} \
} \
dvmSetStaticField##_ftype(sfield, GET_REGISTER##_regsize(vdst)); \
diff --git a/vm/mterp/out/InterpC-portable.cpp b/vm/mterp/out/InterpC-portable.cpp
index b389f3fd0..a43fa8abc 100644
--- a/vm/mterp/out/InterpC-portable.cpp
+++ b/vm/mterp/out/InterpC-portable.cpp
@@ -102,7 +102,7 @@
{ \
char* desc; \
desc = dexProtoCopyMethodDescriptor(&curMethod->prototype); \
- LOGE("Invalid branch %d at 0x%04x in %s.%s %s\n", \
+ LOGE("Invalid branch %d at 0x%04x in %s.%s %s", \
myoff, (int) (pc - curMethod->insns), \
curMethod->clazz->descriptor, curMethod->name, desc); \
free(desc); \
@@ -127,11 +127,11 @@
# define ILOG(_level, ...) do { \
char debugStrBuf[128]; \
snprintf(debugStrBuf, sizeof(debugStrBuf), __VA_ARGS__); \
- if (curMethod != NULL) \
- LOG(_level, LOG_TAG"i", "%-2d|%04x%s\n", \
+ if (curMethod != NULL) \
+ LOG(_level, LOG_TAG"i", "%-2d|%04x%s", \
self->threadId, (int)(pc - curMethod->insns), debugStrBuf); \
else \
- LOG(_level, LOG_TAG"i", "%-2d|####%s\n", \
+ LOG(_level, LOG_TAG"i", "%-2d|####%s", \
self->threadId, debugStrBuf); \
} while(false)
void dvmDumpRegs(const Method* method, const u4* framePtr, bool inOnly);
@@ -321,14 +321,14 @@ static inline bool checkForNull(Object* obj)
}
#ifdef WITH_EXTRA_OBJECT_VALIDATION
if (!dvmIsValidObject(obj)) {
- LOGE("Invalid object %p\n", obj);
+ LOGE("Invalid object %p", obj);
dvmAbort();
}
#endif
#ifndef NDEBUG
if (obj->clazz == NULL || ((u4) obj->clazz) <= 65536) {
/* probable heap corruption */
- LOGE("Invalid object class %p (in %p)\n", obj->clazz, obj);
+ LOGE("Invalid object class %p (in %p)", obj->clazz, obj);
dvmAbort();
}
#endif
@@ -353,14 +353,14 @@ static inline bool checkForNullExportPC(Object* obj, u4* fp, const u2* pc)
}
#ifdef WITH_EXTRA_OBJECT_VALIDATION
if (!dvmIsValidObject(obj)) {
- LOGE("Invalid object %p\n", obj);
+ LOGE("Invalid object %p", obj);
dvmAbort();
}
#endif
#ifndef NDEBUG
if (obj->clazz == NULL || ((u4) obj->clazz) <= 65536) {
/* probable heap corruption */
- LOGE("Invalid object class %p (in %p)\n", obj->clazz, obj);
+ LOGE("Invalid object class %p (in %p)", obj->clazz, obj);
dvmAbort();
}
#endif
@@ -547,7 +547,7 @@ GOTO_TARGET_DECL(exceptionThrown);
result = 1; \
else \
result = (_nanVal); \
- ILOGV("+ result=%d\n", result); \
+ ILOGV("+ result=%d", result); \
SET_REGISTER(vdst, result); \
} \
FINISH(2);
@@ -1126,7 +1126,7 @@ GOTO_TARGET_DECL(exceptionThrown);
if (sfield == NULL) \
GOTO_exceptionThrown(); \
if (dvmDexGetResolvedField(methodClassDex, ref) == NULL) { \
- JIT_STUB_HACK(dvmJitEndTraceSelect(self,pc)); \
+ JIT_STUB_HACK(dvmJitEndTraceSelect(self,pc)); \
} \
} \
SET_REGISTER##_regsize(vdst, dvmGetStaticField##_ftype(sfield)); \
@@ -1149,7 +1149,7 @@ GOTO_TARGET_DECL(exceptionThrown);
if (sfield == NULL) \
GOTO_exceptionThrown(); \
if (dvmDexGetResolvedField(methodClassDex, ref) == NULL) { \
- JIT_STUB_HACK(dvmJitEndTraceSelect(self,pc)); \
+ JIT_STUB_HACK(dvmJitEndTraceSelect(self,pc)); \
} \
} \
SET_REGISTER##_regsize(vdst, dvmGetStaticField##_ftype(sfield)); \
@@ -1172,7 +1172,7 @@ GOTO_TARGET_DECL(exceptionThrown);
if (sfield == NULL) \
GOTO_exceptionThrown(); \
if (dvmDexGetResolvedField(methodClassDex, ref) == NULL) { \
- JIT_STUB_HACK(dvmJitEndTraceSelect(self,pc)); \
+ JIT_STUB_HACK(dvmJitEndTraceSelect(self,pc)); \
} \
} \
dvmSetStaticField##_ftype(sfield, GET_REGISTER##_regsize(vdst)); \
@@ -1195,7 +1195,7 @@ GOTO_TARGET_DECL(exceptionThrown);
if (sfield == NULL) \
GOTO_exceptionThrown(); \
if (dvmDexGetResolvedField(methodClassDex, ref) == NULL) { \
- JIT_STUB_HACK(dvmJitEndTraceSelect(self,pc)); \
+ JIT_STUB_HACK(dvmJitEndTraceSelect(self,pc)); \
} \
} \
dvmSetStaticField##_ftype(sfield, GET_REGISTER##_regsize(vdst)); \
@@ -1243,7 +1243,7 @@ void dvmInterpretPortable(Thread* self)
methodClassDex = curMethod->clazz->pDvmDex;
- LOGVV("threadid=%d: %s.%s pc=0x%x fp=%p\n",
+ LOGVV("threadid=%d: %s.%s pc=0x%x fp=%p",
self->threadId, curMethod->clazz->descriptor, curMethod->name,
pc - curMethod->insns, fp);
@@ -1623,7 +1623,7 @@ HANDLE_OPCODE(OP_MONITOR_ENTER /*vAA*/)
obj = (Object*)GET_REGISTER(vsrc1);
if (!checkForNullExportPC(obj, fp, pc))
GOTO_exceptionThrown();
- ILOGV("+ locking %p %s\n", obj, obj->clazz->descriptor);
+ ILOGV("+ locking %p %s", obj, obj->clazz->descriptor);
EXPORT_PC(); /* need for precise GC */
dvmLockObject(self, obj);
}
@@ -1652,7 +1652,7 @@ HANDLE_OPCODE(OP_MONITOR_EXIT /*vAA*/)
ADJUST_PC(1); /* monitor-exit width is 1 */
GOTO_exceptionThrown();
}
- ILOGV("+ unlocking %p %s\n", obj, obj->clazz->descriptor);
+ ILOGV("+ unlocking %p %s", obj, obj->clazz->descriptor);
if (!dvmUnlockObject(self, obj)) {
assert(dvmCheckException(self));
ADJUST_PC(1);
@@ -1887,7 +1887,7 @@ HANDLE_OPCODE(OP_THROW /*vAA*/)
obj = (Object*) GET_REGISTER(vsrc1);
if (!checkForNull(obj)) {
/* will throw a null pointer exception */
- LOGVV("Bad exception\n");
+ LOGVV("Bad exception");
} else {
/* use the requested exception */
dvmSetException(self, obj);
@@ -1966,7 +1966,7 @@ HANDLE_OPCODE(OP_PACKED_SWITCH /*vAA, +BBBB*/)
testVal = GET_REGISTER(vsrc1);
offset = dvmInterpHandlePackedSwitch(switchData, testVal);
- ILOGV("> branch taken (0x%04x)\n", offset);
+ ILOGV("> branch taken (0x%04x)", offset);
if (offset <= 0) /* uncommon */
PERIODIC_CHECKS(offset);
FINISH(offset);
@@ -1997,7 +1997,7 @@ HANDLE_OPCODE(OP_SPARSE_SWITCH /*vAA, +BBBB*/)
testVal = GET_REGISTER(vsrc1);
offset = dvmInterpHandleSparseSwitch(switchData, testVal);
- ILOGV("> branch taken (0x%04x)\n", offset);
+ ILOGV("> branch taken (0x%04x)", offset);
if (offset <= 0) /* uncommon */
PERIODIC_CHECKS(offset);
FINISH(offset);
@@ -2157,7 +2157,7 @@ HANDLE_OPCODE(OP_APUT_OBJECT /*vAA, vBB, vCC*/)
if (!checkForNull(obj))
GOTO_exceptionThrown();
if (!dvmCanPutArrayElement(obj->clazz, arrayObj->clazz)) {
- LOGV("Can't put a '%s'(%p) into array type='%s'(%p)\n",
+ LOGV("Can't put a '%s'(%p) into array type='%s'(%p)",
obj->clazz->descriptor, obj,
arrayObj->obj.clazz->descriptor, arrayObj);
dvmThrowArrayStoreExceptionIncompatibleElement(obj->clazz, arrayObj->clazz);
@@ -2900,7 +2900,7 @@ HANDLE_OPCODE(OP_BREAKPOINT)
* the thread resumed.
*/
u1 originalOpcode = dvmGetOriginalOpcode(pc);
- LOGV("+++ break 0x%02x (0x%04x -> 0x%04x)\n", originalOpcode, inst,
+ LOGV("+++ break 0x%02x (0x%04x -> 0x%04x)", originalOpcode, inst,
INST_REPLACE_OP(inst, originalOpcode));
inst = INST_REPLACE_OP(inst, originalOpcode);
FINISH_BKPT(originalOpcode);
@@ -4265,7 +4265,7 @@ HANDLE_OPCODE(OP_UNUSED_F1FF)
/*
* In portable interp, most unused opcodes will fall through to here.
*/
- LOGE("unknown opcode 0x%04x\n", inst);
+ LOGE("unknown opcode 0x%04x", inst);
dvmAbort();
FINISH(1);
OP_END
@@ -4427,7 +4427,7 @@ GOTO_TARGET(filledNewArray, bool methodCallRange, bool jumboFormat)
/*
* Create an array of the specified type.
*/
- LOGVV("+++ filled-new-array type is '%s'\n", arrayClass->descriptor);
+ LOGVV("+++ filled-new-array type is '%s'", arrayClass->descriptor);
typeCh = arrayClass->descriptor[1];
if (typeCh == 'D' || typeCh == 'J') {
/* category 2 primitives not allowed */
@@ -4435,7 +4435,7 @@ GOTO_TARGET(filledNewArray, bool methodCallRange, bool jumboFormat)
GOTO_exceptionThrown();
} else if (typeCh != 'L' && typeCh != '[' && typeCh != 'I') {
/* TODO: requires multiple "fill in" loops with different widths */
- LOGE("non-int primitives not implemented\n");
+ LOGE("non-int primitives not implemented");
dvmThrowInternalError(
"filled-new-array not implemented for anything but 'int'");
GOTO_exceptionThrown();
@@ -4525,7 +4525,7 @@ GOTO_TARGET(invokeVirtual, bool methodCallRange, bool jumboFormat)
if (baseMethod == NULL) {
baseMethod = dvmResolveMethod(curMethod->clazz, ref,METHOD_VIRTUAL);
if (baseMethod == NULL) {
- ILOGV("+ unknown method or access denied\n");
+ ILOGV("+ unknown method or access denied");
GOTO_exceptionThrown();
}
}
@@ -4561,7 +4561,7 @@ GOTO_TARGET(invokeVirtual, bool methodCallRange, bool jumboFormat)
methodToCall->nativeFunc != NULL);
#endif
- LOGVV("+++ base=%s.%s virtual[%d]=%s.%s\n",
+ LOGVV("+++ base=%s.%s virtual[%d]=%s.%s",
baseMethod->clazz->descriptor, baseMethod->name,
(u4) baseMethod->methodIndex,
methodToCall->clazz->descriptor, methodToCall->name);
@@ -4569,7 +4569,7 @@ GOTO_TARGET(invokeVirtual, bool methodCallRange, bool jumboFormat)
#if 0
if (vsrc1 != methodToCall->insSize) {
- LOGW("WRONG METHOD: base=%s.%s virtual[%d]=%s.%s\n",
+ LOGW("WRONG METHOD: base=%s.%s virtual[%d]=%s.%s",
baseMethod->clazz->descriptor, baseMethod->name,
(u4) baseMethod->methodIndex,
methodToCall->clazz->descriptor, methodToCall->name);
@@ -4629,7 +4629,7 @@ GOTO_TARGET(invokeSuper, bool methodCallRange, bool jumboFormat)
if (baseMethod == NULL) {
baseMethod = dvmResolveMethod(curMethod->clazz, ref,METHOD_VIRTUAL);
if (baseMethod == NULL) {
- ILOGV("+ unknown method or access denied\n");
+ ILOGV("+ unknown method or access denied");
GOTO_exceptionThrown();
}
}
@@ -4662,7 +4662,7 @@ GOTO_TARGET(invokeSuper, bool methodCallRange, bool jumboFormat)
assert(!dvmIsAbstractMethod(methodToCall) ||
methodToCall->nativeFunc != NULL);
#endif
- LOGVV("+++ base=%s.%s super-virtual=%s.%s\n",
+ LOGVV("+++ base=%s.%s super-virtual=%s.%s",
baseMethod->clazz->descriptor, baseMethod->name,
methodToCall->clazz->descriptor, methodToCall->name);
assert(methodToCall != NULL);
@@ -4771,7 +4771,7 @@ GOTO_TARGET(invokeDirect, bool methodCallRange, bool jumboFormat)
methodToCall = dvmResolveMethod(curMethod->clazz, ref,
METHOD_DIRECT);
if (methodToCall == NULL) {
- ILOGV("+ unknown direct method\n"); // should be impossible
+ ILOGV("+ unknown direct method"); // should be impossible
GOTO_exceptionThrown();
}
}
@@ -4806,7 +4806,7 @@ GOTO_TARGET(invokeStatic, bool methodCallRange, bool jumboFormat)
if (methodToCall == NULL) {
methodToCall = dvmResolveMethod(curMethod->clazz, ref, METHOD_STATIC);
if (methodToCall == NULL) {
- ILOGV("+ unknown method\n");
+ ILOGV("+ unknown method");
GOTO_exceptionThrown();
}
@@ -4877,7 +4877,7 @@ GOTO_TARGET(invokeVirtualQuick, bool methodCallRange, bool jumboFormat)
methodToCall->nativeFunc != NULL);
#endif
- LOGVV("+++ virtual[%d]=%s.%s\n",
+ LOGVV("+++ virtual[%d]=%s.%s",
ref, methodToCall->clazz->descriptor, methodToCall->name);
assert(methodToCall != NULL);
@@ -4937,7 +4937,7 @@ GOTO_TARGET(invokeSuperQuick, bool methodCallRange, bool jumboFormat)
assert(!dvmIsAbstractMethod(methodToCall) ||
methodToCall->nativeFunc != NULL);
#endif
- LOGVV("+++ super-virtual[%d]=%s.%s\n",
+ LOGVV("+++ super-virtual[%d]=%s.%s",
ref, methodToCall->clazz->descriptor, methodToCall->name);
assert(methodToCall != NULL);
GOTO_invokeMethod(methodCallRange, methodToCall, vsrc1, vdst);
@@ -4985,7 +4985,7 @@ GOTO_TARGET(returnFromMethod)
if (dvmIsBreakFrame(fp)) {
/* bail without popping the method frame from stack */
- LOGVV("+++ returned into break frame\n");
+ LOGVV("+++ returned into break frame");
GOTO_bail();
}
@@ -5006,7 +5006,7 @@ GOTO_TARGET(returnFromMethod)
{
FINISH(3);
} else {
- //LOGE("Unknown invoke instr %02x at %d\n",
+ //LOGE("Unknown invoke instr %02x at %d",
// invokeInstr, (int) (pc - curMethod->insns));
assert(false);
}
@@ -5038,7 +5038,7 @@ GOTO_TARGET(exceptionThrown)
dvmAddTrackedAlloc(exception, self);
dvmClearException(self);
- LOGV("Handling exception %s at %s:%d\n",
+ LOGV("Handling exception %s at %s:%d",
exception->clazz->descriptor, curMethod->name,
dvmLineNumFromPC(curMethod, pc - curMethod->insns));
@@ -5106,7 +5106,7 @@ GOTO_TARGET(exceptionThrown)
if (catchRelPc < 0) {
/* falling through to JNI code or off the bottom of the stack */
#if DVM_SHOW_EXCEPTION >= 2
- LOGD("Exception %s from %s:%d not caught locally\n",
+ LOGD("Exception %s from %s:%d not caught locally",
exception->clazz->descriptor, dvmGetMethodSourceFile(curMethod),
dvmLineNumFromPC(curMethod, pc - curMethod->insns));
#endif
@@ -5118,7 +5118,7 @@ GOTO_TARGET(exceptionThrown)
#if DVM_SHOW_EXCEPTION >= 3
{
const Method* catchMethod = SAVEAREA_FROM_FP(fp)->method;
- LOGD("Exception %s thrown from %s:%d to %s:%d\n",
+ LOGD("Exception %s thrown from %s:%d to %s:%d",
exception->clazz->descriptor, dvmGetMethodSourceFile(curMethod),
dvmLineNumFromPC(curMethod, pc - curMethod->insns),
dvmGetMethodSourceFile(catchMethod),
@@ -5268,7 +5268,7 @@ GOTO_TARGET(invokeMethod, bool methodCallRange, const Method* _methodToCall,
bottom = (u1*) newSaveArea - methodToCall->outsSize * sizeof(u4);
if (bottom < self->interpStackEnd) {
/* stack overflow */
- LOGV("Stack overflow on method call (start=%p end=%p newBot=%p(%d) size=%d '%s')\n",
+ LOGV("Stack overflow on method call (start=%p end=%p newBot=%p(%d) size=%d '%s')",
self->interpStackStart, self->interpStackEnd, bottom,
(u1*) fp - bottom, self->interpStackSize,
methodToCall->name);
@@ -5276,7 +5276,7 @@ GOTO_TARGET(invokeMethod, bool methodCallRange, const Method* _methodToCall,
assert(dvmCheckException(self));
GOTO_exceptionThrown();
}
- //LOGD("+++ fp=%p newFp=%p newSave=%p bottom=%p\n",
+ //LOGD("+++ fp=%p newFp=%p newSave=%p bottom=%p",
// fp, newFp, newSaveArea, bottom);
}
@@ -5367,7 +5367,7 @@ GOTO_TARGET(invokeMethod, bool methodCallRange, const Method* _methodToCall,
* it, jump to our local exception handling.
*/
if (dvmCheckException(self)) {
- LOGV("Exception thrown by/below native code\n");
+ LOGV("Exception thrown by/below native code");
GOTO_exceptionThrown();
}
@@ -5383,7 +5383,7 @@ GOTO_TARGET(invokeMethod, bool methodCallRange, const Method* _methodToCall,
{
FINISH(3);
} else {
- //LOGE("Unknown invoke instr %02x at %d\n",
+ //LOGE("Unknown invoke instr %02x at %d",
// invokeInstr, (int) (pc - curMethod->insns));
assert(false);
}
diff --git a/vm/mterp/out/InterpC-x86-atom.cpp b/vm/mterp/out/InterpC-x86-atom.cpp
index 5631917db..2ace55f1b 100644
--- a/vm/mterp/out/InterpC-x86-atom.cpp
+++ b/vm/mterp/out/InterpC-x86-atom.cpp
@@ -102,7 +102,7 @@
{ \
char* desc; \
desc = dexProtoCopyMethodDescriptor(&curMethod->prototype); \
- LOGE("Invalid branch %d at 0x%04x in %s.%s %s\n", \
+ LOGE("Invalid branch %d at 0x%04x in %s.%s %s", \
myoff, (int) (pc - curMethod->insns), \
curMethod->clazz->descriptor, curMethod->name, desc); \
free(desc); \
@@ -127,11 +127,11 @@
# define ILOG(_level, ...) do { \
char debugStrBuf[128]; \
snprintf(debugStrBuf, sizeof(debugStrBuf), __VA_ARGS__); \
- if (curMethod != NULL) \
- LOG(_level, LOG_TAG"i", "%-2d|%04x%s\n", \
+ if (curMethod != NULL) \
+ LOG(_level, LOG_TAG"i", "%-2d|%04x%s", \
self->threadId, (int)(pc - curMethod->insns), debugStrBuf); \
else \
- LOG(_level, LOG_TAG"i", "%-2d|####%s\n", \
+ LOG(_level, LOG_TAG"i", "%-2d|####%s", \
self->threadId, debugStrBuf); \
} while(false)
void dvmDumpRegs(const Method* method, const u4* framePtr, bool inOnly);
@@ -321,14 +321,14 @@ static inline bool checkForNull(Object* obj)
}
#ifdef WITH_EXTRA_OBJECT_VALIDATION
if (!dvmIsValidObject(obj)) {
- LOGE("Invalid object %p\n", obj);
+ LOGE("Invalid object %p", obj);
dvmAbort();
}
#endif
#ifndef NDEBUG
if (obj->clazz == NULL || ((u4) obj->clazz) <= 65536) {
/* probable heap corruption */
- LOGE("Invalid object class %p (in %p)\n", obj->clazz, obj);
+ LOGE("Invalid object class %p (in %p)", obj->clazz, obj);
dvmAbort();
}
#endif
@@ -353,14 +353,14 @@ static inline bool checkForNullExportPC(Object* obj, u4* fp, const u2* pc)
}
#ifdef WITH_EXTRA_OBJECT_VALIDATION
if (!dvmIsValidObject(obj)) {
- LOGE("Invalid object %p\n", obj);
+ LOGE("Invalid object %p", obj);
dvmAbort();
}
#endif
#ifndef NDEBUG
if (obj->clazz == NULL || ((u4) obj->clazz) <= 65536) {
/* probable heap corruption */
- LOGE("Invalid object class %p (in %p)\n", obj->clazz, obj);
+ LOGE("Invalid object class %p (in %p)", obj->clazz, obj);
dvmAbort();
}
#endif
@@ -595,7 +595,7 @@ GOTO_TARGET_DECL(exceptionThrown);
result = 1; \
else \
result = (_nanVal); \
- ILOGV("+ result=%d\n", result); \
+ ILOGV("+ result=%d", result); \
SET_REGISTER(vdst, result); \
} \
FINISH(2);
@@ -1174,7 +1174,7 @@ GOTO_TARGET_DECL(exceptionThrown);
if (sfield == NULL) \
GOTO_exceptionThrown(); \
if (dvmDexGetResolvedField(methodClassDex, ref) == NULL) { \
- JIT_STUB_HACK(dvmJitEndTraceSelect(self,pc)); \
+ JIT_STUB_HACK(dvmJitEndTraceSelect(self,pc)); \
} \
} \
SET_REGISTER##_regsize(vdst, dvmGetStaticField##_ftype(sfield)); \
@@ -1197,7 +1197,7 @@ GOTO_TARGET_DECL(exceptionThrown);
if (sfield == NULL) \
GOTO_exceptionThrown(); \
if (dvmDexGetResolvedField(methodClassDex, ref) == NULL) { \
- JIT_STUB_HACK(dvmJitEndTraceSelect(self,pc)); \
+ JIT_STUB_HACK(dvmJitEndTraceSelect(self,pc)); \
} \
} \
SET_REGISTER##_regsize(vdst, dvmGetStaticField##_ftype(sfield)); \
@@ -1220,7 +1220,7 @@ GOTO_TARGET_DECL(exceptionThrown);
if (sfield == NULL) \
GOTO_exceptionThrown(); \
if (dvmDexGetResolvedField(methodClassDex, ref) == NULL) { \
- JIT_STUB_HACK(dvmJitEndTraceSelect(self,pc)); \
+ JIT_STUB_HACK(dvmJitEndTraceSelect(self,pc)); \
} \
} \
dvmSetStaticField##_ftype(sfield, GET_REGISTER##_regsize(vdst)); \
@@ -1243,7 +1243,7 @@ GOTO_TARGET_DECL(exceptionThrown);
if (sfield == NULL) \
GOTO_exceptionThrown(); \
if (dvmDexGetResolvedField(methodClassDex, ref) == NULL) { \
- JIT_STUB_HACK(dvmJitEndTraceSelect(self,pc)); \
+ JIT_STUB_HACK(dvmJitEndTraceSelect(self,pc)); \
} \
} \
dvmSetStaticField##_ftype(sfield, GET_REGISTER##_regsize(vdst)); \
@@ -1307,7 +1307,7 @@ HANDLE_OPCODE(OP_BREAKPOINT)
* the thread resumed.
*/
u1 originalOpcode = dvmGetOriginalOpcode(pc);
- LOGV("+++ break 0x%02x (0x%04x -> 0x%04x)\n", originalOpcode, inst,
+ LOGV("+++ break 0x%02x (0x%04x -> 0x%04x)", originalOpcode, inst,
INST_REPLACE_OP(inst, originalOpcode));
inst = INST_REPLACE_OP(inst, originalOpcode);
FINISH_BKPT(originalOpcode);
@@ -1560,7 +1560,7 @@ GOTO_TARGET(filledNewArray, bool methodCallRange, bool jumboFormat)
/*
* Create an array of the specified type.
*/
- LOGVV("+++ filled-new-array type is '%s'\n", arrayClass->descriptor);
+ LOGVV("+++ filled-new-array type is '%s'", arrayClass->descriptor);
typeCh = arrayClass->descriptor[1];
if (typeCh == 'D' || typeCh == 'J') {
/* category 2 primitives not allowed */
@@ -1568,7 +1568,7 @@ GOTO_TARGET(filledNewArray, bool methodCallRange, bool jumboFormat)
GOTO_exceptionThrown();
} else if (typeCh != 'L' && typeCh != '[' && typeCh != 'I') {
/* TODO: requires multiple "fill in" loops with different widths */
- LOGE("non-int primitives not implemented\n");
+ LOGE("non-int primitives not implemented");
dvmThrowInternalError(
"filled-new-array not implemented for anything but 'int'");
GOTO_exceptionThrown();
@@ -1658,7 +1658,7 @@ GOTO_TARGET(invokeVirtual, bool methodCallRange, bool jumboFormat)
if (baseMethod == NULL) {
baseMethod = dvmResolveMethod(curMethod->clazz, ref,METHOD_VIRTUAL);
if (baseMethod == NULL) {
- ILOGV("+ unknown method or access denied\n");
+ ILOGV("+ unknown method or access denied");
GOTO_exceptionThrown();
}
}
@@ -1694,7 +1694,7 @@ GOTO_TARGET(invokeVirtual, bool methodCallRange, bool jumboFormat)
methodToCall->nativeFunc != NULL);
#endif
- LOGVV("+++ base=%s.%s virtual[%d]=%s.%s\n",
+ LOGVV("+++ base=%s.%s virtual[%d]=%s.%s",
baseMethod->clazz->descriptor, baseMethod->name,
(u4) baseMethod->methodIndex,
methodToCall->clazz->descriptor, methodToCall->name);
@@ -1702,7 +1702,7 @@ GOTO_TARGET(invokeVirtual, bool methodCallRange, bool jumboFormat)
#if 0
if (vsrc1 != methodToCall->insSize) {
- LOGW("WRONG METHOD: base=%s.%s virtual[%d]=%s.%s\n",
+ LOGW("WRONG METHOD: base=%s.%s virtual[%d]=%s.%s",
baseMethod->clazz->descriptor, baseMethod->name,
(u4) baseMethod->methodIndex,
methodToCall->clazz->descriptor, methodToCall->name);
@@ -1762,7 +1762,7 @@ GOTO_TARGET(invokeSuper, bool methodCallRange, bool jumboFormat)
if (baseMethod == NULL) {
baseMethod = dvmResolveMethod(curMethod->clazz, ref,METHOD_VIRTUAL);
if (baseMethod == NULL) {
- ILOGV("+ unknown method or access denied\n");
+ ILOGV("+ unknown method or access denied");
GOTO_exceptionThrown();
}
}
@@ -1795,7 +1795,7 @@ GOTO_TARGET(invokeSuper, bool methodCallRange, bool jumboFormat)
assert(!dvmIsAbstractMethod(methodToCall) ||
methodToCall->nativeFunc != NULL);
#endif
- LOGVV("+++ base=%s.%s super-virtual=%s.%s\n",
+ LOGVV("+++ base=%s.%s super-virtual=%s.%s",
baseMethod->clazz->descriptor, baseMethod->name,
methodToCall->clazz->descriptor, methodToCall->name);
assert(methodToCall != NULL);
@@ -1904,7 +1904,7 @@ GOTO_TARGET(invokeDirect, bool methodCallRange, bool jumboFormat)
methodToCall = dvmResolveMethod(curMethod->clazz, ref,
METHOD_DIRECT);
if (methodToCall == NULL) {
- ILOGV("+ unknown direct method\n"); // should be impossible
+ ILOGV("+ unknown direct method"); // should be impossible
GOTO_exceptionThrown();
}
}
@@ -1939,7 +1939,7 @@ GOTO_TARGET(invokeStatic, bool methodCallRange, bool jumboFormat)
if (methodToCall == NULL) {
methodToCall = dvmResolveMethod(curMethod->clazz, ref, METHOD_STATIC);
if (methodToCall == NULL) {
- ILOGV("+ unknown method\n");
+ ILOGV("+ unknown method");
GOTO_exceptionThrown();
}
@@ -2010,7 +2010,7 @@ GOTO_TARGET(invokeVirtualQuick, bool methodCallRange, bool jumboFormat)
methodToCall->nativeFunc != NULL);
#endif
- LOGVV("+++ virtual[%d]=%s.%s\n",
+ LOGVV("+++ virtual[%d]=%s.%s",
ref, methodToCall->clazz->descriptor, methodToCall->name);
assert(methodToCall != NULL);
@@ -2070,7 +2070,7 @@ GOTO_TARGET(invokeSuperQuick, bool methodCallRange, bool jumboFormat)
assert(!dvmIsAbstractMethod(methodToCall) ||
methodToCall->nativeFunc != NULL);
#endif
- LOGVV("+++ super-virtual[%d]=%s.%s\n",
+ LOGVV("+++ super-virtual[%d]=%s.%s",
ref, methodToCall->clazz->descriptor, methodToCall->name);
assert(methodToCall != NULL);
GOTO_invokeMethod(methodCallRange, methodToCall, vsrc1, vdst);
@@ -2118,7 +2118,7 @@ GOTO_TARGET(returnFromMethod)
if (dvmIsBreakFrame(fp)) {
/* bail without popping the method frame from stack */
- LOGVV("+++ returned into break frame\n");
+ LOGVV("+++ returned into break frame");
GOTO_bail();
}
@@ -2139,7 +2139,7 @@ GOTO_TARGET(returnFromMethod)
{
FINISH(3);
} else {
- //LOGE("Unknown invoke instr %02x at %d\n",
+ //LOGE("Unknown invoke instr %02x at %d",
// invokeInstr, (int) (pc - curMethod->insns));
assert(false);
}
@@ -2171,7 +2171,7 @@ GOTO_TARGET(exceptionThrown)
dvmAddTrackedAlloc(exception, self);
dvmClearException(self);
- LOGV("Handling exception %s at %s:%d\n",
+ LOGV("Handling exception %s at %s:%d",
exception->clazz->descriptor, curMethod->name,
dvmLineNumFromPC(curMethod, pc - curMethod->insns));
@@ -2239,7 +2239,7 @@ GOTO_TARGET(exceptionThrown)
if (catchRelPc < 0) {
/* falling through to JNI code or off the bottom of the stack */
#if DVM_SHOW_EXCEPTION >= 2
- LOGD("Exception %s from %s:%d not caught locally\n",
+ LOGD("Exception %s from %s:%d not caught locally",
exception->clazz->descriptor, dvmGetMethodSourceFile(curMethod),
dvmLineNumFromPC(curMethod, pc - curMethod->insns));
#endif
@@ -2251,7 +2251,7 @@ GOTO_TARGET(exceptionThrown)
#if DVM_SHOW_EXCEPTION >= 3
{
const Method* catchMethod = SAVEAREA_FROM_FP(fp)->method;
- LOGD("Exception %s thrown from %s:%d to %s:%d\n",
+ LOGD("Exception %s thrown from %s:%d to %s:%d",
exception->clazz->descriptor, dvmGetMethodSourceFile(curMethod),
dvmLineNumFromPC(curMethod, pc - curMethod->insns),
dvmGetMethodSourceFile(catchMethod),
@@ -2401,7 +2401,7 @@ GOTO_TARGET(invokeMethod, bool methodCallRange, const Method* _methodToCall,
bottom = (u1*) newSaveArea - methodToCall->outsSize * sizeof(u4);
if (bottom < self->interpStackEnd) {
/* stack overflow */
- LOGV("Stack overflow on method call (start=%p end=%p newBot=%p(%d) size=%d '%s')\n",
+ LOGV("Stack overflow on method call (start=%p end=%p newBot=%p(%d) size=%d '%s')",
self->interpStackStart, self->interpStackEnd, bottom,
(u1*) fp - bottom, self->interpStackSize,
methodToCall->name);
@@ -2409,7 +2409,7 @@ GOTO_TARGET(invokeMethod, bool methodCallRange, const Method* _methodToCall,
assert(dvmCheckException(self));
GOTO_exceptionThrown();
}
- //LOGD("+++ fp=%p newFp=%p newSave=%p bottom=%p\n",
+ //LOGD("+++ fp=%p newFp=%p newSave=%p bottom=%p",
// fp, newFp, newSaveArea, bottom);
}
@@ -2500,7 +2500,7 @@ GOTO_TARGET(invokeMethod, bool methodCallRange, const Method* _methodToCall,
* it, jump to our local exception handling.
*/
if (dvmCheckException(self)) {
- LOGV("Exception thrown by/below native code\n");
+ LOGV("Exception thrown by/below native code");
GOTO_exceptionThrown();
}
@@ -2516,7 +2516,7 @@ GOTO_TARGET(invokeMethod, bool methodCallRange, const Method* _methodToCall,
{
FINISH(3);
} else {
- //LOGE("Unknown invoke instr %02x at %d\n",
+ //LOGE("Unknown invoke instr %02x at %d",
// invokeInstr, (int) (pc - curMethod->insns));
assert(false);
}
diff --git a/vm/mterp/out/InterpC-x86.cpp b/vm/mterp/out/InterpC-x86.cpp
index 1d90ae7b8..80cae6fbe 100644
--- a/vm/mterp/out/InterpC-x86.cpp
+++ b/vm/mterp/out/InterpC-x86.cpp
@@ -102,7 +102,7 @@
{ \
char* desc; \
desc = dexProtoCopyMethodDescriptor(&curMethod->prototype); \
- LOGE("Invalid branch %d at 0x%04x in %s.%s %s\n", \
+ LOGE("Invalid branch %d at 0x%04x in %s.%s %s", \
myoff, (int) (pc - curMethod->insns), \
curMethod->clazz->descriptor, curMethod->name, desc); \
free(desc); \
@@ -127,11 +127,11 @@
# define ILOG(_level, ...) do { \
char debugStrBuf[128]; \
snprintf(debugStrBuf, sizeof(debugStrBuf), __VA_ARGS__); \
- if (curMethod != NULL) \
- LOG(_level, LOG_TAG"i", "%-2d|%04x%s\n", \
+ if (curMethod != NULL) \
+ LOG(_level, LOG_TAG"i", "%-2d|%04x%s", \
self->threadId, (int)(pc - curMethod->insns), debugStrBuf); \
else \
- LOG(_level, LOG_TAG"i", "%-2d|####%s\n", \
+ LOG(_level, LOG_TAG"i", "%-2d|####%s", \
self->threadId, debugStrBuf); \
} while(false)
void dvmDumpRegs(const Method* method, const u4* framePtr, bool inOnly);
@@ -321,14 +321,14 @@ static inline bool checkForNull(Object* obj)
}
#ifdef WITH_EXTRA_OBJECT_VALIDATION
if (!dvmIsValidObject(obj)) {
- LOGE("Invalid object %p\n", obj);
+ LOGE("Invalid object %p", obj);
dvmAbort();
}
#endif
#ifndef NDEBUG
if (obj->clazz == NULL || ((u4) obj->clazz) <= 65536) {
/* probable heap corruption */
- LOGE("Invalid object class %p (in %p)\n", obj->clazz, obj);
+ LOGE("Invalid object class %p (in %p)", obj->clazz, obj);
dvmAbort();
}
#endif
@@ -353,14 +353,14 @@ static inline bool checkForNullExportPC(Object* obj, u4* fp, const u2* pc)
}
#ifdef WITH_EXTRA_OBJECT_VALIDATION
if (!dvmIsValidObject(obj)) {
- LOGE("Invalid object %p\n", obj);
+ LOGE("Invalid object %p", obj);
dvmAbort();
}
#endif
#ifndef NDEBUG
if (obj->clazz == NULL || ((u4) obj->clazz) <= 65536) {
/* probable heap corruption */
- LOGE("Invalid object class %p (in %p)\n", obj->clazz, obj);
+ LOGE("Invalid object class %p (in %p)", obj->clazz, obj);
dvmAbort();
}
#endif
@@ -595,7 +595,7 @@ GOTO_TARGET_DECL(exceptionThrown);
result = 1; \
else \
result = (_nanVal); \
- ILOGV("+ result=%d\n", result); \
+ ILOGV("+ result=%d", result); \
SET_REGISTER(vdst, result); \
} \
FINISH(2);
@@ -1174,7 +1174,7 @@ GOTO_TARGET_DECL(exceptionThrown);
if (sfield == NULL) \
GOTO_exceptionThrown(); \
if (dvmDexGetResolvedField(methodClassDex, ref) == NULL) { \
- JIT_STUB_HACK(dvmJitEndTraceSelect(self,pc)); \
+ JIT_STUB_HACK(dvmJitEndTraceSelect(self,pc)); \
} \
} \
SET_REGISTER##_regsize(vdst, dvmGetStaticField##_ftype(sfield)); \
@@ -1197,7 +1197,7 @@ GOTO_TARGET_DECL(exceptionThrown);
if (sfield == NULL) \
GOTO_exceptionThrown(); \
if (dvmDexGetResolvedField(methodClassDex, ref) == NULL) { \
- JIT_STUB_HACK(dvmJitEndTraceSelect(self,pc)); \
+ JIT_STUB_HACK(dvmJitEndTraceSelect(self,pc)); \
} \
} \
SET_REGISTER##_regsize(vdst, dvmGetStaticField##_ftype(sfield)); \
@@ -1220,7 +1220,7 @@ GOTO_TARGET_DECL(exceptionThrown);
if (sfield == NULL) \
GOTO_exceptionThrown(); \
if (dvmDexGetResolvedField(methodClassDex, ref) == NULL) { \
- JIT_STUB_HACK(dvmJitEndTraceSelect(self,pc)); \
+ JIT_STUB_HACK(dvmJitEndTraceSelect(self,pc)); \
} \
} \
dvmSetStaticField##_ftype(sfield, GET_REGISTER##_regsize(vdst)); \
@@ -1243,7 +1243,7 @@ GOTO_TARGET_DECL(exceptionThrown);
if (sfield == NULL) \
GOTO_exceptionThrown(); \
if (dvmDexGetResolvedField(methodClassDex, ref) == NULL) { \
- JIT_STUB_HACK(dvmJitEndTraceSelect(self,pc)); \
+ JIT_STUB_HACK(dvmJitEndTraceSelect(self,pc)); \
} \
} \
dvmSetStaticField##_ftype(sfield, GET_REGISTER##_regsize(vdst)); \
@@ -1502,7 +1502,7 @@ GOTO_TARGET(filledNewArray, bool methodCallRange, bool jumboFormat)
/*
* Create an array of the specified type.
*/
- LOGVV("+++ filled-new-array type is '%s'\n", arrayClass->descriptor);
+ LOGVV("+++ filled-new-array type is '%s'", arrayClass->descriptor);
typeCh = arrayClass->descriptor[1];
if (typeCh == 'D' || typeCh == 'J') {
/* category 2 primitives not allowed */
@@ -1510,7 +1510,7 @@ GOTO_TARGET(filledNewArray, bool methodCallRange, bool jumboFormat)
GOTO_exceptionThrown();
} else if (typeCh != 'L' && typeCh != '[' && typeCh != 'I') {
/* TODO: requires multiple "fill in" loops with different widths */
- LOGE("non-int primitives not implemented\n");
+ LOGE("non-int primitives not implemented");
dvmThrowInternalError(
"filled-new-array not implemented for anything but 'int'");
GOTO_exceptionThrown();
@@ -1600,7 +1600,7 @@ GOTO_TARGET(invokeVirtual, bool methodCallRange, bool jumboFormat)
if (baseMethod == NULL) {
baseMethod = dvmResolveMethod(curMethod->clazz, ref,METHOD_VIRTUAL);
if (baseMethod == NULL) {
- ILOGV("+ unknown method or access denied\n");
+ ILOGV("+ unknown method or access denied");
GOTO_exceptionThrown();
}
}
@@ -1636,7 +1636,7 @@ GOTO_TARGET(invokeVirtual, bool methodCallRange, bool jumboFormat)
methodToCall->nativeFunc != NULL);
#endif
- LOGVV("+++ base=%s.%s virtual[%d]=%s.%s\n",
+ LOGVV("+++ base=%s.%s virtual[%d]=%s.%s",
baseMethod->clazz->descriptor, baseMethod->name,
(u4) baseMethod->methodIndex,
methodToCall->clazz->descriptor, methodToCall->name);
@@ -1644,7 +1644,7 @@ GOTO_TARGET(invokeVirtual, bool methodCallRange, bool jumboFormat)
#if 0
if (vsrc1 != methodToCall->insSize) {
- LOGW("WRONG METHOD: base=%s.%s virtual[%d]=%s.%s\n",
+ LOGW("WRONG METHOD: base=%s.%s virtual[%d]=%s.%s",
baseMethod->clazz->descriptor, baseMethod->name,
(u4) baseMethod->methodIndex,
methodToCall->clazz->descriptor, methodToCall->name);
@@ -1704,7 +1704,7 @@ GOTO_TARGET(invokeSuper, bool methodCallRange, bool jumboFormat)
if (baseMethod == NULL) {
baseMethod = dvmResolveMethod(curMethod->clazz, ref,METHOD_VIRTUAL);
if (baseMethod == NULL) {
- ILOGV("+ unknown method or access denied\n");
+ ILOGV("+ unknown method or access denied");
GOTO_exceptionThrown();
}
}
@@ -1737,7 +1737,7 @@ GOTO_TARGET(invokeSuper, bool methodCallRange, bool jumboFormat)
assert(!dvmIsAbstractMethod(methodToCall) ||
methodToCall->nativeFunc != NULL);
#endif
- LOGVV("+++ base=%s.%s super-virtual=%s.%s\n",
+ LOGVV("+++ base=%s.%s super-virtual=%s.%s",
baseMethod->clazz->descriptor, baseMethod->name,
methodToCall->clazz->descriptor, methodToCall->name);
assert(methodToCall != NULL);
@@ -1846,7 +1846,7 @@ GOTO_TARGET(invokeDirect, bool methodCallRange, bool jumboFormat)
methodToCall = dvmResolveMethod(curMethod->clazz, ref,
METHOD_DIRECT);
if (methodToCall == NULL) {
- ILOGV("+ unknown direct method\n"); // should be impossible
+ ILOGV("+ unknown direct method"); // should be impossible
GOTO_exceptionThrown();
}
}
@@ -1881,7 +1881,7 @@ GOTO_TARGET(invokeStatic, bool methodCallRange, bool jumboFormat)
if (methodToCall == NULL) {
methodToCall = dvmResolveMethod(curMethod->clazz, ref, METHOD_STATIC);
if (methodToCall == NULL) {
- ILOGV("+ unknown method\n");
+ ILOGV("+ unknown method");
GOTO_exceptionThrown();
}
@@ -1952,7 +1952,7 @@ GOTO_TARGET(invokeVirtualQuick, bool methodCallRange, bool jumboFormat)
methodToCall->nativeFunc != NULL);
#endif
- LOGVV("+++ virtual[%d]=%s.%s\n",
+ LOGVV("+++ virtual[%d]=%s.%s",
ref, methodToCall->clazz->descriptor, methodToCall->name);
assert(methodToCall != NULL);
@@ -2012,7 +2012,7 @@ GOTO_TARGET(invokeSuperQuick, bool methodCallRange, bool jumboFormat)
assert(!dvmIsAbstractMethod(methodToCall) ||
methodToCall->nativeFunc != NULL);
#endif
- LOGVV("+++ super-virtual[%d]=%s.%s\n",
+ LOGVV("+++ super-virtual[%d]=%s.%s",
ref, methodToCall->clazz->descriptor, methodToCall->name);
assert(methodToCall != NULL);
GOTO_invokeMethod(methodCallRange, methodToCall, vsrc1, vdst);
@@ -2060,7 +2060,7 @@ GOTO_TARGET(returnFromMethod)
if (dvmIsBreakFrame(fp)) {
/* bail without popping the method frame from stack */
- LOGVV("+++ returned into break frame\n");
+ LOGVV("+++ returned into break frame");
GOTO_bail();
}
@@ -2081,7 +2081,7 @@ GOTO_TARGET(returnFromMethod)
{
FINISH(3);
} else {
- //LOGE("Unknown invoke instr %02x at %d\n",
+ //LOGE("Unknown invoke instr %02x at %d",
// invokeInstr, (int) (pc - curMethod->insns));
assert(false);
}
@@ -2113,7 +2113,7 @@ GOTO_TARGET(exceptionThrown)
dvmAddTrackedAlloc(exception, self);
dvmClearException(self);
- LOGV("Handling exception %s at %s:%d\n",
+ LOGV("Handling exception %s at %s:%d",
exception->clazz->descriptor, curMethod->name,
dvmLineNumFromPC(curMethod, pc - curMethod->insns));
@@ -2181,7 +2181,7 @@ GOTO_TARGET(exceptionThrown)
if (catchRelPc < 0) {
/* falling through to JNI code or off the bottom of the stack */
#if DVM_SHOW_EXCEPTION >= 2
- LOGD("Exception %s from %s:%d not caught locally\n",
+ LOGD("Exception %s from %s:%d not caught locally",
exception->clazz->descriptor, dvmGetMethodSourceFile(curMethod),
dvmLineNumFromPC(curMethod, pc - curMethod->insns));
#endif
@@ -2193,7 +2193,7 @@ GOTO_TARGET(exceptionThrown)
#if DVM_SHOW_EXCEPTION >= 3
{
const Method* catchMethod = SAVEAREA_FROM_FP(fp)->method;
- LOGD("Exception %s thrown from %s:%d to %s:%d\n",
+ LOGD("Exception %s thrown from %s:%d to %s:%d",
exception->clazz->descriptor, dvmGetMethodSourceFile(curMethod),
dvmLineNumFromPC(curMethod, pc - curMethod->insns),
dvmGetMethodSourceFile(catchMethod),
@@ -2343,7 +2343,7 @@ GOTO_TARGET(invokeMethod, bool methodCallRange, const Method* _methodToCall,
bottom = (u1*) newSaveArea - methodToCall->outsSize * sizeof(u4);
if (bottom < self->interpStackEnd) {
/* stack overflow */
- LOGV("Stack overflow on method call (start=%p end=%p newBot=%p(%d) size=%d '%s')\n",
+ LOGV("Stack overflow on method call (start=%p end=%p newBot=%p(%d) size=%d '%s')",
self->interpStackStart, self->interpStackEnd, bottom,
(u1*) fp - bottom, self->interpStackSize,
methodToCall->name);
@@ -2351,7 +2351,7 @@ GOTO_TARGET(invokeMethod, bool methodCallRange, const Method* _methodToCall,
assert(dvmCheckException(self));
GOTO_exceptionThrown();
}
- //LOGD("+++ fp=%p newFp=%p newSave=%p bottom=%p\n",
+ //LOGD("+++ fp=%p newFp=%p newSave=%p bottom=%p",
// fp, newFp, newSaveArea, bottom);
}
@@ -2442,7 +2442,7 @@ GOTO_TARGET(invokeMethod, bool methodCallRange, const Method* _methodToCall,
* it, jump to our local exception handling.
*/
if (dvmCheckException(self)) {
- LOGV("Exception thrown by/below native code\n");
+ LOGV("Exception thrown by/below native code");
GOTO_exceptionThrown();
}
@@ -2458,7 +2458,7 @@ GOTO_TARGET(invokeMethod, bool methodCallRange, const Method* _methodToCall,
{
FINISH(3);
} else {
- //LOGE("Unknown invoke instr %02x at %d\n",
+ //LOGE("Unknown invoke instr %02x at %d",
// invokeInstr, (int) (pc - curMethod->insns));
assert(false);
}
diff --git a/vm/mterp/portable/entry.cpp b/vm/mterp/portable/entry.cpp
index ad6d25403..062de1c19 100644
--- a/vm/mterp/portable/entry.cpp
+++ b/vm/mterp/portable/entry.cpp
@@ -36,7 +36,7 @@ void dvmInterpretPortable(Thread* self)
methodClassDex = curMethod->clazz->pDvmDex;
- LOGVV("threadid=%d: %s.%s pc=0x%x fp=%p\n",
+ LOGVV("threadid=%d: %s.%s pc=0x%x fp=%p",
self->threadId, curMethod->clazz->descriptor, curMethod->name,
pc - curMethod->insns, fp);
diff --git a/vm/native/InternalNative.cpp b/vm/native/InternalNative.cpp
index 7ebe8b9c3..1be0646d1 100644
--- a/vm/native/InternalNative.cpp
+++ b/vm/native/InternalNative.cpp
@@ -118,7 +118,7 @@ DalvikNativeFunc dvmLookupInternalNativeMethod(const Method* method)
pMeth->signature, method) == 0)
{
/* match */
- //LOGV("+++ match on %s.%s %s at %p\n",
+ //LOGV("+++ match on %s.%s %s at %p",
// className, methodName, methodSignature, pMeth->fnPtr);
return pMeth->fnPtr;
}
@@ -141,7 +141,7 @@ DalvikNativeFunc dvmLookupInternalNativeMethod(const Method* method)
*/
void dvmAbstractMethodStub(const u4* args, JValue* pResult)
{
- LOGD("--- called into dvmAbstractMethodStub\n");
+ LOGD("--- called into dvmAbstractMethodStub");
dvmThrowAbstractMethodError("abstract method not implemented");
}
@@ -199,7 +199,7 @@ ClassObject* dvmFindClassByName(StringObject* nameObj, Object* loader,
* auto-generating bogus array classes.
*/
if (!dexIsValidClassName(name, true)) {
- LOGW("dvmFindClassByName rejecting '%s'\n", name);
+ LOGW("dvmFindClassByName rejecting '%s'", name);
dvmThrowClassNotFoundException(name);
goto bail;
}
@@ -215,7 +215,7 @@ ClassObject* dvmFindClassByName(StringObject* nameObj, Object* loader,
clazz = dvmFindClassNoInit(descriptor, loader);
if (clazz == NULL) {
- LOGVV("FAIL: load %s (%d)\n", descriptor, doInit);
+ LOGVV("FAIL: load %s (%d)", descriptor, doInit);
Thread* self = dvmThreadSelf();
Object* oldExcep = dvmGetException(self);
dvmAddTrackedAlloc(oldExcep, self); /* don't let this be GCed */
@@ -223,7 +223,7 @@ ClassObject* dvmFindClassByName(StringObject* nameObj, Object* loader,
dvmThrowChainedClassNotFoundException(name, oldExcep);
dvmReleaseTrackedAlloc(oldExcep, self);
} else {
- LOGVV("GOOD: load %s (%d) --> %p ldr=%p\n",
+ LOGVV("GOOD: load %s (%d) --> %p ldr=%p",
descriptor, doInit, clazz, clazz->classLoader);
}
diff --git a/vm/native/dalvik_system_DexFile.cpp b/vm/native/dalvik_system_DexFile.cpp
index 59dddfca2..3de6f5164 100644
--- a/vm/native/dalvik_system_DexFile.cpp
+++ b/vm/native/dalvik_system_DexFile.cpp
@@ -50,7 +50,7 @@ void dvmFreeDexOrJar(void* vptr)
{
DexOrJar* pDexOrJar = (DexOrJar*) vptr;
- LOGV("Freeing DexOrJar '%s'\n", pDexOrJar->fileName);
+ LOGV("Freeing DexOrJar '%s'", pDexOrJar->fileName);
if (pDexOrJar->isDex)
dvmRawDexFileFree(pDexOrJar->pRawDexFile);
@@ -82,7 +82,7 @@ static bool validateCookie(int cookie)
{
DexOrJar* pDexOrJar = (DexOrJar*) cookie;
- LOGVV("+++ dex verifying cookie %p\n", pDexOrJar);
+ LOGVV("+++ dex verifying cookie %p", pDexOrJar);
if (pDexOrJar == NULL)
return false;
@@ -122,7 +122,7 @@ static void addToDexFileTable(DexOrJar* pDexOrJar) {
dvmHashTableUnlock(gDvm.userDexFiles);
if (result != pDexOrJar) {
- LOGE("Pointer has already been added?\n");
+ LOGE("Pointer has already been added?");
dvmAbort();
}
@@ -192,7 +192,7 @@ static void Dalvik_dalvik_system_DexFile_openDexFile(const u4* args,
* if the caller specifies their own output file.
*/
if (dvmClassPathContains(gDvm.bootClassPath, sourceName)) {
- LOGW("Refusing to reopen boot DEX '%s'\n", sourceName);
+ LOGW("Refusing to reopen boot DEX '%s'", sourceName);
dvmThrowIOException(
"Re-opening BOOTCLASSPATH DEX files is not allowed");
free(sourceName);
@@ -207,21 +207,21 @@ static void Dalvik_dalvik_system_DexFile_openDexFile(const u4* args,
*/
if (hasDexExtension(sourceName)
&& dvmRawDexFileOpen(sourceName, outputName, &pRawDexFile, false) == 0) {
- LOGV("Opening DEX file '%s' (DEX)\n", sourceName);
+ LOGV("Opening DEX file '%s' (DEX)", sourceName);
pDexOrJar = (DexOrJar*) malloc(sizeof(DexOrJar));
pDexOrJar->isDex = true;
pDexOrJar->pRawDexFile = pRawDexFile;
pDexOrJar->pDexMemory = NULL;
} else if (dvmJarFileOpen(sourceName, outputName, &pJarFile, false) == 0) {
- LOGV("Opening DEX file '%s' (Jar)\n", sourceName);
+ LOGV("Opening DEX file '%s' (Jar)", sourceName);
pDexOrJar = (DexOrJar*) malloc(sizeof(DexOrJar));
pDexOrJar->isDex = false;
pDexOrJar->pJarFile = pJarFile;
pDexOrJar->pDexMemory = NULL;
} else {
- LOGV("Unable to open DEX file '%s'\n", sourceName);
+ LOGV("Unable to open DEX file '%s'", sourceName);
dvmThrowIOException("unable to open DEX file");
}
@@ -271,13 +271,13 @@ static void Dalvik_dalvik_system_DexFile_openDexFile_bytearray(const u4* args,
memcpy(pBytes, fileContentsObj->contents, length);
if (dvmRawDexFileOpenArray(pBytes, length, &pRawDexFile) != 0) {
- LOGV("Unable to open in-memory DEX file\n");
+ LOGV("Unable to open in-memory DEX file");
free(pBytes);
dvmThrowRuntimeException("unable to open in-memory DEX file");
RETURN_VOID();
}
- LOGV("Opening in-memory DEX\n");
+ LOGV("Opening in-memory DEX");
pDexOrJar = (DexOrJar*) malloc(sizeof(DexOrJar));
pDexOrJar->isDex = true;
pDexOrJar->pRawDexFile = pRawDexFile;
@@ -304,7 +304,7 @@ static void Dalvik_dalvik_system_DexFile_closeDexFile(const u4* args,
if (!validateCookie(cookie))
RETURN_VOID();
- LOGV("Closing DEX file %p (%s)\n", pDexOrJar, pDexOrJar->fileName);
+ LOGV("Closing DEX file %p (%s)", pDexOrJar, pDexOrJar->fileName);
/*
* We can't just free arbitrary DEX files because they have bits and
@@ -318,14 +318,14 @@ static void Dalvik_dalvik_system_DexFile_closeDexFile(const u4* args,
u4 hash = (u4) pDexOrJar;
dvmHashTableLock(gDvm.userDexFiles);
if (!dvmHashTableRemove(gDvm.userDexFiles, hash, pDexOrJar)) {
- LOGW("WARNING: could not remove '%s' from DEX hash table\n",
+ LOGW("WARNING: could not remove '%s' from DEX hash table",
pDexOrJar->fileName);
}
dvmHashTableUnlock(gDvm.userDexFiles);
- LOGV("+++ freeing DexFile '%s' resources\n", pDexOrJar->fileName);
+ LOGV("+++ freeing DexFile '%s' resources", pDexOrJar->fileName);
dvmFreeDexOrJar(pDexOrJar);
} else {
- LOGV("+++ NOT freeing DexFile '%s' resources\n", pDexOrJar->fileName);
+ LOGV("+++ NOT freeing DexFile '%s' resources", pDexOrJar->fileName);
}
RETURN_VOID();
@@ -359,7 +359,7 @@ static void Dalvik_dalvik_system_DexFile_defineClass(const u4* args,
name = dvmCreateCstrFromString(nameObj);
descriptor = dvmDotToDescriptor(name);
- LOGV("--- Explicit class load '%s' l=%p c=0x%08x\n",
+ LOGV("--- Explicit class load '%s' l=%p c=0x%08x",
descriptor, loader, cookie);
free(name);
@@ -428,7 +428,7 @@ static void Dalvik_dalvik_system_DexFile_getClassNameList(const u4* args,
dvmAllocArrayByClass(arrayClass, count, ALLOC_DEFAULT);
if (stringArray == NULL) {
/* probably OOM */
- LOGD("Failed allocating array of %d strings\n", count);
+ LOGD("Failed allocating array of %d strings", count);
assert(dvmCheckException(self));
RETURN_VOID();
}
@@ -486,7 +486,7 @@ static void Dalvik_dalvik_system_DexFile_isDexOptNeeded(const u4* args,
RETURN_VOID();
}
status = dvmDexCacheStatus(name);
- LOGV("dvmDexCacheStatus(%s) returned %d\n", name, status);
+ LOGV("dvmDexCacheStatus(%s) returned %d", name, status);
result = true;
switch (status) {
diff --git a/vm/native/dalvik_system_VMDebug.cpp b/vm/native/dalvik_system_VMDebug.cpp
index cfd8ebc42..a87dcba44 100644
--- a/vm/native/dalvik_system_VMDebug.cpp
+++ b/vm/native/dalvik_system_VMDebug.cpp
@@ -614,14 +614,14 @@ static void Dalvik_dalvik_system_VMDebug_cacheRegisterMap(const u4* args,
}
*methodDescr++ = '\0';
- //LOGD("GOT: %s %s %s\n", classAndMethodDesc, methodName, methodDescr);
+ //LOGD("GOT: %s %s %s", classAndMethodDesc, methodName, methodDescr);
/*
* Find the class, but only if it's already loaded.
*/
clazz = dvmLookupClass(classAndMethodDesc, NULL, false);
if (clazz == NULL) {
- LOGD("Class %s not found in bootstrap loader\n", classAndMethodDesc);
+ LOGD("Class %s not found in bootstrap loader", classAndMethodDesc);
goto bail;
}
@@ -657,15 +657,15 @@ static void Dalvik_dalvik_system_VMDebug_cacheRegisterMap(const u4* args,
const RegisterMap* pMap;
pMap = dvmGetExpandedRegisterMap(method);
if (pMap == NULL) {
- LOGV("No map for %s.%s %s\n",
+ LOGV("No map for %s.%s %s",
classAndMethodDesc, methodName, methodDescr);
} else {
- LOGV("Found map %s.%s %s\n",
+ LOGV("Found map %s.%s %s",
classAndMethodDesc, methodName, methodDescr);
result = true;
}
} else {
- LOGV("Unable to find %s.%s %s\n",
+ LOGV("Unable to find %s.%s %s",
classAndMethodDesc, methodName, methodDescr);
}
@@ -683,11 +683,11 @@ static void Dalvik_dalvik_system_VMDebug_dumpReferenceTables(const u4* args,
UNUSED_PARAMETER(args);
UNUSED_PARAMETER(pResult);
- LOGI("--- reference table dump ---\n");
+ LOGI("--- reference table dump ---");
dvmDumpJniReferenceTables();
// could dump thread's internalLocalRefTable, probably not useful
// ditto for thread's jniMonitorRefTable
- LOGI("---\n");
+ LOGI("---");
RETURN_VOID();
}
@@ -706,7 +706,7 @@ static void Dalvik_dalvik_system_VMDebug_crash(const u4* args,
UNUSED_PARAMETER(args);
UNUSED_PARAMETER(pResult);
- LOGW("Crashing VM on request\n");
+ LOGW("Crashing VM on request");
dvmDumpThread(dvmThreadSelf(), false);
dvmAbort();
}
diff --git a/vm/native/dalvik_system_VMStack.cpp b/vm/native/dalvik_system_VMStack.cpp
index e69fa93e3..65755a150 100644
--- a/vm/native/dalvik_system_VMStack.cpp
+++ b/vm/native/dalvik_system_VMStack.cpp
@@ -168,7 +168,7 @@ static int* getTraceBuf(Object* targetThreadObj, size_t* pStackDepth)
break;
}
if (thread == NULL) {
- LOGI("VMStack.getTraceBuf: threadObj %p not active\n",
+ LOGI("VMStack.getTraceBuf: threadObj %p not active",
targetThreadObj);
dvmUnlockThreadList();
return NULL;
diff --git a/vm/native/dalvik_system_Zygote.cpp b/vm/native/dalvik_system_Zygote.cpp
index fb3340571..f755884e9 100644
--- a/vm/native/dalvik_system_Zygote.cpp
+++ b/vm/native/dalvik_system_Zygote.cpp
@@ -60,7 +60,7 @@ static void sigchldHandler(int s)
become unsafe. */
if (WIFEXITED(status)) {
if (WEXITSTATUS(status)) {
- LOG(LOG_DEBUG, ZYGOTE_LOG_TAG, "Process %d exited cleanly (%d)\n",
+ LOG(LOG_DEBUG, ZYGOTE_LOG_TAG, "Process %d exited cleanly (%d)",
(int) pid, WEXITSTATUS(status));
} else {
IF_LOGV(/*should use ZYGOTE_LOG_TAG*/) {
@@ -83,7 +83,7 @@ static void sigchldHandler(int s)
}
#ifdef WCOREDUMP
if (WCOREDUMP(status)) {
- LOG(LOG_INFO, ZYGOTE_LOG_TAG, "Process %d dumped core\n",
+ LOG(LOG_INFO, ZYGOTE_LOG_TAG, "Process %d dumped core",
(int) pid);
}
#endif /* ifdef WCOREDUMP */
@@ -235,7 +235,7 @@ static void Dalvik_dalvik_system_Zygote_fork(const u4* args, JValue* pResult)
}
if (!dvmGcPreZygoteFork()) {
- LOGE("pre-fork heap failed\n");
+ LOGE("pre-fork heap failed");
dvmAbort();
}
@@ -276,7 +276,7 @@ static void Dalvik_dalvik_system_Zygote_fork(const u4* args, JValue* pResult)
*/
static void enableDebugFeatures(u4 debugFlags)
{
- LOGV("debugFlags is 0x%02x\n", debugFlags);
+ LOGV("debugFlags is 0x%02x", debugFlags);
gDvm.jdwpAllowed = ((debugFlags & DEBUG_ENABLE_DEBUGGER) != 0);
@@ -342,7 +342,7 @@ static int setCapabilities(int64_t permitted, int64_t effective)
capdata.effective = effective;
capdata.permitted = permitted;
- LOGV("CAPSET perm=%llx eff=%llx\n", permitted, effective);
+ LOGV("CAPSET perm=%llx eff=%llx", permitted, effective);
if (capset(&capheader, &capdata) != 0)
return errno;
#endif /*HAVE_ANDROID_OS*/
@@ -386,7 +386,7 @@ static pid_t forkAndSpecializeCommon(const u4* args, bool isSystemServer)
}
if (!dvmGcPreZygoteFork()) {
- LOGE("pre-fork heap failed\n");
+ LOGE("pre-fork heap failed");
dvmAbort();
}
@@ -443,7 +443,7 @@ static pid_t forkAndSpecializeCommon(const u4* args, bool isSystemServer)
err = setCapabilities(permittedCapabilities, effectiveCapabilities);
if (err != 0) {
- LOGE("cannot set capabilities (%llx,%llx): %s\n",
+ LOGE("cannot set capabilities (%llx,%llx): %s",
permittedCapabilities, effectiveCapabilities, strerror(err));
dvmAbort();
}
@@ -460,7 +460,7 @@ static pid_t forkAndSpecializeCommon(const u4* args, bool isSystemServer)
unsetSignalHandler();
gDvm.zygote = false;
if (!dvmInitAfterZygote()) {
- LOGE("error in post-zygote initialization\n");
+ LOGE("error in post-zygote initialization");
dvmAbort();
}
} else if (pid > 0) {
diff --git a/vm/native/java_lang_Class.cpp b/vm/native/java_lang_Class.cpp
index 790e7b79b..cc0bccb3c 100644
--- a/vm/native/java_lang_Class.cpp
+++ b/vm/native/java_lang_Class.cpp
@@ -69,10 +69,10 @@ static void Dalvik_java_lang_Class_desiredAssertionStatus(const u4* args,
if (pCtrl->pkgOrClassLen > pkgLen ||
memcmp(pCtrl->pkgOrClass, className, pCtrl->pkgOrClassLen) != 0)
{
- LOGV("ASRT: pkg no match: '%s'(%d) vs '%s'\n",
+ LOGV("ASRT: pkg no match: '%s'(%d) vs '%s'",
className, pkgLen, pCtrl->pkgOrClass);
} else {
- LOGV("ASRT: pkg match: '%s'(%d) vs '%s' --> %d\n",
+ LOGV("ASRT: pkg match: '%s'(%d) vs '%s' --> %d",
className, pkgLen, pCtrl->pkgOrClass, pCtrl->enable);
enable = pCtrl->enable;
}
@@ -84,22 +84,22 @@ static void Dalvik_java_lang_Class_desiredAssertionStatus(const u4* args,
if (pCtrl->pkgOrClass == NULL) {
/* -esa/-dsa; see if class is a "system" class */
if (strncmp(className, "java/", 5) != 0) {
- LOGV("ASRT: sys no match: '%s'\n", className);
+ LOGV("ASRT: sys no match: '%s'", className);
} else {
- LOGV("ASRT: sys match: '%s' --> %d\n",
+ LOGV("ASRT: sys match: '%s' --> %d",
className, pCtrl->enable);
enable = pCtrl->enable;
}
} else if (*pCtrl->pkgOrClass == '\0') {
- LOGV("ASRT: class all: '%s' --> %d\n",
+ LOGV("ASRT: class all: '%s' --> %d",
className, pCtrl->enable);
enable = pCtrl->enable;
} else {
if (strcmp(pCtrl->pkgOrClass, className) != 0) {
- LOGV("ASRT: cls no match: '%s' vs '%s'\n",
+ LOGV("ASRT: cls no match: '%s' vs '%s'",
className, pCtrl->pkgOrClass);
} else {
- LOGV("ASRT: cls match: '%s' vs '%s' --> %d\n",
+ LOGV("ASRT: cls match: '%s' vs '%s' --> %d",
className, pCtrl->pkgOrClass, pCtrl->enable);
enable = pCtrl->enable;
}
@@ -382,7 +382,7 @@ static void Dalvik_java_lang_Class_getNameNative(const u4* args, JValue* pResult
case 'D': name = "double"; break;
case 'V': name = "void"; break;
default: {
- LOGE("Unknown primitive type '%c'\n", descriptor[0]);
+ LOGE("Unknown primitive type '%c'", descriptor[0]);
assert(false);
RETURN_PTR(NULL);
}
@@ -500,7 +500,7 @@ static void Dalvik_java_lang_Class_newInstance(const u4* args, JValue* pResult)
if (dvmIsPrimitiveClass(clazz) || dvmIsInterfaceClass(clazz)
|| dvmIsArrayClass(clazz) || dvmIsAbstractClass(clazz))
{
- LOGD("newInstance failed: p%d i%d [%d a%d\n",
+ LOGD("newInstance failed: p%d i%d [%d a%d",
dvmIsPrimitiveClass(clazz), dvmIsInterfaceClass(clazz),
dvmIsArrayClass(clazz), dvmIsAbstractClass(clazz));
dvmThrowInstantiationException(clazz, NULL);
@@ -510,7 +510,7 @@ static void Dalvik_java_lang_Class_newInstance(const u4* args, JValue* pResult)
/* initialize the class if it hasn't been already */
if (!dvmIsClassInitialized(clazz)) {
if (!dvmInitClass(clazz)) {
- LOGW("Class init failed in newInstance call (%s)\n",
+ LOGW("Class init failed in newInstance call (%s)",
clazz->descriptor);
assert(dvmCheckException(self));
RETURN_VOID();
@@ -521,7 +521,7 @@ static void Dalvik_java_lang_Class_newInstance(const u4* args, JValue* pResult)
init = dvmFindDirectMethodByDescriptor(clazz, "<init>", "()V");
if (init == NULL) {
/* common cause: secret "this" arg on non-static inner class ctor */
- LOGD("newInstance failed: no <init>()\n");
+ LOGD("newInstance failed: no <init>()");
dvmThrowInstantiationException(clazz, "no empty constructor");
RETURN_VOID();
}
@@ -539,13 +539,13 @@ static void Dalvik_java_lang_Class_newInstance(const u4* args, JValue* pResult)
ClassObject* callerClass = dvmGetCaller2Class(self->interpSave.curFrame);
if (!dvmCheckClassAccess(callerClass, clazz)) {
- LOGD("newInstance failed: %s not accessible to %s\n",
+ LOGD("newInstance failed: %s not accessible to %s",
clazz->descriptor, callerClass->descriptor);
dvmThrowIllegalAccessException("access to class not allowed");
RETURN_VOID();
}
if (!dvmCheckMethodAccess(callerClass, init)) {
- LOGD("newInstance failed: %s.<init>() not accessible to %s\n",
+ LOGD("newInstance failed: %s.<init>() not accessible to %s",
clazz->descriptor, callerClass->descriptor);
dvmThrowIllegalAccessException("access to constructor not allowed");
RETURN_VOID();
diff --git a/vm/native/java_lang_Runtime.cpp b/vm/native/java_lang_Runtime.cpp
index 112448c78..c09b8405b 100644
--- a/vm/native/java_lang_Runtime.cpp
+++ b/vm/native/java_lang_Runtime.cpp
@@ -51,9 +51,9 @@ static void Dalvik_java_lang_Runtime_nativeExit(const u4* args,
dvmChangeStatus(NULL, THREAD_NATIVE);
(*gDvm.exitHook)(status); // not expected to return
dvmChangeStatus(NULL, THREAD_RUNNING);
- LOGW("JNI exit hook returned\n");
+ LOGW("JNI exit hook returned");
}
- LOGD("Calling exit(%d)\n", status);
+ LOGD("Calling exit(%d)", status);
#if defined(WITH_JIT) && defined(WITH_JIT_TUNING)
dvmCompilerDumpStats();
#endif
diff --git a/vm/native/java_lang_System.cpp b/vm/native/java_lang_System.cpp
index 06ab5f81c..8223afd3b 100644
--- a/vm/native/java_lang_System.cpp
+++ b/vm/native/java_lang_System.cpp
@@ -172,7 +172,7 @@ static void Dalvik_java_lang_System_arraycopy(const u4* args, JValue* pResult)
RETURN_VOID();
}
- if (false) LOGD("arraycopy prim[%c] dst=%p %d src=%p %d len=%d\n",
+ if (false) LOGD("arraycopy prim[%c] dst=%p %d src=%p %d len=%d",
srcType, dstArray->contents, dstPos,
srcArray->contents, srcPos, length);
@@ -209,7 +209,7 @@ static void Dalvik_java_lang_System_arraycopy(const u4* args, JValue* pResult)
length * 8);
break;
default: /* illegal array type */
- LOGE("Weird array type '%s'\n", srcClass->descriptor);
+ LOGE("Weird array type '%s'", srcClass->descriptor);
dvmAbort();
}
} else {
@@ -226,7 +226,7 @@ static void Dalvik_java_lang_System_arraycopy(const u4* args, JValue* pResult)
/*
* "dst" can hold "src"; copy the whole thing.
*/
- if (false) LOGD("arraycopy ref dst=%p %d src=%p %d len=%d\n",
+ if (false) LOGD("arraycopy ref dst=%p %d src=%p %d len=%d",
dstArray->contents, dstPos * width,
srcArray->contents, srcPos * width,
length * width);
@@ -273,7 +273,7 @@ static void Dalvik_java_lang_System_arraycopy(const u4* args, JValue* pResult)
}
}
- if (false) LOGD("arraycopy iref dst=%p %d src=%p %d count=%d of %d\n",
+ if (false) LOGD("arraycopy iref dst=%p %d src=%p %d count=%d of %d",
dstArray->contents, dstPos * width,
srcArray->contents, srcPos * width,
copyCount, length);
diff --git a/vm/native/java_lang_Throwable.cpp b/vm/native/java_lang_Throwable.cpp
index f96ee6dac..1324e5ad2 100644
--- a/vm/native/java_lang_Throwable.cpp
+++ b/vm/native/java_lang_Throwable.cpp
@@ -48,7 +48,7 @@ static void Dalvik_java_lang_Throwable_nativeGetStackTrace(const u4* args,
ArrayObject* elements = NULL;
if (stackState == NULL) {
- LOGW("getStackTrace() called but no trace available\n");
+ LOGW("getStackTrace() called but no trace available");
RETURN_PTR(NULL); /* could throw NPE; currently caller will do so */
}
diff --git a/vm/native/java_lang_VMClassLoader.cpp b/vm/native/java_lang_VMClassLoader.cpp
index 770ce5e6c..c80713cc4 100644
--- a/vm/native/java_lang_VMClassLoader.cpp
+++ b/vm/native/java_lang_VMClassLoader.cpp
@@ -39,7 +39,7 @@ static void Dalvik_java_lang_VMClassLoader_defineClass(const u4* args,
char* name = NULL;
name = dvmCreateCstrFromString(nameObj);
- LOGE("ERROR: defineClass(%p, %s, %p, %d, %d)\n",
+ LOGE("ERROR: defineClass(%p, %s, %p, %d, %d)",
loader, name, data, offset, len);
dvmThrowUnsupportedOperationException(
"can't load this type of class file");
@@ -64,7 +64,7 @@ static void Dalvik_java_lang_VMClassLoader_defineClass2(const u4* args,
int offset = args[2];
int len = args[3];
- LOGE("ERROR: defineClass(%p, %p, %d, %d)\n",
+ LOGE("ERROR: defineClass(%p, %p, %d, %d)",
loader, data, offset, len);
dvmThrowUnsupportedOperationException(
"can't load this type of class file");
@@ -101,7 +101,7 @@ static void Dalvik_java_lang_VMClassLoader_findLoadedClass(const u4* args,
goto bail;
clazz = dvmLookupClass(descriptor, loader, false);
- LOGVV("look: %s ldr=%p --> %p\n", descriptor, loader, clazz);
+ LOGVV("look: %s ldr=%p --> %p", descriptor, loader, clazz);
bail:
free(name);
diff --git a/vm/native/java_lang_VMThread.cpp b/vm/native/java_lang_VMThread.cpp
index 0a0202051..57ce006f6 100644
--- a/vm/native/java_lang_VMThread.cpp
+++ b/vm/native/java_lang_VMThread.cpp
@@ -179,7 +179,7 @@ static void Dalvik_java_lang_VMThread_nameChanged(const u4* args,
dvmDdmSendThreadNameChange(threadId, nameStr);
//char* str = dvmCreateCstrFromString(nameStr);
- //LOGI("UPDATE: threadid=%d now '%s'\n", threadId, str);
+ //LOGI("UPDATE: threadid=%d now '%s'", threadId, str);
//free(str);
RETURN_VOID();
diff --git a/vm/native/java_lang_reflect_Array.cpp b/vm/native/java_lang_reflect_Array.cpp
index 007d738af..c2fbb3d5b 100644
--- a/vm/native/java_lang_reflect_Array.cpp
+++ b/vm/native/java_lang_reflect_Array.cpp
@@ -74,7 +74,7 @@ static void Dalvik_java_lang_reflect_Array_createMultiArray(const u4* args,
int numDim, i;
int* dimensions;
- LOGV("createMultiArray: '%s' [%d]\n",
+ LOGV("createMultiArray: '%s' [%d]",
elementClass->descriptor, dimArray->length);
assert(elementClass != NULL); // verified by caller
@@ -95,7 +95,7 @@ static void Dalvik_java_lang_reflect_Array_createMultiArray(const u4* args,
dvmThrowNegativeArraySizeException(dimensions[i]);
RETURN_VOID();
}
- LOGVV("DIM %d: %d\n", i, dimensions[i]);
+ LOGVV("DIM %d: %d", i, dimensions[i]);
}
/*
@@ -105,7 +105,7 @@ static void Dalvik_java_lang_reflect_Array_createMultiArray(const u4* args,
(char*) malloc(strlen(elementClass->descriptor) + numDim + 1);
memset(acDescriptor, '[', numDim);
- LOGVV("#### element name = '%s'\n", elementClass->descriptor);
+ LOGVV("#### element name = '%s'", elementClass->descriptor);
if (dvmIsPrimitiveClass(elementClass)) {
assert(elementClass->primitiveType != PRIM_NOT);
acDescriptor[numDim] = dexGetPrimitiveTypeDescriptorChar(elementClass->primitiveType);
@@ -113,14 +113,14 @@ static void Dalvik_java_lang_reflect_Array_createMultiArray(const u4* args,
} else {
strcpy(acDescriptor+numDim, elementClass->descriptor);
}
- LOGVV("#### array name = '%s'\n", acDescriptor);
+ LOGVV("#### array name = '%s'", acDescriptor);
/*
* Find/generate the array class.
*/
arrayClass = dvmFindArrayClass(acDescriptor, elementClass->classLoader);
if (arrayClass == NULL) {
- LOGW("Unable to find or generate array class '%s'\n", acDescriptor);
+ LOGW("Unable to find or generate array class '%s'", acDescriptor);
assert(dvmCheckException(dvmThreadSelf()));
free(acDescriptor);
RETURN_VOID();
diff --git a/vm/native/java_lang_reflect_Constructor.cpp b/vm/native/java_lang_reflect_Constructor.cpp
index 84fd20715..e776bf1ee 100644
--- a/vm/native/java_lang_reflect_Constructor.cpp
+++ b/vm/native/java_lang_reflect_Constructor.cpp
@@ -51,7 +51,7 @@ static void Dalvik_java_lang_reflect_Constructor_constructNative(
/* initialize the class if it hasn't been already */
if (!dvmIsClassInitialized(declaringClass)) {
if (!dvmInitClass(declaringClass)) {
- LOGW("Class init failed in Constructor.constructNative (%s)\n",
+ LOGW("Class init failed in Constructor.constructNative (%s)",
declaringClass->descriptor);
assert(dvmCheckException(dvmThreadSelf()));
RETURN_VOID();
diff --git a/vm/native/java_lang_reflect_Field.cpp b/vm/native/java_lang_reflect_Field.cpp
index dc1b30fb9..d1918bc5e 100644
--- a/vm/native/java_lang_reflect_Field.cpp
+++ b/vm/native/java_lang_reflect_Field.cpp
@@ -172,7 +172,7 @@ static void getStaticFieldValue(const StaticField* sfield, JValue* value)
value->l = dvmGetStaticFieldObjectVolatile(sfield);
break;
default:
- LOGE("Unhandled field signature '%s'\n", sfield->signature);
+ LOGE("Unhandled field signature '%s'", sfield->signature);
dvmAbort();
}
}
@@ -219,7 +219,7 @@ static void getInstFieldValue(const InstField* ifield, Object* obj,
value->l = dvmGetFieldObject(obj, ifield->byteOffset);
break;
default:
- LOGE("Unhandled field signature '%s'\n", ifield->signature);
+ LOGE("Unhandled field signature '%s'", ifield->signature);
dvmAbort();
}
} else {
@@ -254,7 +254,7 @@ static void getInstFieldValue(const InstField* ifield, Object* obj,
value->l = dvmGetFieldObjectVolatile(obj, ifield->byteOffset);
break;
default:
- LOGE("Unhandled field signature '%s'\n", ifield->signature);
+ LOGE("Unhandled field signature '%s'", ifield->signature);
dvmAbort();
}
}
@@ -321,7 +321,7 @@ static void setStaticFieldValue(StaticField* sfield, const JValue* value)
dvmSetStaticFieldObjectVolatile(sfield, (Object*)value->l);
break;
default:
- LOGE("Unhandled field signature '%s'\n", sfield->signature);
+ LOGE("Unhandled field signature '%s'", sfield->signature);
dvmAbort();
}
}
@@ -366,7 +366,7 @@ static void setInstFieldValue(InstField* ifield, Object* obj,
dvmSetFieldObject(obj, ifield->byteOffset, (Object *)value->l);
break;
default:
- LOGE("Unhandled field signature '%s'\n", ifield->signature);
+ LOGE("Unhandled field signature '%s'", ifield->signature);
dvmAbort();
}
#if ANDROID_SMP != 0
@@ -410,7 +410,7 @@ static void setInstFieldValue(InstField* ifield, Object* obj,
dvmSetFieldObjectVolatile(obj, ifield->byteOffset, (Object*)value->l);
break;
default:
- LOGE("Unhandled field signature '%s'\n", ifield->signature);
+ LOGE("Unhandled field signature '%s'", ifield->signature);
dvmAbort();
}
}
diff --git a/vm/native/java_lang_reflect_Method.cpp b/vm/native/java_lang_reflect_Method.cpp
index d38a62b41..164e435ae 100644
--- a/vm/native/java_lang_reflect_Method.cpp
+++ b/vm/native/java_lang_reflect_Method.cpp
@@ -106,7 +106,7 @@ init_failed:
/*
* If initialization failed, an exception will be raised.
*/
- LOGD("Method.invoke() on bad class %s failed\n",
+ LOGD("Method.invoke() on bad class %s failed",
declaringClass->descriptor);
assert(dvmCheckException(dvmThreadSelf()));
RETURN_VOID();
diff --git a/vm/native/org_apache_harmony_dalvik_ddmc_DdmVmInternal.cpp b/vm/native/org_apache_harmony_dalvik_ddmc_DdmVmInternal.cpp
index caa280b45..eed8ce14a 100644
--- a/vm/native/org_apache_harmony_dalvik_ddmc_DdmVmInternal.cpp
+++ b/vm/native/org_apache_harmony_dalvik_ddmc_DdmVmInternal.cpp
@@ -31,7 +31,7 @@ static void Dalvik_org_apache_harmony_dalvik_ddmc_DdmVmInternal_threadNotify(
{
bool enable = (args[0] != 0);
- //LOGI("ddmThreadNotification: %d\n", enable);
+ //LOGI("ddmThreadNotification: %d", enable);
dvmDdmSetThreadNotification(enable);
RETURN_VOID();
}
diff --git a/vm/oo/AccessCheck.cpp b/vm/oo/AccessCheck.cpp
index 95b7f3e3b..cac56c40e 100644
--- a/vm/oo/AccessCheck.cpp
+++ b/vm/oo/AccessCheck.cpp
@@ -143,7 +143,7 @@ bool dvmCheckMethodAccess(const ClassObject* accessFrom, const Method* method)
*/
bool dvmCheckFieldAccess(const ClassObject* accessFrom, const Field* field)
{
- //LOGI("CHECK ACCESS from '%s' to field '%s' (in %s) flags=0x%x\n",
+ //LOGI("CHECK ACCESS from '%s' to field '%s' (in %s) flags=0x%x",
// accessFrom->descriptor, field->name,
// field->clazz->descriptor, field->accessFlags);
return checkAccess(accessFrom, field->clazz, field->accessFlags);
diff --git a/vm/oo/Array.cpp b/vm/oo/Array.cpp
index 2193ec191..7d898eb6f 100644
--- a/vm/oo/Array.cpp
+++ b/vm/oo/Array.cpp
@@ -151,7 +151,7 @@ ArrayObject* dvmAllocPrimitiveArray(char type, size_t length, int allocFlags)
width = 8;
break;
default:
- LOGE("Unknown primitive type '%c'\n", type);
+ LOGE("Unknown primitive type '%c'", type);
dvmAbort();
return NULL; // Keeps the compiler happy.
}
@@ -175,17 +175,17 @@ ArrayObject* dvmAllocMultiArray(ClassObject* arrayClass, int curDim,
ArrayObject* newArray;
const char* elemName = arrayClass->descriptor + 1; // Advance past one '['.
- LOGVV("dvmAllocMultiArray: class='%s' curDim=%d *dimensions=%d\n",
+ LOGVV("dvmAllocMultiArray: class='%s' curDim=%d *dimensions=%d",
arrayClass->descriptor, curDim, *dimensions);
if (curDim == 0) {
if (*elemName == 'L' || *elemName == '[') {
- LOGVV(" end: array class (obj) is '%s'\n",
+ LOGVV(" end: array class (obj) is '%s'",
arrayClass->descriptor);
newArray = allocArray(arrayClass, *dimensions,
kObjectArrayRefWidth, ALLOC_DEFAULT);
} else {
- LOGVV(" end: array class (prim) is '%s'\n",
+ LOGVV(" end: array class (prim) is '%s'",
arrayClass->descriptor);
newArray = dvmAllocPrimitiveArray(
dexGetPrimitiveTypeDescriptorChar(arrayClass->elementClass->primitiveType),
@@ -246,11 +246,11 @@ ClassObject* dvmFindArrayClass(const char* descriptor, Object* loader)
ClassObject* clazz;
assert(descriptor[0] == '[');
- //LOGV("dvmFindArrayClass: '%s' %p\n", descriptor, loader);
+ //LOGV("dvmFindArrayClass: '%s' %p", descriptor, loader);
clazz = dvmLookupClass(descriptor, loader, false);
if (clazz == NULL) {
- LOGV("Array class '%s' %p not found; creating\n", descriptor, loader);
+ LOGV("Array class '%s' %p not found; creating", descriptor, loader);
clazz = createArrayClass(descriptor, loader);
if (clazz != NULL)
dvmAddInitiatingLoader(clazz, loader);
@@ -306,7 +306,7 @@ static ClassObject* createArrayClass(const char* descriptor, Object* loader)
if (descriptor[1] == 'L') {
/* array of objects; strip off "[" and look up descriptor. */
const char* subDescriptor = &descriptor[1];
- LOGVV("searching for element class '%s'\n", subDescriptor);
+ LOGVV("searching for element class '%s'", subDescriptor);
elementClass = dvmFindClassNoInit(subDescriptor, loader);
extraFlags |= CLASS_ISOBJECTARRAY;
} else {
@@ -342,11 +342,11 @@ static ClassObject* createArrayClass(const char* descriptor, Object* loader)
* other threads.)
*/
if (loader != elementClass->classLoader) {
- LOGVV("--- checking for '%s' in %p vs. elem %p\n",
+ LOGVV("--- checking for '%s' in %p vs. elem %p",
descriptor, loader, elementClass->classLoader);
newClass = dvmLookupClass(descriptor, elementClass->classLoader, false);
if (newClass != NULL) {
- LOGV("--- we already have %s in %p, don't need in %p\n",
+ LOGV("--- we already have %s in %p, don't need in %p",
descriptor, elementClass->classLoader, loader);
return newClass;
}
@@ -414,7 +414,7 @@ static ClassObject* createArrayClass(const char* descriptor, Object* loader)
dvmFindSystemClassNoInit("Ljava/io/Serializable;");
dvmLinearReadOnly(newClass->classLoader, newClass->interfaces);
if (newClass->interfaces[0] == NULL || newClass->interfaces[1] == NULL) {
- LOGE("Unable to create array class '%s': missing interfaces\n",
+ LOGE("Unable to create array class '%s': missing interfaces",
descriptor);
dvmFreeClassInnards(newClass);
dvmThrowInternalError("missing array ifaces");
@@ -478,7 +478,7 @@ static ClassObject* createArrayClass(const char* descriptor, Object* loader)
}
dvmReleaseTrackedAlloc((Object*) newClass, NULL);
- LOGV("Created array class '%s' %p (access=0x%04x.%04x)\n",
+ LOGV("Created array class '%s' %p (access=0x%04x.%04x)",
descriptor, newClass->classLoader,
newClass->accessFlags >> 16,
newClass->accessFlags & JAVA_FLAGS_MASK);
@@ -504,7 +504,7 @@ bool dvmCopyObjectArray(ArrayObject* dstArray, const ArrayObject* srcArray,
length = dstArray->length;
for (count = 0; count < length; count++) {
if (!dvmInstanceof(src[count]->clazz, dstElemClass)) {
- LOGW("dvmCopyObjectArray: can't store %s in %s\n",
+ LOGW("dvmCopyObjectArray: can't store %s in %s",
src[count]->clazz->descriptor, dstElemClass->descriptor);
return false;
}
@@ -540,7 +540,7 @@ bool dvmUnboxObjectArray(ArrayObject* dstArray, const ArrayObject* srcArray,
* necessary for correctness.
*/
if (!dvmUnboxPrimitive(*src, dstElemClass, &result)) {
- LOGW("dvmCopyObjectArray: can't store %s in %s\n",
+ LOGW("dvmCopyObjectArray: can't store %s in %s",
(*src)->clazz->descriptor, dstElemClass->descriptor);
return false;
}
diff --git a/vm/oo/Class.cpp b/vm/oo/Class.cpp
index d4c98b55a..191c847f5 100644
--- a/vm/oo/Class.cpp
+++ b/vm/oo/Class.cpp
@@ -205,7 +205,7 @@ static void logClassLoadWithTime(char type, ClassObject* clazz, u8 time) {
pid_t pid = getpid();
unsigned int tid = (unsigned int) pthread_self();
- LOG(LOG_INFO, "PRELOAD", "%c%d:%d:%d:%s:%d:%s:%lld\n", type, ppid, pid, tid,
+ LOG(LOG_INFO, "PRELOAD", "%c%d:%d:%d:%s:%d:%s:%lld", type, ppid, pid, tid,
get_process_name(), (int) clazz->classLoader, clazz->descriptor,
time);
}
@@ -274,13 +274,13 @@ static void linearAllocTests()
dvmLinearReadOnly(NULL, (char*)fiddle);
char* str = (char*)dvmLinearStrdup(NULL, "This is a test!");
- LOGI("GOT: '%s'\n", str);
+ LOGI("GOT: '%s'", str);
/* try to check the bounds; allocator may round allocation size up */
fiddle = (char*)dvmLinearAlloc(NULL, 12);
- LOGI("Should be 1: %d\n", dvmLinearAllocContains(fiddle, 12));
- LOGI("Should be 0: %d\n", dvmLinearAllocContains(fiddle, 13));
- LOGI("Should be 0: %d\n", dvmLinearAllocContains(fiddle - 128*1024, 1));
+ LOGI("Should be 1: %d", dvmLinearAllocContains(fiddle, 12));
+ LOGI("Should be 0: %d", dvmLinearAllocContains(fiddle, 13));
+ LOGI("Should be 0: %d", dvmLinearAllocContains(fiddle - 128*1024, 1));
dvmLinearAllocDump(NULL);
dvmLinearFree(NULL, (char*)str);
@@ -314,7 +314,7 @@ ClassObject* dvmFindPrimitiveClass(char type)
case PRIM_FLOAT: return gDvm.typeFloat;
case PRIM_DOUBLE: return gDvm.typeDouble;
default: {
- LOGW("Unknown primitive type '%c'\n", type);
+ LOGW("Unknown primitive type '%c'", type);
return NULL;
}
}
@@ -354,7 +354,7 @@ static bool createPrimitiveType(PrimitiveType primitiveType, ClassObject** pClas
/* don't need to set newClass->objectSize */
- LOGVV("Constructed class for primitive type '%s'\n", newClass->descriptor);
+ LOGVV("Constructed class for primitive type '%s'", newClass->descriptor);
*pClass = newClass;
dvmReleaseTrackedAlloc((Object*) newClass, NULL);
@@ -380,7 +380,7 @@ static bool createInitialClasses() {
SET_CLASS_FLAG(clazz, ACC_PUBLIC | ACC_FINAL | CLASS_ISCLASS);
clazz->descriptor = "Ljava/lang/Class;";
gDvm.classJavaLangClass = clazz;
- LOGVV("Constructed the class Class.\n");
+ LOGVV("Constructed the class Class.");
/*
* Initialize the classes representing primitive types. These are
@@ -410,7 +410,7 @@ bool dvmClassStartup()
{
/* make this a requirement -- don't currently support dirs in path */
if (strcmp(gDvm.bootClassPathStr, ".") == 0) {
- LOGE("ERROR: must specify non-'.' bootclasspath\n");
+ LOGE("ERROR: must specify non-'.' bootclasspath");
return false;
}
@@ -515,7 +515,7 @@ static void dumpClassPath(const ClassPathEntry* cpe)
default: kindStr = "???"; break;
}
- LOGI(" %2d: type=%s %s %p\n", idx, kindStr, cpe->fileName, cpe->ptr);
+ LOGI(" %2d: type=%s %s %p", idx, kindStr, cpe->fileName, cpe->ptr);
if (CALC_CACHE_STATS && cpe->kind == kCpeJar) {
JarFile* pJarFile = (JarFile*) cpe->ptr;
DvmDex* pDvmDex = dvmGetJarFileDex(pJarFile);
@@ -599,7 +599,7 @@ static bool prepareCpe(ClassPathEntry* cpe, bool isBootstrap)
cc = stat(cpe->fileName, &sb);
if (cc < 0) {
- LOGD("Unable to stat classpath element '%s'\n", cpe->fileName);
+ LOGD("Unable to stat classpath element '%s'", cpe->fileName);
return false;
}
if (S_ISDIR(sb.st_mode)) {
@@ -631,7 +631,7 @@ static bool prepareCpe(ClassPathEntry* cpe, bool isBootstrap)
return true;
}
- LOGD("Unable to process classpath element '%s'\n", cpe->fileName);
+ LOGD("Unable to process classpath element '%s'", cpe->fileName);
return false;
}
@@ -696,7 +696,7 @@ static ClassPathEntry* processClassPath(const char* pathStr, bool isBootstrap)
} else {
if (isBootstrap &&
dvmPathToAbsolutePortion(cp) == NULL) {
- LOGE("Non-absolute bootclasspath entry '%s'\n", cp);
+ LOGE("Non-absolute bootclasspath entry '%s'", cp);
free(cpe);
cpe = NULL;
goto bail;
@@ -729,13 +729,13 @@ static ClassPathEntry* processClassPath(const char* pathStr, bool isBootstrap)
}
assert(idx <= count);
if (idx == 0 && !gDvm.optimizing) {
- LOGE("No valid entries found in bootclasspath '%s'\n", pathStr);
+ LOGE("No valid entries found in bootclasspath '%s'", pathStr);
free(cpe);
cpe = NULL;
goto bail;
}
- LOGVV(" (filled %d of %d slots)\n", idx, count);
+ LOGVV(" (filled %d of %d slots)", idx, count);
/* put end marker in over-alloc slot */
cpe[idx].kind = kCpeLastEntry;
@@ -764,15 +764,15 @@ static DvmDex* searchBootPathForClass(const char* descriptor,
const DexClassDef* pFoundDef = NULL;
DvmDex* pFoundFile = NULL;
- LOGVV("+++ class '%s' not yet loaded, scanning bootclasspath...\n",
+ LOGVV("+++ class '%s' not yet loaded, scanning bootclasspath...",
descriptor);
while (cpe->kind != kCpeLastEntry) {
- //LOGV("+++ checking '%s' (%d)\n", cpe->fileName, cpe->kind);
+ //LOGV("+++ checking '%s' (%d)", cpe->fileName, cpe->kind);
switch (cpe->kind) {
case kCpeDir:
- LOGW("Directory entries ('%s') not supported in bootclasspath\n",
+ LOGW("Directory entries ('%s') not supported in bootclasspath",
cpe->fileName);
break;
case kCpeJar:
@@ -808,7 +808,7 @@ static DvmDex* searchBootPathForClass(const char* descriptor,
}
break;
default:
- LOGE("Unknown kind %d\n", cpe->kind);
+ LOGE("Unknown kind %d", cpe->kind);
assert(false);
break;
}
@@ -884,7 +884,7 @@ StringObject* dvmGetBootPathResource(const char* name, int idx)
const ClassPathEntry* cpe = gDvm.bootClassPath;
StringObject* urlObj = NULL;
- LOGV("+++ searching for resource '%s' in %d(%s)\n",
+ LOGV("+++ searching for resource '%s' in %d(%s)",
name, idx, cpe[idx].fileName);
/* we could use direct array index, but I don't entirely trust "idx" */
@@ -912,14 +912,14 @@ StringObject* dvmGetBootPathResource(const char* name, int idx)
}
break;
case kCpeDex:
- LOGV("No resources in DEX files\n");
+ LOGV("No resources in DEX files");
goto bail;
default:
assert(false);
goto bail;
}
- LOGV("+++ using URL='%s'\n", urlBuf);
+ LOGV("+++ using URL='%s'", urlBuf);
urlObj = dvmCreateStringFromCstr(urlBuf);
bail:
@@ -983,7 +983,7 @@ bool dvmLoaderInInitiatingList(const ClassObject* clazz, const Object* loader)
int i;
for (i = loaderList->initiatingLoaderCount-1; i >= 0; --i) {
if (loaderList->initiatingLoaders[i] == loader) {
- //LOGI("+++ found initiating match %p in %s\n",
+ //LOGI("+++ found initiating match %p in %s",
// loader, clazz->descriptor);
return true;
}
@@ -1006,7 +1006,7 @@ void dvmAddInitiatingLoader(ClassObject* clazz, Object* loader)
if (loader != clazz->classLoader) {
assert(loader != NULL);
- LOGVV("Adding %p to '%s' init list\n", loader, clazz->descriptor);
+ LOGVV("Adding %p to '%s' init list", loader, clazz->descriptor);
dvmHashTableLock(gDvm.loadedClasses);
/*
@@ -1015,7 +1015,7 @@ void dvmAddInitiatingLoader(ClassObject* clazz, Object* loader)
* checking before every add, so we may not want to do this.
*/
//if (dvmLoaderInInitiatingList(clazz, loader)) {
- // LOGW("WOW: simultaneous add of initiating class loader\n");
+ // LOGW("WOW: simultaneous add of initiating class loader");
// goto bail_unlock;
//}
@@ -1041,7 +1041,7 @@ void dvmAddInitiatingLoader(ClassObject* clazz, Object* loader)
}
loaderList->initiatingLoaders = newList;
- //LOGI("Expanded init list to %d (%s)\n",
+ //LOGI("Expanded init list to %d (%s)",
// loaderList->initiatingLoaderCount+kInitLoaderInc,
// clazz->descriptor);
}
@@ -1078,7 +1078,7 @@ static int hashcmpClassByCrit(const void* vclazz, const void* vcrit)
(pCrit->loader != NULL &&
dvmLoaderInInitiatingList(clazz, pCrit->loader)) ));
//if (match)
- // LOGI("+++ %s %p matches existing %s %p\n",
+ // LOGI("+++ %s %p matches existing %s %p",
// pCrit->descriptor, pCrit->loader,
// clazz->descriptor, clazz->classLoader);
return !match;
@@ -1131,7 +1131,7 @@ ClassObject* dvmLookupClass(const char* descriptor, Object* loader,
crit.loader = loader;
hash = dvmComputeUtf8Hash(descriptor);
- LOGVV("threadid=%d: dvmLookupClass searching for '%s' %p\n",
+ LOGVV("threadid=%d: dvmLookupClass searching for '%s' %p",
dvmThreadSelf()->threadId, descriptor, loader);
dvmHashTableLock(gDvm.loadedClasses);
@@ -1148,7 +1148,7 @@ ClassObject* dvmLookupClass(const char* descriptor, Object* loader,
* the wait-for-class code centralized.
*/
if (found && !unprepOkay && !dvmIsClassLinked((ClassObject*)found)) {
- LOGV("Ignoring not-yet-ready %s, using slow path\n",
+ LOGV("Ignoring not-yet-ready %s, using slow path",
((ClassObject*)found)->descriptor);
found = NULL;
}
@@ -1180,7 +1180,7 @@ bool dvmAddClassToHash(ClassObject* clazz)
hashcmpClassByClass, true);
dvmHashTableUnlock(gDvm.loadedClasses);
- LOGV("+++ dvmAddClassToHash '%s' %p (isnew=%d) --> %p\n",
+ LOGV("+++ dvmAddClassToHash '%s' %p (isnew=%d) --> %p",
clazz->descriptor, clazz->classLoader,
(found == (void*) clazz), clazz);
@@ -1216,13 +1216,13 @@ void dvmCheckClassTablePerf()
*/
static void removeClassFromHash(ClassObject* clazz)
{
- LOGV("+++ removeClassFromHash '%s'\n", clazz->descriptor);
+ LOGV("+++ removeClassFromHash '%s'", clazz->descriptor);
u4 hash = dvmComputeUtf8Hash(clazz->descriptor);
dvmHashTableLock(gDvm.loadedClasses);
if (!dvmHashTableRemove(gDvm.loadedClasses, hash, clazz))
- LOGW("Hash table remove failed on class '%s'\n", clazz->descriptor);
+ LOGW("Hash table remove failed on class '%s'", clazz->descriptor);
dvmHashTableUnlock(gDvm.loadedClasses);
}
@@ -1290,7 +1290,7 @@ ClassObject* dvmFindClassNoInit(const char* descriptor,
assert(descriptor != NULL);
//assert(loader != NULL);
- LOGVV("FindClassNoInit '%s' %p\n", descriptor, loader);
+ LOGVV("FindClassNoInit '%s' %p", descriptor, loader);
if (*descriptor == '[') {
/*
@@ -1318,7 +1318,7 @@ ClassObject* dvmFindClassNoInit(const char* descriptor,
static ClassObject* findClassFromLoaderNoInit(const char* descriptor,
Object* loader)
{
- //LOGI("##### findClassFromLoaderNoInit (%s,%p)\n",
+ //LOGI("##### findClassFromLoaderNoInit (%s,%p)",
// descriptor, loader);
Thread* self = dvmThreadSelf();
@@ -1337,10 +1337,10 @@ static ClassObject* findClassFromLoaderNoInit(const char* descriptor,
*/
ClassObject* clazz = dvmLookupClass(descriptor, loader, false);
if (clazz != NULL) {
- LOGVV("Already loaded: %s %p\n", descriptor, loader);
+ LOGVV("Already loaded: %s %p", descriptor, loader);
return clazz;
} else {
- LOGVV("Not already loaded: %s %p\n", descriptor, loader);
+ LOGVV("Not already loaded: %s %p", descriptor, loader);
}
char* dotName = NULL;
@@ -1366,7 +1366,7 @@ static ClassObject* findClassFromLoaderNoInit(const char* descriptor,
* implementation eventually calls VMClassLoader.loadClass to see if
* the bootstrap class loader can find it before doing its own load.
*/
- LOGVV("--- Invoking loadClass(%s, %p)\n", dotName, loader);
+ LOGVV("--- Invoking loadClass(%s, %p)", dotName, loader);
{
const Method* loadClass =
loader->clazz->vtable[gDvm.voffJavaLangClassLoader_loadClass];
@@ -1378,7 +1378,7 @@ static ClassObject* findClassFromLoaderNoInit(const char* descriptor,
Object* excep = dvmGetException(self);
if (excep != NULL) {
#if DVM_SHOW_EXCEPTION >= 2
- LOGD("NOTE: loadClass '%s' %p threw exception %s\n",
+ LOGD("NOTE: loadClass '%s' %p threw exception %s",
dotName, loader, excep->clazz->descriptor);
#endif
dvmAddTrackedAlloc(excep, self);
@@ -1388,7 +1388,7 @@ static ClassObject* findClassFromLoaderNoInit(const char* descriptor,
clazz = NULL;
goto bail;
} else if (clazz == NULL) {
- LOGW("ClassLoader returned NULL w/o exception pending\n");
+ LOGW("ClassLoader returned NULL w/o exception pending");
dvmThrowNullPointerException("ClassLoader returned null");
goto bail;
}
@@ -1398,7 +1398,7 @@ static ClassObject* findClassFromLoaderNoInit(const char* descriptor,
dvmAddInitiatingLoader(clazz, loader);
- LOGVV("--- Successfully loaded %s %p (thisldr=%p clazz=%p)\n",
+ LOGVV("--- Successfully loaded %s %p (thisldr=%p clazz=%p)",
descriptor, clazz->classLoader, loader, clazz);
bail:
@@ -1480,7 +1480,7 @@ static ClassObject* findClassNoInit(const char* descriptor, Object* loader,
bool profilerNotified = false;
if (loader != NULL) {
- LOGVV("#### findClassNoInit(%s,%p,%p)\n", descriptor, loader,
+ LOGVV("#### findClassNoInit(%s,%p,%p)", descriptor, loader,
pDvmDex->pDexFile);
}
@@ -1567,7 +1567,7 @@ static ClassObject* findClassNoInit(const char* descriptor, Object* loader,
*
* (Yes, this happens.)
*/
- //LOGW("WOW: somebody loaded %s simultaneously\n", descriptor);
+ //LOGW("WOW: somebody loaded %s simultaneously", descriptor);
clazz->initThreadId = 0;
dvmUnlockObject(self, (Object*) clazz);
@@ -1606,7 +1606,7 @@ static ClassObject* findClassNoInit(const char* descriptor, Object* loader,
dvmUnlockObject(self, (Object*) clazz);
#if LOG_CLASS_LOADING
- LOG(LOG_INFO, "DVMLINK FAILED FOR CLASS ", "%s in %s\n",
+ LOG(LOG_INFO, "DVMLINK FAILED FOR CLASS ", "%s in %s",
clazz->descriptor, get_process_name());
/*
@@ -1619,9 +1619,9 @@ static ClassObject* findClassNoInit(const char* descriptor, Object* loader,
clazz = NULL;
if (gDvm.optimizing) {
/* happens with "external" libs */
- LOGV("Link of class '%s' failed\n", descriptor);
+ LOGV("Link of class '%s' failed", descriptor);
} else {
- LOGW("Link of class '%s' failed\n", descriptor);
+ LOGW("Link of class '%s' failed", descriptor);
}
goto bail;
}
@@ -1678,13 +1678,13 @@ got_class:
if (!dvmIsClassLinked(clazz) &&
clazz->initThreadId == self->threadId)
{
- LOGW("Recursive link on class %s\n", clazz->descriptor);
+ LOGW("Recursive link on class %s", clazz->descriptor);
dvmUnlockObject(self, (Object*) clazz);
dvmThrowClassCircularityError(clazz->descriptor);
clazz = NULL;
goto bail;
}
- //LOGI("WAITING for '%s' (owner=%d)\n",
+ //LOGI("WAITING for '%s' (owner=%d)",
// clazz->descriptor, clazz->initThreadId);
while (!dvmIsClassLinked(clazz) && clazz->status != CLASS_ERROR) {
dvmObjectWait(self, (Object*) clazz, 0, 0, false);
@@ -1709,7 +1709,7 @@ got_class:
assert(dvmIsClassObject(clazz));
assert(clazz == gDvm.classJavaLangObject || clazz->super != NULL);
if (!dvmIsInterfaceClass(clazz)) {
- //LOGI("class=%s vtableCount=%d, virtualMeth=%d\n",
+ //LOGI("class=%s vtableCount=%d, virtualMeth=%d",
// clazz->descriptor, clazz->vtableCount,
// clazz->virtualMethodCount);
assert(clazz->vtableCount >= clazz->virtualMethodCount);
@@ -1743,7 +1743,7 @@ static ClassObject* loadClassFromDex0(DvmDex* pDvmDex,
* runtime state.
*/
if ((pClassDef->accessFlags & ~EXPECTED_FILE_FLAGS) != 0) {
- LOGW("Invalid file flags in class %s: %04x\n",
+ LOGW("Invalid file flags in class %s: %04x",
descriptor, pClassDef->accessFlags);
return NULL;
}
@@ -1876,7 +1876,7 @@ static ClassObject* loadClassFromDex0(DvmDex* pDvmDex,
if (classMapData != NULL &&
pHeader->directMethodsSize + pHeader->virtualMethodsSize != numMethods)
{
- LOGE("ERROR: in %s, direct=%d virtual=%d, maps have %d\n",
+ LOGE("ERROR: in %s, direct=%d virtual=%d, maps have %d",
newClass->descriptor, pHeader->directMethodsSize,
pHeader->virtualMethodsSize, numMethods);
assert(false);
@@ -1961,7 +1961,7 @@ static ClassObject* loadClassFromDex(DvmDex* pDvmDex,
pDexFile = pDvmDex->pDexFile;
if (gDvm.verboseClass) {
- LOGV("CLASS: loading '%s'...\n",
+ LOGV("CLASS: loading '%s'...",
dexGetClassDescriptor(pDexFile, pClassDef));
}
@@ -1978,7 +1978,7 @@ static ClassObject* loadClassFromDex(DvmDex* pDvmDex,
classLoader);
if (gDvm.verboseClass && (result != NULL)) {
- LOGI("[Loaded %s from DEX %p (cl=%p)]\n",
+ LOGI("[Loaded %s from DEX %p (cl=%p)]",
result->descriptor, pDvmDex, classLoader);
}
@@ -2134,8 +2134,8 @@ static void freeMethodInnards(Method* meth)
static void cloneMethod(Method* dst, const Method* src)
{
if (src->registerMap != NULL) {
- LOGE("GLITCH: only expected abstract methods here\n");
- LOGE(" cloning %s.%s\n", src->clazz->descriptor, src->name);
+ LOGE("GLITCH: only expected abstract methods here");
+ LOGE(" cloning %s.%s", src->clazz->descriptor, src->name);
dvmAbort();
}
memcpy(dst, src, sizeof(Method));
@@ -2238,7 +2238,7 @@ void dvmMakeCodeReadWrite(Method* meth)
assert(!dvmIsNativeMethod(meth) && !dvmIsAbstractMethod(meth));
size_t dexCodeSize = dexGetDexCodeSize(methodDexCode);
- LOGD("Making a copy of %s.%s code (%d bytes)\n",
+ LOGD("Making a copy of %s.%s code (%d bytes)",
meth->clazz->descriptor, meth->name, dexCodeSize);
DexCode* newCode =
@@ -2258,7 +2258,7 @@ void dvmMakeCodeReadWrite(Method* meth)
void dvmMakeCodeReadOnly(Method* meth)
{
DexCode* methodDexCode = (DexCode*) dvmGetMethodCode(meth);
- LOGV("+++ marking %p read-only\n", methodDexCode);
+ LOGV("+++ marking %p read-only", methodDexCode);
dvmLinearReadOnly(meth->clazz->classLoader, methodDexCode);
}
#endif
@@ -2427,7 +2427,7 @@ static bool precacheReferenceOffsets(ClassObject* clazz)
}
dvmLinearReadOnly(clazz->classLoader, clazz->ifields);
if (i == clazz->ifieldRefCount) {
- LOGE("Unable to reorder 'referent' in %s\n", clazz->descriptor);
+ LOGE("Unable to reorder 'referent' in %s", clazz->descriptor);
return false;
}
@@ -2436,7 +2436,7 @@ static bool precacheReferenceOffsets(ClassObject* clazz)
* info about the class.
*/
if (!dvmFindReferenceMembers(clazz)) {
- LOGE("Trouble with Reference setup\n");
+ LOGE("Trouble with Reference setup");
return false;
}
@@ -2514,7 +2514,7 @@ bool dvmLinkClass(ClassObject* clazz)
assert(clazz->descriptor != NULL);
assert(clazz->status == CLASS_IDX || clazz->status == CLASS_LOADED);
if (gDvm.verboseClass)
- LOGV("CLASS: linking '%s'...\n", clazz->descriptor);
+ LOGV("CLASS: linking '%s'...", clazz->descriptor);
assert(gDvm.classJavaLangClass != NULL);
assert(clazz->clazz == gDvm.classJavaLangClass);
@@ -2575,10 +2575,10 @@ bool dvmLinkClass(ClassObject* clazz)
assert(dvmCheckException(dvmThreadSelf()));
if (gDvm.optimizing) {
/* happens with "external" libs */
- LOGV("Unable to resolve superclass of %s (%d)\n",
+ LOGV("Unable to resolve superclass of %s (%d)",
clazz->descriptor, superclassIdx);
} else {
- LOGW("Unable to resolve superclass of %s (%d)\n",
+ LOGW("Unable to resolve superclass of %s (%d)",
clazz->descriptor, superclassIdx);
}
goto bail;
@@ -2607,11 +2607,11 @@ bool dvmLinkClass(ClassObject* clazz)
dexStringByTypeIdx(pDexFile, interfaceIdxArray[i]);
if (gDvm.optimizing) {
/* happens with "external" libs */
- LOGV("Failed resolving %s interface %d '%s'\n",
+ LOGV("Failed resolving %s interface %d '%s'",
clazz->descriptor, interfaceIdxArray[i],
classDescriptor);
} else {
- LOGI("Failed resolving %s interface %d '%s'\n",
+ LOGI("Failed resolving %s interface %d '%s'",
clazz->descriptor, interfaceIdxArray[i],
classDescriptor);
}
@@ -2621,12 +2621,12 @@ bool dvmLinkClass(ClassObject* clazz)
/* are we allowed to implement this interface? */
if (!dvmCheckClassAccess(clazz, clazz->interfaces[i])) {
dvmLinearReadOnly(clazz->classLoader, clazz->interfaces);
- LOGW("Interface '%s' is not accessible to '%s'\n",
+ LOGW("Interface '%s' is not accessible to '%s'",
clazz->interfaces[i]->descriptor, clazz->descriptor);
dvmThrowIllegalAccessError("interface not accessible");
goto bail;
}
- LOGVV("+++ found interface '%s'\n",
+ LOGVV("+++ found interface '%s'",
clazz->interfaces[i]->descriptor);
}
dvmLinearReadOnly(clazz->classLoader, clazz->interfaces);
@@ -2663,17 +2663,17 @@ bool dvmLinkClass(ClassObject* clazz)
}
/* verify */
if (dvmIsFinalClass(clazz->super)) {
- LOGW("Superclass of '%s' is final '%s'\n",
+ LOGW("Superclass of '%s' is final '%s'",
clazz->descriptor, clazz->super->descriptor);
dvmThrowIncompatibleClassChangeError("superclass is final");
goto bail;
} else if (dvmIsInterfaceClass(clazz->super)) {
- LOGW("Superclass of '%s' is interface '%s'\n",
+ LOGW("Superclass of '%s' is interface '%s'",
clazz->descriptor, clazz->super->descriptor);
dvmThrowIncompatibleClassChangeError("superclass is an interface");
goto bail;
} else if (!dvmCheckClassAccess(clazz, clazz->super)) {
- LOGW("Superclass of '%s' (%s) is not accessible\n",
+ LOGW("Superclass of '%s' (%s) is not accessible",
clazz->descriptor, clazz->super->descriptor);
dvmThrowIllegalAccessError("superclass not accessible");
goto bail;
@@ -2759,7 +2759,7 @@ bool dvmLinkClass(ClassObject* clazz)
int count = clazz->virtualMethodCount;
if (count != (u2) count) {
- LOGE("Too many methods (%d) in interface '%s'\n", count,
+ LOGE("Too many methods (%d) in interface '%s'", count,
clazz->descriptor);
goto bail;
}
@@ -2772,7 +2772,7 @@ bool dvmLinkClass(ClassObject* clazz)
dvmLinearReadOnly(clazz->classLoader, clazz->virtualMethods);
} else {
if (!createVtable(clazz)) {
- LOGW("failed creating vtable\n");
+ LOGW("failed creating vtable");
goto bail;
}
}
@@ -2803,7 +2803,7 @@ bool dvmLinkClass(ClassObject* clazz)
if ((clazz->classLoader == NULL)
&& (strcmp(clazz->descriptor, "Ljava/lang/ref/Reference;") == 0)) {
if (!precacheReferenceOffsets(clazz)) {
- LOGE("failed pre-caching Reference offsets\n");
+ LOGE("failed pre-caching Reference offsets");
dvmThrowInternalError(NULL);
goto bail;
}
@@ -2825,7 +2825,7 @@ bool dvmLinkClass(ClassObject* clazz)
clazz->status = CLASS_RESOLVED;
okay = true;
if (gDvm.verboseClass)
- LOGV("CLASS: linked '%s'\n", clazz->descriptor);
+ LOGV("CLASS: linked '%s'", clazz->descriptor);
/*
* We send CLASS_PREPARE events to the debugger from here. The
@@ -2870,7 +2870,7 @@ static bool createVtable(ClassObject* clazz)
int i;
if (clazz->super != NULL) {
- //LOGI("SUPER METHODS %d %s->%s\n", clazz->super->vtableCount,
+ //LOGI("SUPER METHODS %d %s->%s", clazz->super->vtableCount,
// clazz->descriptor, clazz->super->descriptor);
}
@@ -2884,7 +2884,7 @@ static bool createVtable(ClassObject* clazz)
*/
assert(strcmp(clazz->descriptor, "Ljava/lang/Object;") == 0);
}
- //LOGD("+++ max vmethods for '%s' is %d\n", clazz->descriptor, maxCount);
+ //LOGD("+++ max vmethods for '%s' is %d", clazz->descriptor, maxCount);
/*
* Over-allocate the table, then realloc it down if necessary. So
@@ -2919,14 +2919,14 @@ static bool createVtable(ClassObject* clazz)
{
/* verify */
if (dvmIsFinalMethod(superMeth)) {
- LOGW("Method %s.%s overrides final %s.%s\n",
+ LOGW("Method %s.%s overrides final %s.%s",
localMeth->clazz->descriptor, localMeth->name,
superMeth->clazz->descriptor, superMeth->name);
goto bail;
}
clazz->vtable[si] = localMeth;
localMeth->methodIndex = (u2) si;
- //LOGV("+++ override %s.%s (slot %d)\n",
+ //LOGV("+++ override %s.%s (slot %d)",
// clazz->descriptor, localMeth->name, si);
break;
}
@@ -2938,13 +2938,13 @@ static bool createVtable(ClassObject* clazz)
localMeth->methodIndex = (u2) actualCount;
actualCount++;
- //LOGV("+++ add method %s.%s\n",
+ //LOGV("+++ add method %s.%s",
// clazz->descriptor, localMeth->name);
}
}
if (actualCount != (u2) actualCount) {
- LOGE("Too many methods (%d) in class '%s'\n", actualCount,
+ LOGE("Too many methods (%d) in class '%s'", actualCount,
clazz->descriptor);
goto bail;
}
@@ -2957,10 +2957,10 @@ static bool createVtable(ClassObject* clazz)
clazz->vtable = (Method **)dvmLinearRealloc(clazz->classLoader,
clazz->vtable, sizeof(*(clazz->vtable)) * actualCount);
if (clazz->vtable == NULL) {
- LOGE("vtable realloc failed\n");
+ LOGE("vtable realloc failed");
goto bail;
} else {
- LOGVV("+++ reduced vtable from %d to %d\n",
+ LOGVV("+++ reduced vtable from %d to %d",
maxCount, actualCount);
}
}
@@ -2970,7 +2970,7 @@ static bool createVtable(ClassObject* clazz)
/* java/lang/Object case */
int count = clazz->virtualMethodCount;
if (count != (u2) count) {
- LOGE("Too many methods (%d) in base class '%s'\n", count,
+ LOGE("Too many methods (%d) in base class '%s'", count,
clazz->descriptor);
goto bail;
}
@@ -3028,7 +3028,7 @@ static bool createIftable(ClassObject* clazz)
for (int i = 0; i < clazz->interfaceCount; i++)
ifCount += clazz->interfaces[i]->iftableCount;
- LOGVV("INTF: class '%s' direct w/supra=%d super=%d total=%d\n",
+ LOGVV("INTF: class '%s' direct w/supra=%d super=%d total=%d",
clazz->descriptor, ifCount - superIfCount, superIfCount, ifCount);
if (ifCount == 0) {
@@ -3061,7 +3061,7 @@ static bool createIftable(ClassObject* clazz)
/* make sure this is still an interface class */
if (!dvmIsInterfaceClass(interf)) {
- LOGW("Class '%s' implements non-interface '%s'\n",
+ LOGW("Class '%s' implements non-interface '%s'",
clazz->descriptor, interf->descriptor);
dvmThrowIncompatibleClassChangeErrorWithClassMessage(
clazz->descriptor);
@@ -3104,7 +3104,7 @@ static bool createIftable(ClassObject* clazz)
if (i == j)
continue;
if (clazz->iftable[i].clazz == clazz->iftable[j].clazz) {
- LOGVV("INTF: redundant interface %s in %s\n",
+ LOGVV("INTF: redundant interface %s in %s",
clazz->iftable[i].clazz->descriptor,
clazz->descriptor);
@@ -3117,7 +3117,7 @@ static bool createIftable(ClassObject* clazz)
}
}
}
- LOGVV("INTF: class '%s' nodupes=%d\n", clazz->descriptor, ifCount);
+ LOGVV("INTF: class '%s' nodupes=%d", clazz->descriptor, ifCount);
} // if (false)
clazz->iftableCount = ifCount;
@@ -3155,14 +3155,14 @@ static bool createIftable(ClassObject* clazz)
* Note it's valid for an interface to have no methods (e.g.
* java/io/Serializable).
*/
- LOGVV("INTF: pool: %d from %s\n",
+ LOGVV("INTF: pool: %d from %s",
clazz->iftable[i].clazz->virtualMethodCount,
clazz->iftable[i].clazz->descriptor);
poolSize += clazz->iftable[i].clazz->virtualMethodCount;
}
if (poolSize == 0) {
- LOGVV("INTF: didn't find any new interfaces with methods\n");
+ LOGVV("INTF: didn't find any new interfaces with methods");
result = true;
goto bail;
}
@@ -3220,7 +3220,7 @@ static bool createIftable(ClassObject* clazz)
IF_LOGVV() {
char* desc = dexProtoCopyMethodDescriptor(&imeth->prototype);
- LOGVV("INTF: matching '%s' '%s'\n", imeth->name, desc);
+ LOGVV("INTF: matching '%s' '%s'", imeth->name, desc);
free(desc);
}
@@ -3228,9 +3228,9 @@ static bool createIftable(ClassObject* clazz)
if (dvmCompareMethodNamesAndProtos(imeth, clazz->vtable[j])
== 0)
{
- LOGVV("INTF: matched at %d\n", j);
+ LOGVV("INTF: matched at %d", j);
if (!dvmIsPublicMethod(clazz->vtable[j])) {
- LOGW("Implementation of %s.%s is not public\n",
+ LOGW("Implementation of %s.%s is not public",
clazz->descriptor, clazz->vtable[j]->name);
dvmThrowIllegalAccessError(
"interface implementation not public");
@@ -3244,7 +3244,7 @@ static bool createIftable(ClassObject* clazz)
IF_LOGV() {
char* desc =
dexProtoCopyMethodDescriptor(&imeth->prototype);
- LOGV("No match for '%s' '%s' in '%s' (creating miranda)\n",
+ LOGV("No match for '%s' '%s' in '%s' (creating miranda)",
imeth->name, desc, clazz->descriptor);
free(desc);
}
@@ -3280,7 +3280,7 @@ static bool createIftable(ClassObject* clazz)
IF_LOGVV() {
char* desc = dexProtoCopyMethodDescriptor(
&imeth->prototype);
- LOGVV("MIRANDA dupe: %s and %s %s%s\n",
+ LOGVV("MIRANDA dupe: %s and %s %s%s",
mirandaList[mir]->clazz->descriptor,
imeth->clazz->descriptor,
imeth->name, desc);
@@ -3293,12 +3293,12 @@ static bool createIftable(ClassObject* clazz)
/* point the iftable at a phantom slot index */
clazz->iftable[i].methodIndexArray[methIdx] =
clazz->vtableCount + mir;
- LOGVV("MIRANDA: %s points at slot %d\n",
+ LOGVV("MIRANDA: %s points at slot %d",
imeth->name, clazz->vtableCount + mir);
/* if non-duplicate among Mirandas, add to Miranda list */
if (mir == mirandaCount) {
- //LOGV("MIRANDA: holding '%s' in slot %d\n",
+ //LOGV("MIRANDA: holding '%s' in slot %d",
// imeth->name, mir);
mirandaList[mirandaCount++] = imeth;
}
@@ -3313,7 +3313,7 @@ static bool createIftable(ClassObject* clazz)
int oldMethodCount, oldVtableCount;
for (int i = 0; i < mirandaCount; i++) {
- LOGVV("MIRANDA %d: %s.%s\n", i,
+ LOGVV("MIRANDA %d: %s.%s", i,
mirandaList[i]->clazz->descriptor, mirandaList[i]->name);
}
if (mirandaCount > kManyMirandas) {
@@ -3324,7 +3324,7 @@ static bool createIftable(ClassObject* clazz)
* massive collection of Miranda methods and a lot of wasted
* space, sometimes enough to blow out the LinearAlloc cap.
*/
- LOGD("Note: class %s has %d unimplemented (abstract) methods\n",
+ LOGD("Note: class %s has %d unimplemented (abstract) methods",
clazz->descriptor, mirandaCount);
}
@@ -3359,7 +3359,7 @@ static bool createIftable(ClassObject* clazz)
* stuff makes it look like the class actually has an abstract
* method declaration in it.
*/
- LOGVV("MIRANDA fixing vtable pointers\n");
+ LOGVV("MIRANDA fixing vtable pointers");
dvmLinearReadWrite(clazz->classLoader, clazz->vtable);
Method* meth = newVirtualMethods;
for (int i = 0; i < clazz->virtualMethodCount; i++, meth++)
@@ -3504,7 +3504,7 @@ static inline void swapField(InstField* pOne, InstField* pTwo)
{
InstField swap;
- LOGVV(" --- swap '%s' and '%s'\n", pOne->name, pTwo->name);
+ LOGVV(" --- swap '%s' and '%s'", pOne->name, pTwo->name);
swap = *pOne;
*pOne = *pTwo;
*pTwo = swap;
@@ -3553,12 +3553,12 @@ static bool computeFieldOffsets(ClassObject* clazz)
else
fieldOffset = OFFSETOF_MEMBER(DataObject, instanceData);
- LOGVV("--- computeFieldOffsets '%s'\n", clazz->descriptor);
+ LOGVV("--- computeFieldOffsets '%s'", clazz->descriptor);
- //LOGI("OFFSETS fieldCount=%d\n", clazz->ifieldCount);
- //LOGI("dataobj, instance: %d\n", offsetof(DataObject, instanceData));
- //LOGI("classobj, access: %d\n", offsetof(ClassObject, accessFlags));
- //LOGI("super=%p, fieldOffset=%d\n", clazz->super, fieldOffset);
+ //LOGI("OFFSETS fieldCount=%d", clazz->ifieldCount);
+ //LOGI("dataobj, instance: %d", offsetof(DataObject, instanceData));
+ //LOGI("classobj, access: %d", offsetof(ClassObject, accessFlags));
+ //LOGI("super=%p, fieldOffset=%d", clazz->super, fieldOffset);
/*
* Start by moving all reference fields to the front.
@@ -3610,7 +3610,7 @@ static bool computeFieldOffsets(ClassObject* clazz)
pField->byteOffset = fieldOffset;
fieldOffset += sizeof(u4);
- LOGVV(" --- offset1 '%s'=%d\n", pField->name,pField->byteOffset);
+ LOGVV(" --- offset1 '%s'=%d", pField->name,pField->byteOffset);
}
/*
@@ -3619,7 +3619,7 @@ static bool computeFieldOffsets(ClassObject* clazz)
* If we can't find one, we'll have to pad it.
*/
if (i != clazz->ifieldCount && (fieldOffset & 0x04) != 0) {
- LOGVV(" +++ not aligned\n");
+ LOGVV(" +++ not aligned");
InstField* pField = &clazz->ifields[i];
char c = pField->signature[0];
@@ -3632,7 +3632,7 @@ static bool computeFieldOffsets(ClassObject* clazz)
pField->byteOffset = fieldOffset;
fieldOffset += sizeof(u4);
i++;
- LOGVV(" --- offset2 '%s'=%d\n",
+ LOGVV(" --- offset2 '%s'=%d",
pField->name, pField->byteOffset);
} else {
/*
@@ -3648,11 +3648,11 @@ static bool computeFieldOffsets(ClassObject* clazz)
if (rc != 'J' && rc != 'D') {
swapField(pField, singleField);
//c = rc;
- LOGVV(" +++ swapped '%s' for alignment\n",
+ LOGVV(" +++ swapped '%s' for alignment",
pField->name);
pField->byteOffset = fieldOffset;
fieldOffset += sizeof(u4);
- LOGVV(" --- offset3 '%s'=%d\n",
+ LOGVV(" --- offset3 '%s'=%d",
pField->name, pField->byteOffset);
found = true;
i++;
@@ -3660,7 +3660,7 @@ static bool computeFieldOffsets(ClassObject* clazz)
}
}
if (!found) {
- LOGV(" +++ inserting pad field in '%s'\n", clazz->descriptor);
+ LOGV(" +++ inserting pad field in '%s'", clazz->descriptor);
fieldOffset += sizeof(u4);
}
}
@@ -3705,7 +3705,7 @@ static bool computeFieldOffsets(ClassObject* clazz)
}
pField->byteOffset = fieldOffset;
- LOGVV(" --- offset4 '%s'=%d\n", pField->name,pField->byteOffset);
+ LOGVV(" --- offset4 '%s'=%d", pField->name,pField->byteOffset);
fieldOffset += sizeof(u4);
if (c == 'J' || c == 'D')
fieldOffset += sizeof(u4);
@@ -3759,7 +3759,7 @@ static bool computeFieldOffsets(ClassObject* clazz)
*/
static void throwEarlierClassFailure(ClassObject* clazz)
{
- LOGI("Rejecting re-init on previously-failed class %s v=%p\n",
+ LOGI("Rejecting re-init on previously-failed class %s v=%p",
clazz->descriptor, clazz->verifyErrorClass);
if (clazz->verifyErrorClass == NULL) {
@@ -3788,7 +3788,7 @@ static void initSFields(ClassObject* clazz)
}
if (clazz->pDvmDex == NULL) {
/* generated class; any static fields should already be set up */
- LOGV("Not initializing static fields in %s\n", clazz->descriptor);
+ LOGV("Not initializing static fields in %s", clazz->descriptor);
return;
}
pDexFile = clazz->pDvmDex->pDexFile;
@@ -4088,7 +4088,7 @@ static bool validateSuperDescriptors(const ClassObject* clazz)
if (meth != clazz->super->vtable[i] &&
!checkMethodDescriptorClasses(meth, clazz->super, clazz))
{
- LOGW("Method mismatch: %s in %s (cl=%p) and super %s (cl=%p)\n",
+ LOGW("Method mismatch: %s in %s (cl=%p) and super %s (cl=%p)",
meth->name, clazz->descriptor, clazz->classLoader,
clazz->super->descriptor, clazz->super->classLoader);
dvmThrowLinkageError(
@@ -4260,14 +4260,14 @@ bool dvmInitClass(ClassObject* clazz)
clazz->classLoader == NULL))
{
/* advance to "verified" state */
- LOGV("+++ not verifying class %s (cl=%p)\n",
+ LOGV("+++ not verifying class %s (cl=%p)",
clazz->descriptor, clazz->classLoader);
clazz->status = CLASS_VERIFIED;
goto noverify;
}
if (!gDvm.optimizing)
- LOGV("+++ late verify on %s\n", clazz->descriptor);
+ LOGV("+++ late verify on %s", clazz->descriptor);
/*
* We're not supposed to optimize an unverified class, but during
@@ -4312,7 +4312,7 @@ noverify:
* system classes, and dexopt runs single-threaded.
*/
if (!IS_CLASS_FLAG_SET(clazz, CLASS_ISOPTIMIZED) && !gDvm.optimizing) {
- LOGV("+++ late optimize on %s (pv=%d)\n",
+ LOGV("+++ late optimize on %s (pv=%d)",
clazz->descriptor, IS_CLASS_FLAG_SET(clazz, CLASS_ISPREVERIFIED));
bool essentialOnly = (gDvm.dexOptMode != OPTIMIZE_MODE_FULL);
dvmOptimizeClass(clazz, essentialOnly);
@@ -4328,12 +4328,12 @@ noverify:
while (clazz->status == CLASS_INITIALIZING) {
/* we caught somebody else in the act; was it us? */
if (clazz->initThreadId == self->threadId) {
- //LOGV("HEY: found a recursive <clinit>\n");
+ //LOGV("HEY: found a recursive <clinit>");
goto bail_unlock;
}
if (dvmCheckException(self)) {
- LOGW("GLITCH: exception pending at start of class init\n");
+ LOGW("GLITCH: exception pending at start of class init");
dvmAbort();
}
@@ -4350,7 +4350,7 @@ noverify:
* was set), bail out.
*/
if (dvmCheckException(self)) {
- LOGI("Class init of '%s' failing with wait() exception\n",
+ LOGI("Class init of '%s' failing with wait() exception",
clazz->descriptor);
/*
* TODO: this is bogus, because it means the two threads have a
@@ -4370,7 +4370,7 @@ noverify:
goto bail_unlock;
}
if (clazz->status == CLASS_INITIALIZING) {
- LOGI("Waiting again for class init\n");
+ LOGI("Waiting again for class init");
continue;
}
assert(clazz->status == CLASS_INITIALIZED ||
@@ -4467,9 +4467,9 @@ noverify:
*/
method = dvmFindDirectMethodByDescriptor(clazz, "<clinit>", "()V");
if (method == NULL) {
- LOGVV("No <clinit> found for %s\n", clazz->descriptor);
+ LOGVV("No <clinit> found for %s", clazz->descriptor);
} else {
- LOGVV("Invoking %s.<clinit>\n", clazz->descriptor);
+ LOGVV("Invoking %s.<clinit>", clazz->descriptor);
JValue unused;
dvmCallMethod(self, method, NULL, &unused);
}
@@ -4480,10 +4480,10 @@ noverify:
* need to throw an ExceptionInInitializerError, but we want to
* tuck the original exception into the "cause" field.
*/
- LOGW("Exception %s thrown while initializing %s\n",
+ LOGW("Exception %s thrown while initializing %s",
(dvmGetException(self)->clazz)->descriptor, clazz->descriptor);
dvmThrowExceptionInInitializerError();
- //LOGW("+++ replaced\n");
+ //LOGW("+++ replaced");
dvmLockObject(self, (Object*) clazz);
clazz->status = CLASS_ERROR;
@@ -4491,7 +4491,7 @@ noverify:
/* success! */
dvmLockObject(self, (Object*) clazz);
clazz->status = CLASS_INITIALIZED;
- LOGVV("Initialized class: %s\n", clazz->descriptor);
+ LOGVV("Initialized class: %s", clazz->descriptor);
/*
* Update alloc counters. TODO: guard with mutex.
@@ -4585,7 +4585,7 @@ void dvmSetRegisterMap(Method* method, const RegisterMap* pMap)
if (method->registerMap != NULL) {
/* unexpected during class loading, okay on first use (uncompress) */
- LOGV("NOTE: registerMap already set for %s.%s\n",
+ LOGV("NOTE: registerMap already set for %s.%s",
method->clazz->descriptor, method->name);
/* keep going */
}
@@ -4671,7 +4671,7 @@ static int dumpClass(void* vclazz, void* varg)
int i;
if (clazz == NULL) {
- LOGI("dumpClass: ignoring request to dump null class\n");
+ LOGI("dumpClass: ignoring request to dump null class");
return 0;
}
@@ -4683,13 +4683,13 @@ static int dumpClass(void* vclazz, void* varg)
initStr = dvmIsClassInitialized(clazz) ? "true" : "false";
if (showInit && showLoader)
- LOGI("%s %p %s\n", clazz->descriptor, clazz->classLoader, initStr);
+ LOGI("%s %p %s", clazz->descriptor, clazz->classLoader, initStr);
else if (showInit)
- LOGI("%s %s\n", clazz->descriptor, initStr);
+ LOGI("%s %s", clazz->descriptor, initStr);
else if (showLoader)
- LOGI("%s %p\n", clazz->descriptor, clazz->classLoader);
+ LOGI("%s %p", clazz->descriptor, clazz->classLoader);
else
- LOGI("%s\n", clazz->descriptor);
+ LOGI("%s", clazz->descriptor);
return 0;
}
@@ -4700,32 +4700,32 @@ static int dumpClass(void* vclazz, void* varg)
else
super = NULL;
- LOGI("----- %s '%s' cl=%p ser=0x%08x -----\n",
+ LOGI("----- %s '%s' cl=%p ser=0x%08x -----",
dvmIsInterfaceClass(clazz) ? "interface" : "class",
clazz->descriptor, clazz->classLoader, clazz->serialNumber);
- LOGI(" objectSize=%d (%d from super)\n", (int) clazz->objectSize,
+ LOGI(" objectSize=%d (%d from super)", (int) clazz->objectSize,
super != NULL ? (int) super->objectSize : -1);
- LOGI(" access=0x%04x.%04x\n", clazz->accessFlags >> 16,
+ LOGI(" access=0x%04x.%04x", clazz->accessFlags >> 16,
clazz->accessFlags & JAVA_FLAGS_MASK);
if (super != NULL)
- LOGI(" super='%s' (cl=%p)\n", super->descriptor, super->classLoader);
+ LOGI(" super='%s' (cl=%p)", super->descriptor, super->classLoader);
if (dvmIsArrayClass(clazz)) {
- LOGI(" dimensions=%d elementClass=%s\n",
+ LOGI(" dimensions=%d elementClass=%s",
clazz->arrayDim, clazz->elementClass->descriptor);
}
if (clazz->iftableCount > 0) {
- LOGI(" interfaces (%d):\n", clazz->iftableCount);
+ LOGI(" interfaces (%d):", clazz->iftableCount);
for (i = 0; i < clazz->iftableCount; i++) {
InterfaceEntry* ent = &clazz->iftable[i];
int j;
- LOGI(" %2d: %s (cl=%p)\n",
+ LOGI(" %2d: %s (cl=%p)",
i, ent->clazz->descriptor, ent->clazz->classLoader);
/* enable when needed */
if (false && ent->methodIndexArray != NULL) {
for (j = 0; j < ent->clazz->virtualMethodCount; j++)
- LOGI(" %2d: %d %s %s\n",
+ LOGI(" %2d: %d %s %s",
j, ent->methodIndexArray[j],
ent->clazz->virtualMethods[j].name,
clazz->vtable[ent->methodIndexArray[j]]->name);
@@ -4733,30 +4733,30 @@ static int dumpClass(void* vclazz, void* varg)
}
}
if (!dvmIsInterfaceClass(clazz)) {
- LOGI(" vtable (%d entries, %d in super):\n", clazz->vtableCount,
+ LOGI(" vtable (%d entries, %d in super):", clazz->vtableCount,
super != NULL ? super->vtableCount : 0);
for (i = 0; i < clazz->vtableCount; i++) {
desc = dexProtoCopyMethodDescriptor(&clazz->vtable[i]->prototype);
- LOGI(" %s%2d: %p %20s %s\n",
+ LOGI(" %s%2d: %p %20s %s",
(i != clazz->vtable[i]->methodIndex) ? "*** " : "",
(u4) clazz->vtable[i]->methodIndex, clazz->vtable[i],
clazz->vtable[i]->name, desc);
free(desc);
}
- LOGI(" direct methods (%d entries):\n", clazz->directMethodCount);
+ LOGI(" direct methods (%d entries):", clazz->directMethodCount);
for (i = 0; i < clazz->directMethodCount; i++) {
desc = dexProtoCopyMethodDescriptor(
&clazz->directMethods[i].prototype);
- LOGI(" %2d: %20s %s\n", i, clazz->directMethods[i].name,
+ LOGI(" %2d: %20s %s", i, clazz->directMethods[i].name,
desc);
free(desc);
}
} else {
- LOGI(" interface methods (%d):\n", clazz->virtualMethodCount);
+ LOGI(" interface methods (%d):", clazz->virtualMethodCount);
for (i = 0; i < clazz->virtualMethodCount; i++) {
desc = dexProtoCopyMethodDescriptor(
&clazz->virtualMethods[i].prototype);
- LOGI(" %2d: %2d %20s %s\n", i,
+ LOGI(" %2d: %2d %20s %s", i,
(u4) clazz->virtualMethods[i].methodIndex,
clazz->virtualMethods[i].name,
desc);
@@ -4764,16 +4764,16 @@ static int dumpClass(void* vclazz, void* varg)
}
}
if (clazz->sfieldCount > 0) {
- LOGI(" static fields (%d entries):\n", clazz->sfieldCount);
+ LOGI(" static fields (%d entries):", clazz->sfieldCount);
for (i = 0; i < clazz->sfieldCount; i++) {
- LOGI(" %2d: %20s %s\n", i, clazz->sfields[i].name,
+ LOGI(" %2d: %20s %s", i, clazz->sfields[i].name,
clazz->sfields[i].signature);
}
}
if (clazz->ifieldCount > 0) {
- LOGI(" instance fields (%d entries):\n", clazz->ifieldCount);
+ LOGI(" instance fields (%d entries):", clazz->ifieldCount);
for (i = 0; i < clazz->ifieldCount; i++) {
- LOGI(" %2d: %20s %s\n", i, clazz->ifields[i].name,
+ LOGI(" %2d: %20s %s", i, clazz->ifields[i].name,
clazz->ifields[i].signature);
}
}
@@ -4817,12 +4817,12 @@ int dvmGetNumLoadedClasses()
*/
void dvmDumpLoaderStats(const char* msg)
{
- LOGV("VM stats (%s): cls=%d/%d meth=%d ifld=%d sfld=%d linear=%d\n",
+ LOGV("VM stats (%s): cls=%d/%d meth=%d ifld=%d sfld=%d linear=%d",
msg, gDvm.numLoadedClasses, dvmHashTableNumEntries(gDvm.loadedClasses),
gDvm.numDeclaredMethods, gDvm.numDeclaredInstFields,
gDvm.numDeclaredStaticFields, gDvm.pBootLoaderAlloc->curOffset);
#ifdef COUNT_PRECISE_METHODS
- LOGI("GC precise methods: %d\n",
+ LOGI("GC precise methods: %d",
dvmPointerSetGetCount(gDvm.preciseMethods));
#endif
}
diff --git a/vm/oo/Object.cpp b/vm/oo/Object.cpp
index 0e05b52e2..c1ed33448 100644
--- a/vm/oo/Object.cpp
+++ b/vm/oo/Object.cpp
@@ -369,7 +369,7 @@ static Method* findMethodInListByDescriptor(const ClassObject* clazz,
size_t argCount = countArgsAndFindReturnType(descriptor, &returnType);
if (returnType == NULL) {
- LOGW("Bogus method descriptor: %s\n", descriptor);
+ LOGW("Bogus method descriptor: %s", descriptor);
return NULL;
}
diff --git a/vm/oo/Resolve.cpp b/vm/oo/Resolve.cpp
index a52cfe611..c5899b298 100644
--- a/vm/oo/Resolve.cpp
+++ b/vm/oo/Resolve.cpp
@@ -75,7 +75,7 @@ ClassObject* dvmResolveClass(const ClassObject* referrer, u4 classIdx,
if (resClass != NULL)
return resClass;
- LOGVV("--- resolving class %u (referrer=%s cl=%p)\n",
+ LOGVV("--- resolving class %u (referrer=%s cl=%p)",
classIdx, referrer->descriptor, referrer->classLoader);
/*
@@ -131,7 +131,7 @@ ClassObject* dvmResolveClass(const ClassObject* referrer, u4 classIdx,
referrer->pDvmDex,
resClass->descriptor, resClassCheck->descriptor,
resClassCheck->classLoader, resClassCheck->pDvmDex);
- LOGW("(%s had used a different %s during pre-verification)\n",
+ LOGW("(%s had used a different %s during pre-verification)",
referrer->descriptor, resClass->descriptor);
dvmThrowIllegalAccessError(
"Class ref in pre-verified class resolved to unexpected "
@@ -140,7 +140,7 @@ ClassObject* dvmResolveClass(const ClassObject* referrer, u4 classIdx,
}
}
- LOGVV("##### +ResolveClass(%s): referrer=%s dex=%p ldr=%p ref=%d\n",
+ LOGVV("##### +ResolveClass(%s): referrer=%s dex=%p ldr=%p ref=%d",
resClass->descriptor, referrer->descriptor, referrer->pDvmDex,
referrer->classLoader, classIdx);
@@ -154,7 +154,7 @@ ClassObject* dvmResolveClass(const ClassObject* referrer, u4 classIdx,
dvmDexSetResolvedClass(pDvmDex, classIdx, resClass);
} else {
/* not found, exception should be raised */
- LOGVV("Class not found: %s\n",
+ LOGVV("Class not found: %s",
dexStringByTypeIdx(pDvmDex->pDexFile, classIdx));
assert(dvmCheckException(dvmThreadSelf()));
}
@@ -183,7 +183,7 @@ Method* dvmResolveMethod(const ClassObject* referrer, u4 methodIdx,
assert(methodType != METHOD_INTERFACE);
- LOGVV("--- resolving method %u (referrer=%s)\n", methodIdx,
+ LOGVV("--- resolving method %u (referrer=%s)", methodIdx,
referrer->descriptor);
pMethodId = dexGetMethodId(pDvmDex->pDexFile, methodIdx);
@@ -223,7 +223,7 @@ Method* dvmResolveMethod(const ClassObject* referrer, u4 methodIdx,
return NULL;
}
- LOGVV("--- found method %d (%s.%s)\n",
+ LOGVV("--- found method %d (%s.%s)",
methodIdx, resClass->descriptor, resMethod->name);
/* see if this is a pure-abstract method */
@@ -264,7 +264,7 @@ Method* dvmResolveMethod(const ClassObject* referrer, u4 methodIdx,
*/
if (methodType == METHOD_STATIC && !dvmIsClassInitialized(resMethod->clazz))
{
- LOGVV("--- not caching resolved method %s.%s (class init=%d/%d)\n",
+ LOGVV("--- not caching resolved method %s.%s (class init=%d/%d)",
resMethod->clazz->descriptor, resMethod->name,
dvmIsClassInitializing(resMethod->clazz),
dvmIsClassInitialized(resMethod->clazz));
@@ -287,7 +287,7 @@ Method* dvmResolveInterfaceMethod(const ClassObject* referrer, u4 methodIdx)
const DexMethodId* pMethodId;
Method* resMethod;
- LOGVV("--- resolving interface method %d (referrer=%s)\n",
+ LOGVV("--- resolving interface method %d (referrer=%s)",
methodIdx, referrer->descriptor);
pMethodId = dexGetMethodId(pDvmDex->pDexFile, methodIdx);
@@ -333,7 +333,7 @@ Method* dvmResolveInterfaceMethod(const ClassObject* referrer, u4 methodIdx)
DexProto proto;
dexProtoSetFromMethodId(&proto, pDvmDex->pDexFile, pMethodId);
- LOGVV("+++ looking for '%s' '%s' in resClass='%s'\n",
+ LOGVV("+++ looking for '%s' '%s' in resClass='%s'",
methodName, methodSig, resClass->descriptor);
resMethod = dvmFindInterfaceMethodHier(resClass, methodName, &proto);
if (resMethod == NULL) {
@@ -341,7 +341,7 @@ Method* dvmResolveInterfaceMethod(const ClassObject* referrer, u4 methodIdx)
return NULL;
}
- LOGVV("--- found interface method %d (%s.%s)\n",
+ LOGVV("--- found interface method %d (%s.%s)",
methodIdx, resClass->descriptor, resMethod->name);
/* we're expecting this to be abstract */
@@ -386,7 +386,7 @@ InstField* dvmResolveInstField(const ClassObject* referrer, u4 ifieldIdx)
const DexFieldId* pFieldId;
InstField* resField;
- LOGVV("--- resolving field %u (referrer=%s cl=%p)\n",
+ LOGVV("--- resolving field %u (referrer=%s cl=%p)",
ifieldIdx, referrer->descriptor, referrer->classLoader);
pFieldId = dexGetFieldId(pDvmDex->pDexFile, ifieldIdx);
@@ -428,7 +428,7 @@ InstField* dvmResolveInstField(const ClassObject* referrer, u4 ifieldIdx)
* So it's always okay to update the table.
*/
dvmDexSetResolvedField(pDvmDex, ifieldIdx, (Field*)resField);
- LOGVV(" field %u is %s.%s\n",
+ LOGVV(" field %u is %s.%s",
ifieldIdx, resField->clazz->descriptor, resField->name);
return resField;
@@ -490,7 +490,7 @@ StaticField* dvmResolveStaticField(const ClassObject* referrer, u4 sfieldIdx)
if (dvmIsClassInitialized(resField->clazz)) {
dvmDexSetResolvedField(pDvmDex, sfieldIdx, (Field*) resField);
} else {
- LOGVV("--- not caching resolved field %s.%s (class init=%d/%d)\n",
+ LOGVV("--- not caching resolved field %s.%s (class init=%d/%d)",
resField->clazz->descriptor, resField->name,
dvmIsClassInitializing(resField->clazz),
dvmIsClassInitialized(resField->clazz));
@@ -515,7 +515,7 @@ StringObject* dvmResolveString(const ClassObject* referrer, u4 stringIdx)
const char* utf8;
u4 utf16Size;
- LOGVV("+++ resolving string, referrer is %s\n", referrer->descriptor);
+ LOGVV("+++ resolving string, referrer is %s", referrer->descriptor);
/*
* Create a UTF-16 version so we can trivially compare it to what's
diff --git a/vm/reflect/Annotation.cpp b/vm/reflect/Annotation.cpp
index 1fe20a713..aa1b4e6b6 100644
--- a/vm/reflect/Annotation.cpp
+++ b/vm/reflect/Annotation.cpp
@@ -245,12 +245,12 @@ static Method* resolveAmbiguousMethod(const ClassObject* referrer, u4 methodIdx)
resClass = dvmResolveClass(referrer, pMethodId->classIdx, true);
if (resClass == NULL) {
/* note exception will be pending */
- LOGD("resolveAmbiguousMethod: unable to find class %d\n", methodIdx);
+ LOGD("resolveAmbiguousMethod: unable to find class %d", methodIdx);
return NULL;
}
if (dvmIsInterfaceClass(resClass)) {
/* method is part of an interface -- not expecting that */
- LOGD("resolveAmbiguousMethod: method in interface?\n");
+ LOGD("resolveAmbiguousMethod: method in interface?");
return NULL;
}
@@ -330,7 +330,7 @@ static bool processAnnotationValue(const ClassObject* clazz,
valueArg = valueType >> kDexAnnotationValueArgShift;
width = valueArg + 1; /* assume, correct later */
- LOGV("----- type is 0x%02x %d, ptr=%p [0x%06x]\n",
+ LOGV("----- type is 0x%02x %d, ptr=%p [0x%06x]",
valueType & kDexAnnotationValueTypeMask, valueArg, ptr-1,
(ptr-1) - (u1*)clazz->pDvmDex->pDexFile->baseAddr);
@@ -485,11 +485,11 @@ static bool processAnnotationValue(const ClassObject* clazz,
u4 size, count;
size = readUleb128(&ptr);
- LOGVV("--- annotation array, size is %u at %p\n", size, ptr);
+ LOGVV("--- annotation array, size is %u at %p", size, ptr);
newArray = dvmAllocArrayByClass(gDvm.classJavaLangObjectArray,
size, ALLOC_DEFAULT);
if (newArray == NULL) {
- LOGE("annotation element array alloc failed (%d)\n", size);
+ LOGE("annotation element array alloc failed (%d)", size);
return false;
}
@@ -531,7 +531,7 @@ static bool processAnnotationValue(const ClassObject* clazz,
width = 0;
break;
default:
- LOGE("Bad annotation element value byte 0x%02x (0x%02x)\n",
+ LOGE("Bad annotation element value byte 0x%02x (0x%02x)",
valueType, valueType & kDexAnnotationValueTypeMask);
assert(false);
return false;
@@ -580,7 +580,7 @@ static Object* convertReturnType(Object* valueObj, ClassObject* methodReturn)
* (valueObj->clazz->descriptor+1, valueObj->clazz->classLoader).
*/
if (strcmp(valueObj->clazz->descriptor, "[Ljava/lang/Object;") != 0) {
- LOGE("Unexpected src type class (%s)\n", valueObj->clazz->descriptor);
+ LOGE("Unexpected src type class (%s)", valueObj->clazz->descriptor);
return NULL;
}
srcElemClass = gDvm.classJavaLangObject;
@@ -596,7 +596,7 @@ static Object* convertReturnType(Object* valueObj, ClassObject* methodReturn)
} else {
dstElemClass = dvmFindPrimitiveClass(firstChar);
}
- LOGV("HEY: converting valueObj from [%s to [%s\n",
+ LOGV("HEY: converting valueObj from [%s to [%s",
srcElemClass->descriptor, dstElemClass->descriptor);
ArrayObject* srcArray = (ArrayObject*) valueObj;
@@ -605,7 +605,7 @@ static Object* convertReturnType(Object* valueObj, ClassObject* methodReturn)
newArray = dvmAllocArrayByClass(methodReturn, length, ALLOC_DEFAULT);
if (newArray == NULL) {
- LOGE("Failed creating duplicate annotation class (%s %d)\n",
+ LOGE("Failed creating duplicate annotation class (%s %d)",
methodReturn->descriptor, length);
goto bail;
}
@@ -617,7 +617,7 @@ static Object* convertReturnType(Object* valueObj, ClassObject* methodReturn)
success = dvmUnboxObjectArray(newArray, srcArray, dstElemClass);
}
if (!success) {
- LOGE("Annotation array copy failed\n");
+ LOGE("Annotation array copy failed");
dvmReleaseTrackedAlloc((Object*)newArray, self);
newArray = NULL;
goto bail;
@@ -660,7 +660,7 @@ static Object* createAnnotationMember(const ClassObject* clazz,
elementNameIdx = readUleb128(pPtr);
if (!processAnnotationValue(clazz, pPtr, &avalue, kAllObjects)) {
- LOGW("Failed processing annotation value\n");
+ LOGW("Failed processing annotation value");
goto bail;
}
valueObj = (Object*)avalue.value.l;
@@ -676,7 +676,7 @@ static Object* createAnnotationMember(const ClassObject* clazz,
if (name != NULL) {
Method* annoMeth = dvmFindVirtualMethodByName(annoClass, name);
if (annoMeth == NULL) {
- LOGW("WARNING: could not find annotation member %s in %s\n",
+ LOGW("WARNING: could not find annotation member %s in %s",
name, annoClass->descriptor);
} else {
methodObj = dvmCreateReflectMethodObject(annoMeth);
@@ -686,7 +686,7 @@ static Object* createAnnotationMember(const ClassObject* clazz,
if (newMember == NULL || nameObj == NULL || methodObj == NULL ||
methodReturn == NULL)
{
- LOGE("Failed creating annotation element (m=%p n=%p a=%p r=%p)\n",
+ LOGE("Failed creating annotation element (m=%p n=%p a=%p r=%p)",
newMember, nameObj, methodObj, methodReturn);
goto bail;
}
@@ -700,7 +700,7 @@ static Object* createAnnotationMember(const ClassObject* clazz,
dvmCallMethod(self, gDvm.methOrgApacheHarmonyLangAnnotationAnnotationMember_init,
newMember, &unused, nameObj, valueObj, methodReturn, methodObj);
if (dvmCheckException(self)) {
- LOGD("Failed constructing annotation element\n");
+ LOGD("Failed constructing annotation element");
goto bail;
}
@@ -749,20 +749,20 @@ static Object* processEncodedAnnotation(const ClassObject* clazz,
typeIdx = readUleb128(&ptr);
size = readUleb128(&ptr);
- LOGVV("----- processEnc ptr=%p type=%d size=%d\n", ptr, typeIdx, size);
+ LOGVV("----- processEnc ptr=%p type=%d size=%d", ptr, typeIdx, size);
annoClass = dvmDexGetResolvedClass(clazz->pDvmDex, typeIdx);
if (annoClass == NULL) {
annoClass = dvmResolveClass(clazz, typeIdx, true);
if (annoClass == NULL) {
- LOGE("Unable to resolve %s annotation class %d\n",
+ LOGE("Unable to resolve %s annotation class %d",
clazz->descriptor, typeIdx);
assert(dvmCheckException(self));
return NULL;
}
}
- LOGV("----- processEnc ptr=%p [0x%06x] typeIdx=%d size=%d class=%s\n",
+ LOGV("----- processEnc ptr=%p [0x%06x] typeIdx=%d size=%d class=%s",
*pPtr, *pPtr - (u1*) clazz->pDvmDex->pDexFile->baseAddr,
typeIdx, size, annoClass->descriptor);
@@ -778,7 +778,7 @@ static Object* processEncodedAnnotation(const ClassObject* clazz,
gDvm.classOrgApacheHarmonyLangAnnotationAnnotationMemberArray,
size, ALLOC_DEFAULT);
if (elementArray == NULL) {
- LOGE("failed to allocate annotation member array (%d elements)\n",
+ LOGE("failed to allocate annotation member array (%d elements)",
size);
goto bail;
}
@@ -801,7 +801,7 @@ static Object* processEncodedAnnotation(const ClassObject* clazz,
gDvm.methOrgApacheHarmonyLangAnnotationAnnotationFactory_createAnnotation,
NULL, &result, annoClass, elementArray);
if (dvmCheckException(self)) {
- LOGD("Failed creating an annotation\n");
+ LOGD("Failed creating an annotation");
//dvmLogExceptionStackTrace();
goto bail;
}
@@ -960,7 +960,7 @@ static bool skipAnnotationValue(const ClassObject* clazz, const u1** pPtr)
valueArg = valueType >> kDexAnnotationValueArgShift;
width = valueArg + 1; /* assume */
- LOGV("----- type is 0x%02x %d, ptr=%p [0x%06x]\n",
+ LOGV("----- type is 0x%02x %d, ptr=%p [0x%06x]",
valueType & kDexAnnotationValueTypeMask, valueArg, ptr-1,
(ptr-1) - (u1*)clazz->pDvmDex->pDexFile->baseAddr);
@@ -1000,7 +1000,7 @@ static bool skipAnnotationValue(const ClassObject* clazz, const u1** pPtr)
width = 0;
break;
default:
- LOGE("Bad annotation element value byte 0x%02x\n", valueType);
+ LOGE("Bad annotation element value byte 0x%02x", valueType);
assert(false);
return false;
}
@@ -1146,7 +1146,7 @@ static Object* getAnnotationValue(const ClassObject* clazz,
/* find the annotation */
ptr = searchEncodedAnnotation(clazz, pAnnoItem->annotation, annoName);
if (ptr == NULL) {
- LOGW("%s annotation lacks '%s' member\n", debugAnnoName, annoName);
+ LOGW("%s annotation lacks '%s' member", debugAnnoName, annoName);
return GAV_FAILED;
}
@@ -1155,7 +1155,7 @@ static Object* getAnnotationValue(const ClassObject* clazz,
/* make sure it has the expected format */
if (avalue.type != expectedType) {
- LOGW("%s %s has wrong type (0x%02x, expected 0x%02x)\n",
+ LOGW("%s %s has wrong type (0x%02x, expected 0x%02x)",
debugAnnoName, annoName, avalue.type, expectedType);
return GAV_FAILED;
}
@@ -1412,18 +1412,18 @@ ClassObject* dvmGetEnclosingClass(const ClassObject* clazz)
const u1* ptr;
ptr = searchEncodedAnnotation(clazz, pAnnoItem->annotation, "value");
if (ptr == NULL) {
- LOGW("EnclosingMethod annotation lacks 'value' member\n");
+ LOGW("EnclosingMethod annotation lacks 'value' member");
return NULL;
}
/* parse it, verify the type */
AnnotationValue avalue;
if (!processAnnotationValue(clazz, &ptr, &avalue, kAllRaw)) {
- LOGW("EnclosingMethod parse failed\n");
+ LOGW("EnclosingMethod parse failed");
return NULL;
}
if (avalue.type != kDexAnnotationMethod) {
- LOGW("EnclosingMethod value has wrong type (0x%02x, expected 0x%02x)\n",
+ LOGW("EnclosingMethod value has wrong type (0x%02x, expected 0x%02x)",
avalue.type, kDexAnnotationMethod);
return NULL;
}
@@ -1469,14 +1469,14 @@ bool dvmGetInnerClass(const ClassObject* clazz, StringObject** pName,
const u1* ptr;
ptr = searchEncodedAnnotation(clazz, pAnnoItem->annotation, "name");
if (ptr == NULL) {
- LOGW("InnerClass annotation lacks 'name' member\n");
+ LOGW("InnerClass annotation lacks 'name' member");
return false;
}
/* parse it into an Object */
AnnotationValue avalue;
if (!processAnnotationValue(clazz, &ptr, &avalue, kAllObjects)) {
- LOGD("processAnnotationValue failed on InnerClass member 'name'\n");
+ LOGD("processAnnotationValue failed on InnerClass member 'name'");
return false;
}
@@ -1484,7 +1484,7 @@ bool dvmGetInnerClass(const ClassObject* clazz, StringObject** pName,
if (avalue.type != kDexAnnotationNull &&
avalue.type != kDexAnnotationString)
{
- LOGW("InnerClass name has bad type (0x%02x, expected STRING or NULL)\n",
+ LOGW("InnerClass name has bad type (0x%02x, expected STRING or NULL)",
avalue.type);
return false;
}
@@ -1494,17 +1494,17 @@ bool dvmGetInnerClass(const ClassObject* clazz, StringObject** pName,
ptr = searchEncodedAnnotation(clazz, pAnnoItem->annotation, "accessFlags");
if (ptr == NULL) {
- LOGW("InnerClass annotation lacks 'accessFlags' member\n");
+ LOGW("InnerClass annotation lacks 'accessFlags' member");
return false;
}
/* parse it, verify the type */
if (!processAnnotationValue(clazz, &ptr, &avalue, kAllRaw)) {
- LOGW("InnerClass accessFlags parse failed\n");
+ LOGW("InnerClass accessFlags parse failed");
return false;
}
if (avalue.type != kDexAnnotationInt) {
- LOGW("InnerClass value has wrong type (0x%02x, expected 0x%02x)\n",
+ LOGW("InnerClass value has wrong type (0x%02x, expected 0x%02x)",
avalue.type, kDexAnnotationInt);
return false;
}
@@ -1616,7 +1616,7 @@ static u4 getMethodIdx(const Method* method)
if (hi < lo) {
/* this should be impossible -- the method came out of this DEX */
char* desc = dexProtoCopyMethodDescriptor(&method->prototype);
- LOGE("Unable to find method %s.%s %s in DEX file!\n",
+ LOGE("Unable to find method %s.%s %s in DEX file!",
method->clazz->descriptor, method->name, desc);
free(desc);
dvmAbort();
@@ -1833,11 +1833,11 @@ Object* dvmGetAnnotationDefaultValue(const Method* method)
const u1* ptr;
ptr = searchEncodedAnnotation(clazz, pAnnoItem->annotation, "value");
if (ptr == NULL) {
- LOGW("AnnotationDefault annotation lacks 'value'\n");
+ LOGW("AnnotationDefault annotation lacks 'value'");
return NULL;
}
if ((*ptr & kDexAnnotationValueTypeMask) != kDexAnnotationAnnotation) {
- LOGW("AnnotationDefault value has wrong type (0x%02x)\n",
+ LOGW("AnnotationDefault value has wrong type (0x%02x)",
*ptr & kDexAnnotationValueTypeMask);
return NULL;
}
@@ -1855,7 +1855,7 @@ Object* dvmGetAnnotationDefaultValue(const Method* method)
/* got it, pull it out */
AnnotationValue avalue;
if (!processAnnotationValue(clazz, &ptr, &avalue, kAllObjects)) {
- LOGD("processAnnotationValue failed on default for '%s'\n",
+ LOGD("processAnnotationValue failed on default for '%s'",
method->name);
return NULL;
}
@@ -1925,7 +1925,7 @@ static u4 getFieldIdx(const Field* field)
if (hi < lo) {
/* this should be impossible -- the field came out of this DEX */
- LOGE("Unable to find field %s.%s %s in DEX file!\n",
+ LOGE("Unable to find field %s.%s %s in DEX file!",
field->clazz->descriptor, field->name, field->signature);
dvmAbort();
}
@@ -2076,7 +2076,7 @@ static ArrayObject* processAnnotationSetRefList(const ClassObject* clazz,
annoArrayArray = dvmAllocArrayByClass(
gDvm.classJavaLangAnnotationAnnotationArrayArray, count, ALLOC_DEFAULT);
if (annoArrayArray == NULL) {
- LOGW("annotation set ref array alloc failed\n");
+ LOGW("annotation set ref array alloc failed");
goto bail;
}
@@ -2092,7 +2092,7 @@ static ArrayObject* processAnnotationSetRefList(const ClassObject* clazz,
pAnnoSet,
kDexVisibilityRuntime);
if (annoSet == NULL) {
- LOGW("processAnnotationSet failed\n");
+ LOGW("processAnnotationSet failed");
annoArrayArray = NULL;
goto bail;
}
diff --git a/vm/reflect/Proxy.cpp b/vm/reflect/Proxy.cpp
index 52eebab46..f23dd75fc 100644
--- a/vm/reflect/Proxy.cpp
+++ b/vm/reflect/Proxy.cpp
@@ -75,7 +75,7 @@ ClassObject* dvmGenerateProxyClass(StringObject* str, ArrayObject* interfaces,
return NULL;
}
- LOGV("+++ Generate proxy class '%s' %p from %d interface classes\n",
+ LOGV("+++ Generate proxy class '%s' %p from %d interface classes",
nameStr, loader, interfaces->length);
@@ -190,7 +190,7 @@ ClassObject* dvmGenerateProxyClass(StringObject* str, ArrayObject* interfaces,
*/
newClass->status = CLASS_LOADED;
if (!dvmLinkClass(newClass)) {
- LOGD("Proxy class link failed\n");
+ LOGD("Proxy class link failed");
goto bail;
}
@@ -200,7 +200,7 @@ ClassObject* dvmGenerateProxyClass(StringObject* str, ArrayObject* interfaces,
* with a duplicate name.
*/
if (!dvmAddClassToHash(newClass)) {
- LOGE("ERROR: attempted to generate %s more than once\n",
+ LOGE("ERROR: attempted to generate %s more than once",
newClass->descriptor);
goto bail;
}
@@ -258,7 +258,7 @@ static bool gatherMethods(ArrayObject* interfaces, Method*** pMethods,
for (i = 0; i < numInterfaces; i++, classes++) {
ClassObject* clazz = *classes;
- LOGVV("--- %s virtualMethodCount=%d\n",
+ LOGVV("--- %s virtualMethodCount=%d",
clazz->descriptor, clazz->virtualMethodCount);
maxCount += clazz->virtualMethodCount;
@@ -266,7 +266,7 @@ static bool gatherMethods(ArrayObject* interfaces, Method*** pMethods,
for (j = 0; j < clazz->iftableCount; j++) {
ClassObject* iclass = clazz->iftable[j].clazz;
- LOGVV("--- +%s %d\n",
+ LOGVV("--- +%s %d",
iclass->descriptor, iclass->virtualMethodCount);
maxCount += iclass->virtualMethodCount;
}
@@ -329,9 +329,9 @@ static bool gatherMethods(ArrayObject* interfaces, Method*** pMethods,
if (actualCount < 0)
goto bail;
- //LOGI("gathered methods:\n");
+ //LOGI("gathered methods:");
//for (i = 0; i < actualCount; i++) {
- // LOGI(" %d: %s.%s\n",
+ // LOGI(" %d: %s.%s",
// i, methods[i]->clazz->descriptor, methods[i]->name);
//}
@@ -419,7 +419,7 @@ static int copyWithoutDuplicates(Method** allMethods, int allCount,
* type or void, the types must match exactly, or we throw
* an exception now.
*/
- LOGV("MATCH on %s.%s and %s.%s\n",
+ LOGV("MATCH on %s.%s and %s.%s",
allMethods[i]->clazz->descriptor, allMethods[i]->name,
allMethods[j]->clazz->descriptor, allMethods[j]->name);
dupe = true;
@@ -437,7 +437,7 @@ static int copyWithoutDuplicates(Method** allMethods, int allCount,
*/
if (dupe) {
if (best) {
- LOGV("BEST %d %s.%s -> %d\n", i,
+ LOGV("BEST %d %s.%s -> %d", i,
allMethods[i]->clazz->descriptor, allMethods[i]->name,
outCount);
@@ -458,7 +458,7 @@ static int copyWithoutDuplicates(Method** allMethods, int allCount,
if (dvmCompareMethodNamesAndParameterProtos(allMethods[i],
allMethods[j]) == 0)
{
- LOGV("DEL %d %s.%s\n", j,
+ LOGV("DEL %d %s.%s", j,
allMethods[j]->clazz->descriptor,
allMethods[j]->name);
@@ -492,7 +492,7 @@ static int copyWithoutDuplicates(Method** allMethods, int allCount,
gDvm.classJavaLangClassArray, commonCount,
ALLOC_DEFAULT);
if (throwArray == NULL) {
- LOGE("common-throw array alloc failed\n");
+ LOGE("common-throw array alloc failed");
return -1;
}
@@ -514,13 +514,13 @@ static int copyWithoutDuplicates(Method** allMethods, int allCount,
dvmPointerSetFree(commonThrows);
} else {
- LOGV("BEST not %d\n", i);
+ LOGV("BEST not %d", i);
}
} else {
/*
* Singleton. Copy the entry and NULL it out.
*/
- LOGV("COPY singleton %d %s.%s -> %d\n", i,
+ LOGV("COPY singleton %d %s.%s -> %d", i,
allMethods[i]->clazz->descriptor, allMethods[i]->name,
outCount);
@@ -544,7 +544,7 @@ static int copyWithoutDuplicates(Method** allMethods, int allCount,
*/
for (i = 0; i < allCount; i++) {
if (allMethods[i] != NULL) {
- LOGV("BAD DUPE: %d %s.%s\n", i,
+ LOGV("BAD DUPE: %d %s.%s", i,
allMethods[i]->clazz->descriptor, allMethods[i]->name);
dvmThrowIllegalArgumentException(
"incompatible return types in proxied interfaces");
@@ -893,11 +893,11 @@ static void proxyInvoker(const u4* args, JValue* pResult,
invoke = dvmFindVirtualMethodHierByDescriptor(handler->clazz, "invoke",
"(Ljava/lang/Object;Ljava/lang/reflect/Method;[Ljava/lang/Object;)Ljava/lang/Object;");
if (invoke == NULL) {
- LOGE("Unable to find invoke()\n");
+ LOGE("Unable to find invoke()");
dvmAbort();
}
- LOGV("invoke: %s.%s, this=%p, handler=%s\n",
+ LOGV("invoke: %s.%s, this=%p, handler=%s",
method->clazz->descriptor, method->name,
thisObj, handler->clazz->descriptor);
@@ -925,12 +925,12 @@ static void proxyInvoker(const u4* args, JValue* pResult,
returnType = dvmGetBoxedReturnType(method);
if (returnType == NULL) {
char* desc = dexProtoCopyMethodDescriptor(&method->prototype);
- LOGE("Could not determine return type for '%s'\n", desc);
+ LOGE("Could not determine return type for '%s'", desc);
free(desc);
assert(dvmCheckException(self));
goto bail;
}
- LOGV(" return type will be %s\n", returnType->descriptor);
+ LOGV(" return type will be %s", returnType->descriptor);
/*
* Convert "args" array into Object[] array, using the method
@@ -968,7 +968,7 @@ static void proxyInvoker(const u4* args, JValue* pResult,
* primitive type, throw a NullPointerException.
*/
if (returnType->primitiveType == PRIM_VOID) {
- LOGVV("+++ ignoring return to void\n");
+ LOGVV("+++ ignoring return to void");
} else if (invokeResult.l == NULL) {
if (dvmIsPrimitiveClass(returnType)) {
dvmThrowNullPointerException(
diff --git a/vm/reflect/Reflect.cpp b/vm/reflect/Reflect.cpp
index acd4c41f5..28086f4b1 100644
--- a/vm/reflect/Reflect.cpp
+++ b/vm/reflect/Reflect.cpp
@@ -49,12 +49,12 @@ bool dvmValidateBoxClasses()
clazz = dvmFindClassNoInit(*ccp, NULL);
if (clazz == NULL) {
- LOGE("Couldn't find '%s'\n", *ccp);
+ LOGE("Couldn't find '%s'", *ccp);
return false;
}
if (clazz->ifieldCount != 1) {
- LOGE("Found %d instance fields in '%s'\n",
+ LOGE("Found %d instance fields in '%s'",
clazz->ifieldCount, *ccp);
return false;
}
@@ -107,7 +107,7 @@ static ClassObject* convertSignaturePartToClass(char** pSignature,
}
if (clazz == NULL) {
- LOGW("Unable to match class for part: '%s'\n", *pSignature);
+ LOGW("Unable to match class for part: '%s'", *pSignature);
}
*pSignature = signature;
return clazz;
@@ -146,7 +146,7 @@ static ArrayObject* convertSignatureToClassArray(char** pSignature,
}
cp++;
}
- LOGVV("REFLECT found %d parameters in '%s'\n", count, *pSignature);
+ LOGVV("REFLECT found %d parameters in '%s'", count, *pSignature);
/* create an array to hold them */
ArrayObject* classArray = dvmAllocArrayByClass(gDvm.classJavaLangClassArray,
@@ -162,7 +162,7 @@ static ArrayObject* convertSignatureToClassArray(char** pSignature,
assert(dvmCheckException(dvmThreadSelf()));
return NULL;
}
- LOGVV("REFLECT %d: '%s'\n", i, clazz->descriptor);
+ LOGVV("REFLECT %d: '%s'", i, clazz->descriptor);
dvmSetObjectArrayElement(classArray, i, (Object *)clazz);
}
@@ -250,7 +250,7 @@ static Object* createFieldObject(Field* field, const ClassObject* clazz)
dvmCallMethod(dvmThreadSelf(), gDvm.methJavaLangReflectField_init,
fieldObj, &unused, clazz, type, nameObj, slot);
if (dvmCheckException(dvmThreadSelf())) {
- LOGD("Field class init threw exception\n");
+ LOGD("Field class init threw exception");
goto bail;
}
@@ -430,7 +430,7 @@ static Object* createConstructorObject(Method* meth)
dvmCallMethod(dvmThreadSelf(), gDvm.methJavaLangReflectConstructor_init,
consObj, &unused, meth->clazz, params, exceptions, slot);
if (dvmCheckException(dvmThreadSelf())) {
- LOGD("Constructor class init threw exception\n");
+ LOGD("Constructor class init threw exception");
goto bail;
}
@@ -583,7 +583,7 @@ Object* dvmCreateReflectMethodObject(const Method* meth)
methObj, &unused, meth->clazz, params, exceptions, returnType,
nameObj, slot);
if (dvmCheckException(dvmThreadSelf())) {
- LOGD("Method class init threw exception\n");
+ LOGD("Method class init threw exception");
goto bail;
}
@@ -984,7 +984,7 @@ int dvmConvertPrimitiveValue(PrimitiveType srcType,
case ItoF: *(float*) dstPtr = (float) (*(int*) srcPtr); return 1;
case JtoF: *(float*) dstPtr = (float) (*(long long*) srcPtr); return 1;
case bad: {
- LOGV("illegal primitive conversion: '%s' to '%s'\n",
+ LOGV("illegal primitive conversion: '%s' to '%s'",
dexGetPrimitiveTypeDescriptor(srcType),
dexGetPrimitiveTypeDescriptor(dstType));
return -1;
@@ -1013,7 +1013,7 @@ int dvmConvertArgument(DataObject* arg, ClassObject* type, s4* destPtr)
srcType = getBoxedType(arg);
if (srcType == PRIM_NOT) { // didn't pass a boxed primitive in
- LOGVV("conv arg: type '%s' not boxed primitive\n",
+ LOGVV("conv arg: type '%s' not boxed primitive",
arg->clazz->descriptor);
return -1;
}
@@ -1029,7 +1029,7 @@ int dvmConvertArgument(DataObject* arg, ClassObject* type, s4* destPtr)
*destPtr = (s4) arg;
retVal = 1;
} else {
- LOGVV("Arg %p (%s) not compatible with %s\n",
+ LOGVV("Arg %p (%s) not compatible with %s",
arg, arg->clazz->descriptor, type->descriptor);
retVal = -1;
}
@@ -1070,7 +1070,7 @@ DataObject* dvmBoxPrimitive(JValue value, ClassObject* returnType)
wrapperClass = dvmFindSystemClass(classDescriptor);
if (wrapperClass == NULL) {
- LOGW("Unable to find '%s'\n", classDescriptor);
+ LOGW("Unable to find '%s'", classDescriptor);
assert(dvmCheckException(dvmThreadSelf()));
return NULL;
}
@@ -1109,7 +1109,7 @@ bool dvmUnboxPrimitive(Object* value, ClassObject* returnType,
if (typeIndex == PRIM_NOT) {
if (value != NULL && !dvmInstanceof(value->clazz, returnType)) {
- LOGD("wrong object type: %s %s\n",
+ LOGD("wrong object type: %s %s",
value->clazz->descriptor, returnType->descriptor);
return false;
}
@@ -1129,7 +1129,7 @@ bool dvmUnboxPrimitive(Object* value, ClassObject* returnType,
if (dvmConvertPrimitiveValue(valueIndex, typeIndex,
(s4*) ((DataObject*)value)->instanceData, (s4*)pResult) < 0)
{
- LOGV("Prim conversion failed\n");
+ LOGV("Prim conversion failed");
return false;
}
@@ -1165,7 +1165,7 @@ ClassObject* dvmGetBoxedReturnType(const Method* meth)
default: {
/* should not have passed verification */
char* desc = dexProtoCopyMethodDescriptor(&meth->prototype);
- LOGE("Bad return type in signature '%s'\n", desc);
+ LOGE("Bad return type in signature '%s'", desc);
free(desc);
dvmThrowInternalError(NULL);
return NULL;
diff --git a/vm/test/TestHash.cpp b/vm/test/TestHash.cpp
index 9eabbb6e9..d03fe494e 100644
--- a/vm/test/TestHash.cpp
+++ b/vm/test/TestHash.cpp
@@ -44,7 +44,7 @@ static void dumpForeach(HashTable* pTab)
//printf("Print from foreach:\n");
dvmHashForeach(pTab, printFunc, &count);
if (count != kNumTestEntries) {
- LOGE("TestHash foreach test failed\n");
+ LOGE("TestHash foreach test failed");
assert(false);
}
}
@@ -67,7 +67,7 @@ static void dumpIterator(HashTable* pTab)
count++;
}
if (count != kNumTestEntries) {
- LOGE("TestHash iterator test failed\n");
+ LOGE("TestHash iterator test failed");
assert(false);
}
}
@@ -83,7 +83,7 @@ bool dvmTestHash()
u4 hash;
int i;
- LOGV("TestHash BEGIN\n");
+ LOGV("TestHash BEGIN");
pTab = dvmHashTableCreate(dvmHashSize(12), free);
if (pTab == NULL)
@@ -108,7 +108,7 @@ bool dvmTestHash()
str = (const char*) dvmHashTableLookup(pTab, hash, tmpStr,
(HashCompareFunc) strcmp, false);
if (str == NULL) {
- LOGE("TestHash: failure: could not find '%s'\n", tmpStr);
+ LOGE("TestHash: failure: could not find '%s'", tmpStr);
/* return false */
}
}
@@ -121,7 +121,7 @@ bool dvmTestHash()
if (str == NULL) {
/* good */
} else {
- LOGE("TestHash found nonexistent string (improper add?)\n");
+ LOGE("TestHash found nonexistent string (improper add?)");
}
dumpForeach(pTab);
@@ -150,7 +150,7 @@ bool dvmTestHash()
/* remove the first one */
if (!dvmHashTableRemove(pTab, hash, (void*)str1))
- LOGE("TestHash failed to delete item\n");
+ LOGE("TestHash failed to delete item");
else
free((void*)str1); // "Remove" doesn't call the free func
@@ -163,7 +163,7 @@ bool dvmTestHash()
count++;
}
if (count != 1) {
- LOGE("TestHash wrong number of entries (%d)\n", count);
+ LOGE("TestHash wrong number of entries (%d)", count);
}
/* see if we can find them */
@@ -174,7 +174,7 @@ bool dvmTestHash()
str = (const char*) dvmHashTableLookup(pTab, hash, (void*)"two",
(HashCompareFunc) strcmp,false);
if (str == NULL)
- LOGE("TestHash entry vanished\n");
+ LOGE("TestHash entry vanished");
/* force a table realloc to exercise tombstone removal */
for (i = 0; i < 20; i++) {
@@ -185,7 +185,7 @@ bool dvmTestHash()
}
dvmHashTableFree(pTab);
- LOGV("TestHash END\n");
+ LOGV("TestHash END");
return true;
}
diff --git a/vm/test/TestIndirectRefTable.cpp b/vm/test/TestIndirectRefTable.cpp
index a72e2b017..de68c20a5 100644
--- a/vm/test/TestIndirectRefTable.cpp
+++ b/vm/test/TestIndirectRefTable.cpp
@@ -50,7 +50,7 @@ static bool basicTest()
iref0 = (IndirectRef) 0x11110;
if (dvmRemoveFromIndirectRefTable(&irt, cookie, iref0)) {
- LOGE("unexpectedly successful removal\n");
+ LOGE("unexpectedly successful removal");
goto bail;
}
@@ -62,7 +62,7 @@ static bool basicTest()
iref1 = dvmAddToIndirectRefTable(&irt, cookie, obj1);
iref2 = dvmAddToIndirectRefTable(&irt, cookie, obj2);
if (iref0 == NULL || iref1 == NULL || iref2 == NULL) {
- LOGE("trivial add1 failed\n");
+ LOGE("trivial add1 failed");
goto bail;
}
@@ -70,7 +70,7 @@ static bool basicTest()
dvmGetFromIndirectRefTable(&irt, iref1) != obj1 ||
dvmGetFromIndirectRefTable(&irt, iref2) != obj2)
{
- LOGE("objects don't match expected values %p %p %p vs. %p %p %p\n",
+ LOGE("objects don't match expected values %p %p %p vs. %p %p %p",
dvmGetFromIndirectRefTable(&irt, iref0),
dvmGetFromIndirectRefTable(&irt, iref1),
dvmGetFromIndirectRefTable(&irt, iref2),
@@ -84,19 +84,19 @@ static bool basicTest()
!dvmRemoveFromIndirectRefTable(&irt, cookie, iref1) ||
!dvmRemoveFromIndirectRefTable(&irt, cookie, iref2))
{
- LOGE("fifo deletion failed\n");
+ LOGE("fifo deletion failed");
goto bail;
}
/* table should be empty now */
if (dvmIndirectRefTableEntries(&irt) != 0) {
- LOGE("fifo del not empty\n");
+ LOGE("fifo del not empty");
goto bail;
}
/* get invalid entry (off the end of the list) */
if (dvmGetFromIndirectRefTable(&irt, iref0) != kInvalidIndirectRefObject) {
- LOGE("stale entry get succeeded unexpectedly\n");
+ LOGE("stale entry get succeeded unexpectedly");
goto bail;
}
@@ -108,7 +108,7 @@ static bool basicTest()
iref1 = dvmAddToIndirectRefTable(&irt, cookie, obj1);
iref2 = dvmAddToIndirectRefTable(&irt, cookie, obj2);
if (iref0 == NULL || iref1 == NULL || iref2 == NULL) {
- LOGE("trivial add2 failed\n");
+ LOGE("trivial add2 failed");
goto bail;
}
@@ -116,13 +116,13 @@ static bool basicTest()
!dvmRemoveFromIndirectRefTable(&irt, cookie, iref1) ||
!dvmRemoveFromIndirectRefTable(&irt, cookie, iref0))
{
- LOGE("lifo deletion failed\n");
+ LOGE("lifo deletion failed");
goto bail;
}
/* table should be empty now */
if (dvmIndirectRefTableEntries(&irt) != 0) {
- LOGE("lifo del not empty\n");
+ LOGE("lifo del not empty");
goto bail;
}
@@ -135,12 +135,12 @@ static bool basicTest()
iref1 = dvmAddToIndirectRefTable(&irt, cookie, obj1);
iref2 = dvmAddToIndirectRefTable(&irt, cookie, obj2);
if (iref0 == NULL || iref1 == NULL || iref2 == NULL) {
- LOGE("trivial add3 failed\n");
+ LOGE("trivial add3 failed");
goto bail;
}
if (dvmIndirectRefTableEntries(&irt) != 3) {
- LOGE("expected 3 entries, found %d\n",
+ LOGE("expected 3 entries, found %d",
dvmIndirectRefTableEntries(&irt));
goto bail;
}
@@ -148,26 +148,26 @@ static bool basicTest()
if (!dvmRemoveFromIndirectRefTable(&irt, cookie, iref1) ||
dvmRemoveFromIndirectRefTable(&irt, cookie, iref1))
{
- LOGE("unorder deletion1 failed\n");
+ LOGE("unorder deletion1 failed");
goto bail;
}
/* get invalid entry (from hole) */
if (dvmGetFromIndirectRefTable(&irt, iref1) != kInvalidIndirectRefObject) {
- LOGE("hole get succeeded unexpectedly\n");
+ LOGE("hole get succeeded unexpectedly");
goto bail;
}
if (!dvmRemoveFromIndirectRefTable(&irt, cookie, iref2) ||
!dvmRemoveFromIndirectRefTable(&irt, cookie, iref0))
{
- LOGE("unorder deletion2 failed\n");
+ LOGE("unorder deletion2 failed");
goto bail;
}
/* table should be empty now */
if (dvmIndirectRefTableEntries(&irt) != 0) {
- LOGE("unorder del not empty\n");
+ LOGE("unorder del not empty");
goto bail;
}
@@ -182,36 +182,36 @@ static bool basicTest()
iref2 = dvmAddToIndirectRefTable(&irt, cookie, obj2);
iref3 = dvmAddToIndirectRefTable(&irt, cookie, obj3);
if (iref0 == NULL || iref1 == NULL || iref2 == NULL || iref3 == NULL) {
- LOGE("trivial add4 failed\n");
+ LOGE("trivial add4 failed");
goto bail;
}
if (!dvmRemoveFromIndirectRefTable(&irt, cookie, iref1)) {
- LOGE("remove 1 of 4 failed\n");
+ LOGE("remove 1 of 4 failed");
goto bail;
}
iref1 = dvmAddToIndirectRefTable(&irt, cookie, obj1);
if (dvmIndirectRefTableEntries(&irt) != 4) {
- LOGE("hole not filled\n");
+ LOGE("hole not filled");
goto bail;
}
if (!dvmRemoveFromIndirectRefTable(&irt, cookie, iref1) ||
!dvmRemoveFromIndirectRefTable(&irt, cookie, iref3))
{
- LOGE("remove 1/3 failed\n");
+ LOGE("remove 1/3 failed");
goto bail;
}
if (dvmIndirectRefTableEntries(&irt) != 3) {
- LOGE("should be 3 after two deletions\n");
+ LOGE("should be 3 after two deletions");
goto bail;
}
if (!dvmRemoveFromIndirectRefTable(&irt, cookie, iref2) ||
!dvmRemoveFromIndirectRefTable(&irt, cookie, iref0))
{
- LOGE("remove 2/0 failed\n");
+ LOGE("remove 2/0 failed");
goto bail;
}
if (dvmIndirectRefTableEntries(&irt) != 0) {
- LOGE("not empty after split remove\n");
+ LOGE("not empty after split remove");
goto bail;
}
@@ -225,15 +225,15 @@ static bool basicTest()
dvmRemoveFromIndirectRefTable(&irt, cookie, iref0);
iref1 = dvmAddToIndirectRefTable(&irt, cookie, obj1);
if (dvmRemoveFromIndirectRefTable(&irt, cookie, iref0)) {
- LOGE("mismatched del succeeded (%p vs %p)\n", iref0, iref1);
+ LOGE("mismatched del succeeded (%p vs %p)", iref0, iref1);
goto bail;
}
if (!dvmRemoveFromIndirectRefTable(&irt, cookie, iref1)) {
- LOGE("switched del failed\n");
+ LOGE("switched del failed");
goto bail;
}
if (dvmIndirectRefTableEntries(&irt) != 0) {
- LOGE("switching del not empty\n");
+ LOGE("switching del not empty");
goto bail;
}
@@ -247,16 +247,16 @@ static bool basicTest()
if (iref0 != iref1) {
/* try 0, should not work */
if (dvmRemoveFromIndirectRefTable(&irt, cookie, iref0)) {
- LOGE("temporal del succeeded (%p vs %p)\n", iref0, iref1);
+ LOGE("temporal del succeeded (%p vs %p)", iref0, iref1);
goto bail;
}
}
if (!dvmRemoveFromIndirectRefTable(&irt, cookie, iref1)) {
- LOGE("temporal cleanup failed\n");
+ LOGE("temporal cleanup failed");
goto bail;
}
if (dvmIndirectRefTableEntries(&irt) != 0) {
- LOGE("temporal del not empty\n");
+ LOGE("temporal del not empty");
goto bail;
}
@@ -268,37 +268,37 @@ static bool basicTest()
for (i = 0; i < kTableMax; i++) {
manyRefs[i] = dvmAddToIndirectRefTable(&irt, cookie, obj0);
if (manyRefs[i] == NULL) {
- LOGE("Failed adding %d of %d\n", i, kTableMax);
+ LOGE("Failed adding %d of %d", i, kTableMax);
goto bail;
}
}
if (dvmAddToIndirectRefTable(&irt, cookie, obj0) != NULL) {
- LOGE("Table overflow succeeded\n");
+ LOGE("Table overflow succeeded");
goto bail;
}
if (dvmIndirectRefTableEntries(&irt) != (size_t)kTableMax) {
- LOGE("Expected %d entries, found %d\n",
+ LOGE("Expected %d entries, found %d",
kTableMax, dvmIndirectRefTableEntries(&irt));
goto bail;
}
for (i = 0; i < kTableMax-1; i++) {
if (!dvmRemoveFromIndirectRefTable(&irt, cookie, manyRefs[i])) {
- LOGE("multi-remove failed at %d\n", i);
+ LOGE("multi-remove failed at %d", i);
goto bail;
}
}
/* because of removal order, should have 20 entries, 19 of them holes */
if (dvmIndirectRefTableEntries(&irt) != (size_t)kTableMax) {
- LOGE("Expected %d entries (with holes), found %d\n",
+ LOGE("Expected %d entries (with holes), found %d",
kTableMax, dvmIndirectRefTableEntries(&irt));
goto bail;
}
if (!dvmRemoveFromIndirectRefTable(&irt, cookie, manyRefs[kTableMax-1])) {
- LOGE("multi-remove final failed\n");
+ LOGE("multi-remove final failed");
goto bail;
}
if (dvmIndirectRefTableEntries(&irt) != 0) {
- LOGE("multi-del not empty\n");
+ LOGE("multi-del not empty");
goto bail;
}
@@ -351,17 +351,17 @@ static bool segmentTest()
if (dvmRemoveFromIndirectRefTable(&irt, cookie, iref0) ||
dvmRemoveFromIndirectRefTable(&irt, cookie, iref1))
{
- LOGE("removed values from earlier segment\n");
+ LOGE("removed values from earlier segment");
goto bail;
}
if (!dvmRemoveFromIndirectRefTable(&irt, cookie, iref2) ||
!dvmRemoveFromIndirectRefTable(&irt, cookie, iref3))
{
- LOGE("unable to remove values from current segment\n");
+ LOGE("unable to remove values from current segment");
goto bail;
}
if (dvmIndirectRefTableEntries(&irt) != 2) {
- LOGE("wrong total entries\n");
+ LOGE("wrong total entries");
goto bail;
}
dvmPopIndirectRefTableSegment(&irt, segmentState[1]);
@@ -369,11 +369,11 @@ static bool segmentTest()
if (!dvmRemoveFromIndirectRefTable(&irt, cookie, iref0) ||
!dvmRemoveFromIndirectRefTable(&irt, cookie, iref1))
{
- LOGE("unable to remove values from first segment\n");
+ LOGE("unable to remove values from first segment");
goto bail;
}
if (dvmIndirectRefTableEntries(&irt) != 0) {
- LOGE("basic push/pop not empty\n");
+ LOGE("basic push/pop not empty");
goto bail;
}
@@ -392,12 +392,12 @@ static bool segmentTest()
dvmPopIndirectRefTableSegment(&irt, segmentState[1]);
cookie = segmentState[0];
if (dvmIndirectRefTableEntries(&irt) != 2) {
- LOGE("wrong total entries after pop\n");
+ LOGE("wrong total entries after pop");
goto bail;
}
dvmRemoveFromIndirectRefTable(&irt, cookie, iref1);
if (dvmIndirectRefTableEntries(&irt) != 0) {
- LOGE("not back to zero after pop + del\n");
+ LOGE("not back to zero after pop + del");
goto bail;
}
@@ -420,7 +420,7 @@ static bool segmentTest()
dvmGetFromIndirectRefTable(&irt, iref2) != obj2 ||
dvmGetFromIndirectRefTable(&irt, iref3) != obj3)
{
- LOGE("Unable to retrieve all multiseg objects\n");
+ LOGE("Unable to retrieve all multiseg objects");
goto bail;
}
@@ -433,13 +433,13 @@ static bool segmentTest()
dvmRemoveFromIndirectRefTable(&irt, cookie, iref3);
if (dvmRemoveFromIndirectRefTable(&irt, cookie, iref2)) {
- LOGE("multiseg del2 worked\n");
+ LOGE("multiseg del2 worked");
goto bail;
}
dvmPopIndirectRefTableSegment(&irt, segmentState[3]);
cookie = segmentState[2];
if (!dvmRemoveFromIndirectRefTable(&irt, cookie, iref2)) {
- LOGE("multiseg del2b failed (cookie=0x%08x ref=%p)\n", cookie, iref2);
+ LOGE("multiseg del2b failed (cookie=0x%08x ref=%p)", cookie, iref2);
goto bail;
}
iref2 = dvmAddToIndirectRefTable(&irt, cookie, obj2);
@@ -449,13 +449,13 @@ static bool segmentTest()
cookie = segmentState[0];
if (dvmIndirectRefTableEntries(&irt) != 2) {
- LOGE("Unexpected entry count in multiseg\n");
+ LOGE("Unexpected entry count in multiseg");
goto bail;
}
dvmRemoveFromIndirectRefTable(&irt, cookie, iref0);
dvmRemoveFromIndirectRefTable(&irt, cookie, iref1);
if (dvmIndirectRefTableEntries(&irt) != 0) {
- LOGE("Unexpected entry count at multiseg end\n");
+ LOGE("Unexpected entry count at multiseg end");
goto bail;
}
@@ -474,11 +474,11 @@ bail:
bool dvmTestIndirectRefTable()
{
if (!basicTest()) {
- LOGE("IRT basic test failed\n");
+ LOGE("IRT basic test failed");
return false;
}
if (!segmentTest()) {
- LOGE("IRT segment test failed\n");
+ LOGE("IRT segment test failed");
return false;
}