bool includeSelectedMethod;
/* Disable JIT for selected opcodes - one bit for each opcode */
- char opList[32];
+ char opList[(kNumPackedOpcodes+7)/8];
/* Disable JIT for selected methods */
HashTable *methodTable;
startValue = strtol(startPtr, &endPtr, 16);
if (startPtr != endPtr) {
/* Just in case value is out of range */
- startValue &= 0xff;
+ startValue %= kNumPackedOpcodes;
if (*endPtr == '-') {
endValue = strtol(endPtr+1, &endPtr, 16);
- endValue &= 0xff;
+ endValue %= kNumPackedOpcodes;
} else {
endValue = startValue;
}
LOGW("Dalvik opcode %x is selected for debugging",
(unsigned int) startValue);
/* Mark the corresponding bit to 1 */
- gDvmJit.opList[startValue >> 3] |=
- 1 << (startValue & 0x7);
+ gDvmJit.opList[startValue >> 3] |= 1 << (startValue & 0x7);
}
if (*endPtr == 0) {
} while (1);
} else {
int i;
- for (i = 0; i < 32; i++) {
+ for (i = 0; i < (kNumPackedOpcodes+7)/8; i++) {
gDvmJit.opList[i] = 0xff;
}
dvmFprintf(stderr, "Warning: select all opcodes\n");
}
/*
- * Check that the current pc is the end of the trace when at least one
- * instruction is interpreted.
+ * Check if the current pc matches the endPC. Only check for non-zero
+ * trace length when backward branches are involved.
*/
- if ((state == kSVSDebugInterp || state == kSVSSingleStep ||
- state == kSVSBackwardBranch) &&
- shadowSpace->traceLength != 0 &&
- pc == shadowSpace->endPC) {
+ if (pc == shadowSpace->endPC &&
+ (state == kSVSDebugInterp || state == kSVSSingleStep ||
+ (state == kSVSBackwardBranch && shadowSpace->traceLength != 0))) {
shadowSpace->selfVerificationState = kSVSIdle;