summaryrefslogtreecommitdiffstats
path: root/libdex
diff options
context:
space:
mode:
Diffstat (limited to 'libdex')
-rw-r--r--libdex/DexFile.cpp2
-rw-r--r--libdex/DexSwapVerify.cpp10
-rw-r--r--libdex/InstrUtils.cpp6
-rw-r--r--libdex/SysUtil.cpp14
-rw-r--r--libdex/ZipArchive.cpp48
5 files changed, 40 insertions, 40 deletions
diff --git a/libdex/DexFile.cpp b/libdex/DexFile.cpp
index 52bc500dd..2f6fd4036 100644
--- a/libdex/DexFile.cpp
+++ b/libdex/DexFile.cpp
@@ -195,7 +195,7 @@ static void classLookupAdd(DexFile* pDexFile, DexClassLookup* pLookup,
probes++;
}
//if (probes > 1)
- // LOGW("classLookupAdd: probes=%d", probes);
+ // ALOGW("classLookupAdd: probes=%d", probes);
pLookup->table[idx].classDescriptorHash = hash;
pLookup->table[idx].classDescriptorOffset = stringOff;
diff --git a/libdex/DexSwapVerify.cpp b/libdex/DexSwapVerify.cpp
index 0a742b762..18445b25e 100644
--- a/libdex/DexSwapVerify.cpp
+++ b/libdex/DexSwapVerify.cpp
@@ -114,7 +114,7 @@ static inline bool checkPtrRange(const CheckState* state,
const void* fileEnd = state->fileEnd;
if ((start < fileStart) || (start > fileEnd)
|| (end < start) || (end > fileEnd)) {
- LOGW("Bad offset range for %s: %#x..%#x", label,
+ ALOGW("Bad offset range for %s: %#x..%#x", label,
fileOffset(state, start), fileOffset(state, end));
return false;
}
@@ -187,7 +187,7 @@ static inline bool checkPtrRange(const CheckState* state,
*/
#define CHECK_INDEX(_field, _limit) { \
if ((_field) >= (_limit)) { \
- LOGW("Bad index: %s(%u) > %s(%u)", \
+ ALOGW("Bad index: %s(%u) > %s(%u)", \
#_field, (u4)(_field), #_limit, (u4)(_limit)); \
return 0; \
} \
@@ -206,7 +206,7 @@ static inline bool checkPtrRange(const CheckState* state,
*/
#define CHECK_INDEX_OR_NOINDEX(_field, _limit) { \
if ((_field) != kDexNoIndex && (_field) >= (_limit)) { \
- LOGW("Bad index: %s(%u) > %s(%u)", \
+ ALOGW("Bad index: %s(%u) > %s(%u)", \
#_field, (u4)(_field), #_limit, (u4)(_limit)); \
return 0; \
} \
@@ -2839,7 +2839,7 @@ int dexSwapAndVerify(u1* addr, int len)
LOGE("ERROR: Bad length: expected %d, got %d", expectedLen, len);
okay = false;
} else if (len != expectedLen) {
- LOGW("WARNING: Odd length: expected %d, got %d", expectedLen,
+ ALOGW("WARNING: Odd length: expected %d, got %d", expectedLen,
len);
// keep going
}
@@ -2893,7 +2893,7 @@ int dexSwapAndVerify(u1* addr, int len)
pHeader->headerSize, (int) sizeof(DexHeader));
okay = false;
} else if (pHeader->headerSize > sizeof(DexHeader)) {
- LOGW("WARNING: Large header size %d, struct %d",
+ ALOGW("WARNING: Large header size %d, struct %d",
pHeader->headerSize, (int) sizeof(DexHeader));
// keep going?
}
diff --git a/libdex/InstrUtils.cpp b/libdex/InstrUtils.cpp
index 9dfe64c8e..be343f0f2 100644
--- a/libdex/InstrUtils.cpp
+++ b/libdex/InstrUtils.cpp
@@ -610,7 +610,7 @@ void dexDecodeInstruction(const u2* insns, DecodedInstruction* pDec)
case 5: {
if (format == kFmt35mi) {
/* A fifth arg is verboten for inline invokes. */
- LOGW("Invalid arg count in 35mi (5)");
+ ALOGW("Invalid arg count in 35mi (5)");
goto bail;
}
/*
@@ -626,7 +626,7 @@ void dexDecodeInstruction(const u2* insns, DecodedInstruction* pDec)
case 1: pDec->vC = pDec->arg[0] = regList & 0x0f; break;
case 0: break; // Valid, but no need to do anything.
default:
- LOGW("Invalid arg count in 35c/35ms/35mi (%d)", count);
+ ALOGW("Invalid arg count in 35c/35ms/35mi (%d)", count);
goto bail;
}
}
@@ -643,7 +643,7 @@ void dexDecodeInstruction(const u2* insns, DecodedInstruction* pDec)
pDec->vB_wide = FETCH_u4(1) | ((u8) FETCH_u4(3) << 32);
break;
default:
- LOGW("Can't decode unexpected format %d (op=%d)", format, opcode);
+ ALOGW("Can't decode unexpected format %d (op=%d)", format, opcode);
assert(false);
break;
}
diff --git a/libdex/SysUtil.cpp b/libdex/SysUtil.cpp
index 09e1ce12c..d3fac5ba5 100644
--- a/libdex/SysUtil.cpp
+++ b/libdex/SysUtil.cpp
@@ -46,7 +46,7 @@ static void* sysCreateAnonShmem(size_t length)
ptr = mmap(NULL, length, PROT_READ | PROT_WRITE,
MAP_SHARED | MAP_ANON, -1, 0);
if (ptr == MAP_FAILED) {
- LOGW("mmap(%d, RW, SHARED|ANON) failed: %s", (int) length,
+ ALOGW("mmap(%d, RW, SHARED|ANON) failed: %s", (int) length,
strerror(errno));
return NULL;
}
@@ -164,7 +164,7 @@ int sysFakeMapFile(int fd, MemMapping* pMap)
memPtr = malloc(length);
if (read(fd, memPtr, length) < 0) {
- LOGW("read(fd=%d, start=%d, length=%d) failed: %s", (int) length,
+ ALOGW("read(fd=%d, start=%d, length=%d) failed: %s", (int) length,
fd, (int) start, strerror(errno));
return -1;
}
@@ -197,7 +197,7 @@ int sysMapFileInShmemReadOnly(int fd, MemMapping* pMap)
memPtr = mmap(NULL, length, PROT_READ, MAP_FILE | MAP_SHARED, fd, start);
if (memPtr == MAP_FAILED) {
- LOGW("mmap(%d, RO, FILE|SHARED, %d, %d) failed: %s", (int) length,
+ ALOGW("mmap(%d, RO, FILE|SHARED, %d, %d) failed: %s", (int) length,
fd, (int) start, strerror(errno));
return -1;
}
@@ -237,7 +237,7 @@ int sysMapFileInShmemWritableReadOnly(int fd, MemMapping* pMap)
memPtr = mmap(NULL, length, PROT_READ | PROT_WRITE, MAP_FILE | MAP_PRIVATE,
fd, start);
if (memPtr == MAP_FAILED) {
- LOGW("mmap(%d, R/W, FILE|PRIVATE, %d, %d) failed: %s", (int) length,
+ ALOGW("mmap(%d, R/W, FILE|PRIVATE, %d, %d) failed: %s", (int) length,
fd, (int) start, strerror(errno));
return -1;
}
@@ -284,7 +284,7 @@ int sysMapFileSegmentInShmem(int fd, off_t start, size_t length,
memPtr = mmap(NULL, actualLength, PROT_READ, MAP_FILE | MAP_SHARED,
fd, actualStart);
if (memPtr == MAP_FAILED) {
- LOGW("mmap(%d, R, FILE|SHARED, %d, %d) failed: %s",
+ ALOGW("mmap(%d, R, FILE|SHARED, %d, %d) failed: %s",
(int) actualLength, fd, (int) actualStart, strerror(errno));
return -1;
}
@@ -358,7 +358,7 @@ void sysReleaseShmem(MemMapping* pMap)
return;
if (munmap(pMap->baseAddr, pMap->baseLength) < 0) {
- LOGW("munmap(%p, %d) failed: %s",
+ ALOGW("munmap(%p, %d) failed: %s",
pMap->baseAddr, (int)pMap->baseLength, strerror(errno));
} else {
ALOGV("munmap(%p, %d) succeeded", pMap->baseAddr, pMap->baseLength);
@@ -418,7 +418,7 @@ int sysCopyFileToFile(int outFd, int inFd, size_t count)
ssize_t actual = TEMP_FAILURE_RETRY(read(inFd, buf, getSize));
if (actual != (ssize_t) getSize) {
- LOGW("sysCopyFileToFile: copy read failed (%d vs %zd)",
+ ALOGW("sysCopyFileToFile: copy read failed (%d vs %zd)",
(int) actual, getSize);
return -1;
}
diff --git a/libdex/ZipArchive.cpp b/libdex/ZipArchive.cpp
index 75ee03123..f242f6447 100644
--- a/libdex/ZipArchive.cpp
+++ b/libdex/ZipArchive.cpp
@@ -80,7 +80,7 @@ static int entryToIndex(const ZipArchive* pArchive, const ZipEntry entry)
if (ent < 0 || ent >= pArchive->mHashTableSize ||
pArchive->mHashTable[ent].name == NULL)
{
- LOGW("Zip: invalid ZipEntry %p (%ld)", entry, ent);
+ ALOGW("Zip: invalid ZipEntry %p (%ld)", entry, ent);
return -1;
}
return ent;
@@ -147,12 +147,12 @@ static int mapCentralDirectory0(int fd, const char* debugFileName,
off_t searchStart = fileLength - readAmount;
if (lseek(fd, searchStart, SEEK_SET) != searchStart) {
- LOGW("Zip: seek %ld failed: %s", (long) searchStart, strerror(errno));
+ ALOGW("Zip: seek %ld failed: %s", (long) searchStart, strerror(errno));
return -1;
}
ssize_t actual = TEMP_FAILURE_RETRY(read(fd, scanBuf, readAmount));
if (actual != (ssize_t) readAmount) {
- LOGW("Zip: read %zd failed: %s", readAmount, strerror(errno));
+ ALOGW("Zip: read %zd failed: %s", readAmount, strerror(errno));
return -1;
}
@@ -188,12 +188,12 @@ static int mapCentralDirectory0(int fd, const char* debugFileName,
u4 dirOffset = get4LE(eocdPtr + kEOCDFileOffset);
if ((long long) dirOffset + (long long) dirSize > (long long) eocdOffset) {
- LOGW("Zip: bad offsets (dir %ld, size %u, eocd %ld)",
+ ALOGW("Zip: bad offsets (dir %ld, size %u, eocd %ld)",
(long) dirOffset, dirSize, (long) eocdOffset);
return -1;
}
if (numEntries == 0) {
- LOGW("Zip: empty archive?");
+ ALOGW("Zip: empty archive?");
return -1;
}
@@ -207,7 +207,7 @@ static int mapCentralDirectory0(int fd, const char* debugFileName,
if (sysMapFileSegmentInShmem(fd, dirOffset, dirSize,
&pArchive->mDirectoryMap) != 0)
{
- LOGW("Zip: cd map failed");
+ ALOGW("Zip: cd map failed");
return -1;
}
@@ -295,17 +295,17 @@ static int parseZipArchive(ZipArchive* pArchive)
int i;
for (i = 0; i < numEntries; i++) {
if (get4LE(ptr) != kCDESignature) {
- LOGW("Zip: missed a central dir sig (at %d)", i);
+ ALOGW("Zip: missed a central dir sig (at %d)", i);
goto bail;
}
if (ptr + kCDELen > cdPtr + cdLength) {
- LOGW("Zip: ran off the end (at %d)", i);
+ ALOGW("Zip: ran off the end (at %d)", i);
goto bail;
}
long localHdrOffset = (long) get4LE(ptr + kCDELocalOffset);
if (localHdrOffset >= pArchive->mDirectoryOffset) {
- LOGW("Zip: bad LFH offset %ld at entry %d", localHdrOffset, i);
+ ALOGW("Zip: bad LFH offset %ld at entry %d", localHdrOffset, i);
goto bail;
}
@@ -320,7 +320,7 @@ static int parseZipArchive(ZipArchive* pArchive)
ptr += kCDELen + fileNameLen + extraLen + commentLen;
if ((size_t)(ptr - cdPtr) > cdLength) {
- LOGW("Zip: bad CD advance (%d vs %zd) at entry %d",
+ ALOGW("Zip: bad CD advance (%d vs %zd) at entry %d",
(int) (ptr - cdPtr), cdLength, i);
goto bail;
}
@@ -454,7 +454,7 @@ ZipEntry dexZipFindEntry(const ZipArchive* pArchive, const char* entryName)
ZipEntry findEntryByIndex(ZipArchive* pArchive, int idx)
{
if (idx < 0 || idx >= pArchive->mNumEntries) {
- LOGW("Invalid index %d", idx);
+ ALOGW("Invalid index %d", idx);
return NULL;
}
@@ -531,24 +531,24 @@ int dexZipGetEntryInfo(const ZipArchive* pArchive, ZipEntry entry,
if (pOffset != NULL) {
long localHdrOffset = (long) get4LE(ptr + kCDELocalOffset);
if (localHdrOffset + kLFHLen >= cdOffset) {
- LOGW("Zip: bad local hdr offset in zip");
+ ALOGW("Zip: bad local hdr offset in zip");
return -1;
}
u1 lfhBuf[kLFHLen];
if (lseek(pArchive->mFd, localHdrOffset, SEEK_SET) != localHdrOffset) {
- LOGW("Zip: failed seeking to lfh at offset %ld", localHdrOffset);
+ ALOGW("Zip: failed seeking to lfh at offset %ld", localHdrOffset);
return -1;
}
ssize_t actual =
TEMP_FAILURE_RETRY(read(pArchive->mFd, lfhBuf, sizeof(lfhBuf)));
if (actual != sizeof(lfhBuf)) {
- LOGW("Zip: failed reading lfh from offset %ld", localHdrOffset);
+ ALOGW("Zip: failed reading lfh from offset %ld", localHdrOffset);
return -1;
}
if (get4LE(lfhBuf) != kLFHSignature) {
- LOGW("Zip: didn't find signature at start of lfh, offset=%ld",
+ ALOGW("Zip: didn't find signature at start of lfh, offset=%ld",
localHdrOffset);
return -1;
}
@@ -556,13 +556,13 @@ int dexZipGetEntryInfo(const ZipArchive* pArchive, ZipEntry entry,
off_t dataOffset = localHdrOffset + kLFHLen
+ get2LE(lfhBuf + kLFHNameLen) + get2LE(lfhBuf + kLFHExtraLen);
if (dataOffset >= cdOffset) {
- LOGW("Zip: bad data offset %ld in zip", (long) dataOffset);
+ ALOGW("Zip: bad data offset %ld in zip", (long) dataOffset);
return -1;
}
/* check lengths */
if ((off_t)(dataOffset + compLen) > cdOffset) {
- LOGW("Zip: bad compressed length in zip (%ld + %zd > %ld)",
+ ALOGW("Zip: bad compressed length in zip (%ld + %zd > %ld)",
(long) dataOffset, compLen, (long) cdOffset);
return -1;
}
@@ -570,7 +570,7 @@ int dexZipGetEntryInfo(const ZipArchive* pArchive, ZipEntry entry,
if (method == kCompressStored &&
(off_t)(dataOffset + uncompLen) > cdOffset)
{
- LOGW("Zip: bad uncompressed length in zip (%ld + %zd > %ld)",
+ ALOGW("Zip: bad uncompressed length in zip (%ld + %zd > %ld)",
(long) dataOffset, uncompLen, (long) cdOffset);
return -1;
}
@@ -619,7 +619,7 @@ static int inflateToFile(int outFd, int inFd, size_t uncompLen, size_t compLen)
LOGE("Installed zlib is not compatible with linked version (%s)",
ZLIB_VERSION);
} else {
- LOGW("Call to inflateInit2 failed (zerr=%d)", zerr);
+ ALOGW("Call to inflateInit2 failed (zerr=%d)", zerr);
}
goto bail;
}
@@ -634,7 +634,7 @@ static int inflateToFile(int outFd, int inFd, size_t uncompLen, size_t compLen)
ssize_t actual = TEMP_FAILURE_RETRY(read(inFd, readBuf, getSize));
if (actual != (ssize_t) getSize) {
- LOGW("Zip: inflate read failed (%d vs %zd)",
+ ALOGW("Zip: inflate read failed (%d vs %zd)",
(int)actual, getSize);
goto z_bail;
}
@@ -648,7 +648,7 @@ static int inflateToFile(int outFd, int inFd, size_t uncompLen, size_t compLen)
/* uncompress the data */
zerr = inflate(&zstream, Z_NO_FLUSH);
if (zerr != Z_OK && zerr != Z_STREAM_END) {
- LOGW("Zip: inflate zerr=%d (nIn=%p aIn=%u nOut=%p aOut=%u)",
+ ALOGW("Zip: inflate zerr=%d (nIn=%p aIn=%u nOut=%p aOut=%u)",
zerr, zstream.next_in, zstream.avail_in,
zstream.next_out, zstream.avail_out);
goto z_bail;
@@ -671,7 +671,7 @@ static int inflateToFile(int outFd, int inFd, size_t uncompLen, size_t compLen)
/* paranoia */
if (zstream.total_out != uncompLen) {
- LOGW("Zip: size mismatch on inflated file (%ld vs %zd)",
+ ALOGW("Zip: size mismatch on inflated file (%ld vs %zd)",
zstream.total_out, uncompLen);
goto z_bail;
}
@@ -699,7 +699,7 @@ int dexZipExtractEntryToFile(const ZipArchive* pArchive,
int result = -1;
int ent = entryToIndex(pArchive, entry);
if (ent < 0) {
- LOGW("Zip: extract can't find entry %p", entry);
+ ALOGW("Zip: extract can't find entry %p", entry);
goto bail;
}
@@ -713,7 +713,7 @@ int dexZipExtractEntryToFile(const ZipArchive* pArchive,
goto bail;
}
if (lseek(pArchive->mFd, dataOffset, SEEK_SET) != dataOffset) {
- LOGW("Zip: lseek to data at %ld failed", (long) dataOffset);
+ ALOGW("Zip: lseek to data at %ld failed", (long) dataOffset);
goto bail;
}