diff options
author | Andy McFadden <fadden@android.com> | 2010-06-22 10:34:21 -0700 |
---|---|---|
committer | Andy McFadden <fadden@android.com> | 2010-06-22 10:34:21 -0700 |
commit | 45a82a133c0f8d91bce6621be1ea2f4818e8e340 (patch) | |
tree | 08ea280d27202edf15990f0f76d3b7603068b682 /dexdump | |
parent | 364f9d924cbd9d392744a66f80cc084c3d80caf0 (diff) | |
download | android_dalvik-45a82a133c0f8d91bce6621be1ea2f4818e8e340.tar.gz android_dalvik-45a82a133c0f8d91bce6621be1ea2f4818e8e340.tar.bz2 android_dalvik-45a82a133c0f8d91bce6621be1ea2f4818e8e340.zip |
Fix dexdump.
It was printing bad output or crashing on the -wide-volatile instructions
generated by "dx". This inverts the "else" clause, treating new-array
and instance-of as the special case.
Change-Id: I1717508d2e41cdc9a2396e2eaa215d7f9f8ac21b
Diffstat (limited to 'dexdump')
-rw-r--r-- | dexdump/DexDump.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/dexdump/DexDump.c b/dexdump/DexDump.c index e8dcf61b7..9582c986f 100644 --- a/dexdump/DexDump.c +++ b/dexdump/DexDump.c @@ -836,7 +836,14 @@ void dumpInstruction(DexFile* pDexFile, const DexCode* pCode, int insnIdx, pDecInsn->vA, pDecInsn->vB, (s4)pDecInsn->vC, (u2)pDecInsn->vC); break; case kFmt22c: // op vA, vB, thing@CCCC - if (pDecInsn->opCode >= OP_IGET && pDecInsn->opCode <= OP_IPUT_SHORT) { + if (pDecInsn->opCode == OP_INSTANCE_OF || + pDecInsn->opCode == OP_NEW_ARRAY) + { + printf(" v%d, v%d, %s // class@%04x", + pDecInsn->vA, pDecInsn->vB, + getClassDescriptor(pDexFile, pDecInsn->vC), pDecInsn->vC); + } else { + /* iget* and iput*, including dexopt-generated -volatile */ FieldMethodInfo fieldInfo; if (getFieldInfo(pDexFile, pDecInsn->vC, &fieldInfo)) { printf(" v%d, v%d, %s.%s:%s // field@%04x", pDecInsn->vA, @@ -846,10 +853,6 @@ void dumpInstruction(DexFile* pDexFile, const DexCode* pCode, int insnIdx, printf(" v%d, v%d, ??? // field@%04x", pDecInsn->vA, pDecInsn->vB, pDecInsn->vC); } - } else { - printf(" v%d, v%d, %s // class@%04x", - pDecInsn->vA, pDecInsn->vB, - getClassDescriptor(pDexFile, pDecInsn->vC), pDecInsn->vC); } break; case kFmt22cs: // [opt] op vA, vB, field offset CCCC |