Changeset 92809 in vbox for trunk/src/VBox
- Timestamp:
- Dec 8, 2021 10:50:51 AM (3 years ago)
- Location:
- trunk/src/VBox/Disassembler
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Disassembler/DisasmInternal.h
r92805 r92809 82 82 IDX_ParseMax 83 83 }; 84 AssertCompile(IDX_ParseMax < 64 /* Packed DISOPCODE assumption. */); 84 85 /** @} */ 85 86 … … 194 195 * @internal 195 196 */ 196 #if ndef DIS_CORE_ONLY197 #if DISOPCODE_FORMAT == 0 197 198 # define OP(pszOpcode, idxParse1, idxParse2, idxParse3, opcode, param1, param2, param3, optype) \ 198 199 { pszOpcode, idxParse1, idxParse2, idxParse3, 0, opcode, param1, param2, param3, 0, 0, optype } 199 200 # define OPVEX(pszOpcode, idxParse1, idxParse2, idxParse3, idxParse4, opcode, param1, param2, param3, param4, optype) \ 200 201 { pszOpcode, idxParse1, idxParse2, idxParse3, idxParse4, opcode, param1, param2, param3, param4, 0, optype | DISOPTYPE_SSE } 201 #elif defined(RT_ARCH_X86) || defined(RT_ARCH_AMD64) 202 203 #elif DISOPCODE_FORMAT == 16 202 204 # define OP(pszOpcode, idxParse1, idxParse2, idxParse3, opcode, param1, param2, param3, optype) \ 203 { idxParse1, idxParse2, idxParse3, 0, opcode, param1, param2, param3, 0, optype}205 { optype, opcode, idxParse1, idxParse2, param1, param2, idxParse3, param3, 0, 0 } 204 206 # define OPVEX(pszOpcode, idxParse1, idxParse2, idxParse3, idxParse4, opcode, param1, param2, param3, param4, optype) \ 205 { idxParse1, idxParse2, idxParse3, idxParse4, opcode, param1, param2, param3, param4, optype | DISOPTYPE_SSE} 207 { optype | DISOPTYPE_SSE, opcode, idxParse1, idxParse2, param1, param2, idxParse3, param3, param4, idxParse4 } 208 209 #elif DISOPCODE_FORMAT == 15 210 # define OP(pszOpcode, idxParse1, idxParse2, idxParse3, opcode, param1, param2, param3, optype) \ 211 { opcode, idxParse1, idxParse2, idxParse3, param1, param2, param3, optype, 0, 0 } 212 # define OPVEX(pszOpcode, idxParse1, idxParse2, idxParse3, idxParse4, opcode, param1, param2, param3, param4, optype) \ 213 { opcode, idxParse1, idxParse2, idxParse3, param1, param2, param3, optype | DISOPTYPE_SSE, param4, idxParse4 } 206 214 #else 207 # define OP(pszOpcode, idxParse1, idxParse2, idxParse3, opcode, param1, param2, param3, optype) \ 208 { idxParse1, idxParse2, idxParse3, 0, opcode, param1, param2, param3, 0, 0, optype } 209 # define OPVEX(pszOpcode, idxParse1, idxParse2, idxParse3, idxParse4, opcode, param1, param2, param3, param4, optype) \ 210 { idxParse1, idxParse2, idxParse3, idxParse4, opcode, param1, param2, param3, param4, 0, optype | DISOPTYPE_SSE} 215 # error Unsupported DISOPCODE_FORMAT value 211 216 #endif 212 217 -
trunk/src/VBox/Disassembler/testcase/Makefile.kmk
r87281 r92809 30 30 tstDisasm-1_LIBS = \ 31 31 $(PATH_STAGE_LIB)/DisasmR3$(VBOX_SUFF_LIB) \ 32 $(LIB_RUNTIME) 33 34 PROGRAMS += tstDisasmCore-1 35 tstDisasmCore-1_EXTENDS = tstDisasm-1 36 tstDisasmCore-1_DEFS = IN_DIS DIS_CORE_ONLY 37 tstDisasmCore-1_LIBS = \ 38 $(PATH_STAGE_LIB)/DisasmCoreR3$(VBOX_SUFF_LIB) \ 32 39 $(LIB_RUNTIME) 33 40 endif -
trunk/src/VBox/Disassembler/testcase/tstDisasm-1.cpp
r82968 r92809 42 42 for (size_t off = 0; off < cbInstrs;) 43 43 { 44 DISSTATE Dis; 45 uint32_t cb = 1; 46 #ifndef DIS_CORE_ONLY 44 47 uint32_t const cErrBefore = RTTestIErrorCount(); 45 uint32_t cb = 1;46 DISSTATE Dis;47 48 char szOutput[256] = {0}; 48 49 int rc = DISInstrToStr(&pabInstrs[off], enmDisCpuMode, &Dis, &cb, szOutput, sizeof(szOutput)); … … 84 85 RTTESTI_CHECK_MSG(cbOnly == cb, ("%#x vs %#x\n", cbOnly, cb)); 85 86 87 #else /* DIS_CORE_ONLY */ 88 int rc = DISInstr(&pabInstrs[off], enmDisCpuMode, &Dis, &cb); 89 RTTESTI_CHECK_RC(rc, VINF_SUCCESS); 90 RTTESTI_CHECK(cb == Dis.cbInstr); 91 #endif /* DIS_CORE_ONLY */ 92 86 93 off += cb; 87 94 } … … 145 152 RTTESTI_CHECK_MSG((cb2 = DISGetParamSize(&Dis, &Dis.Param1)) == s_gInstrs[i].cbParam1, 146 153 ("%u: %#x vs %#x\n", i , cb2, s_gInstrs[i].cbParam1)); 154 #ifndef DIS_CORE_ONLY 147 155 RTTESTI_CHECK_MSG((cb2 = DISGetParamSize(&Dis, &Dis.Param2)) == s_gInstrs[i].cbParam2, 148 156 ("%u: %#x vs %#x (%s)\n", i , cb2, s_gInstrs[i].cbParam2, Dis.pCurInstr->pszOpcode)); 157 #else 158 RTTESTI_CHECK_MSG((cb2 = DISGetParamSize(&Dis, &Dis.Param2)) == s_gInstrs[i].cbParam2, 159 ("%u: %#x vs %#x\n", i , cb2, s_gInstrs[i].cbParam2)); 160 #endif 149 161 RTTESTI_CHECK_MSG((cb2 = DISGetParamSize(&Dis, &Dis.Param3)) == s_gInstrs[i].cbParam3, 150 162 ("%u: %#x vs %#x\n", i , cb2, s_gInstrs[i].cbParam3));
Note:
See TracChangeset
for help on using the changeset viewer.