Dump an instruction signature on error, corrected x86 validator a bit, adjusted DB according to asmdb changes

This commit is contained in:
kobalicek
2017-02-14 18:40:31 +01:00
parent 216fb5a281
commit 8062e7d433
4 changed files with 1753 additions and 1735 deletions

View File

@@ -563,8 +563,10 @@ Error X86Assembler::_emit(uint32_t instId, const Operand_& o0, const Operand_& o
// Strict validation.
#if !defined(ASMJIT_DISABLE_VALIDATION)
if (options & CodeEmitter::kOptionStrictValidation)
ASMJIT_PROPAGATE(_validate(instId, o0, o1, o2, o3));
if (options & CodeEmitter::kOptionStrictValidation) {
err = _validate(instId, o0, o1, o2, o3);
if (ASMJIT_UNLIKELY(err)) goto Failed;
}
#endif // !ASMJIT_DISABLE_VALIDATION
uint32_t instFlags = instData->getFlags();

View File

@@ -134,7 +134,17 @@ Error X86Compiler::_emit(uint32_t instId, const Operand_& o0, const Operand_& o1
};
Error err = X86Inst::validate(getArchType(), instId, options, _opExtra, opArray, opCount);
if (err) return setLastError(err);
if (err) {
#if !defined(ASMJIT_DISABLE_LOGGING)
StringBuilderTmp<256> sb;
sb.appendString(DebugUtils::errorAsString(err));
sb.appendString(": ");
Logging::formatInstruction(sb, 0, this, getArchType(), instId, options, _opExtra, opArray, opCount);
return setLastError(err, sb.getData());
#else
return setLastError(err);
#endif
}
// Clear it as it must be enabled explicitly on assembler side.
options &= ~kOptionStrictValidation;

View File

@@ -129,7 +129,7 @@ public:
}
template<typename RegT>
ASMJIT_INLINE RegT newSimilarReg(const RegT& ref, const char* nameFmt, ...) {
RegT newSimilarReg(const RegT& ref, const char* nameFmt, ...) {
RegT reg(NoInit);
ASMJIT_NEW_REG(reg, ref, nameFmt);
return reg;

File diff suppressed because it is too large Load Diff