Changeset 99208 in vbox for trunk/src/VBox/Runtime/testcase/tstLdrDisasmTest.cpp
- Timestamp:
- Mar 29, 2023 2:13:56 PM (2 years ago)
- svn:sync-xref-src-repo-rev:
- 156581
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/testcase/tstLdrDisasmTest.cpp
r98103 r99208 93 93 * @callback_method_impl{FNDISREADBYTES} 94 94 */ 95 static DECLCALLBACK(int) DisasmTest1ReadCode(PDIS CPUSTATE pDis, uint8_t offInstr, uint8_t cbMinRead, uint8_t cbMaxRead)95 static DECLCALLBACK(int) DisasmTest1ReadCode(PDISSTATE pDis, uint8_t offInstr, uint8_t cbMinRead, uint8_t cbMaxRead) 96 96 { 97 97 size_t cb = cbMaxRead; … … 107 107 * Use an inline function here just to test '__textcoal_nt' sections on darwin. 108 108 */ 109 inline int MyDisasm(uintptr_t CodeIndex, PDIS CPUSTATE pCpu, uint32_t *pcb)109 inline int MyDisasm(uintptr_t CodeIndex, PDISSTATE pDis, uint32_t *pcb) 110 110 { 111 111 uint32_t cb; 112 int rc = DISInstrWithReader(CodeIndex, DISCPUMODE_32BIT, DisasmTest1ReadCode, 0, p Cpu, &cb);112 int rc = DISInstrWithReader(CodeIndex, DISCPUMODE_32BIT, DisasmTest1ReadCode, 0, pDis, &cb); 113 113 *pcb = cb; 114 114 MY_PRINTF(("DISCoreOneEx -> rc=%d cb=%d Cpu: bOpCode=%#x pCurInstr=%p (42=%d)\n", \ 115 rc, cb, p Cpu->bOpCode, pCpu->pCurInstr, 42)); \115 rc, cb, pDis->bOpCode, pDis->pCurInstr, 42)); \ 116 116 return rc; 117 117 } … … 120 120 extern "C" DECLEXPORT(int) DisasmTest1(void) 121 121 { 122 DIS CPUSTATE Cpu;122 DISSTATE Dis; 123 123 uintptr_t CodeIndex = 0; 124 124 uint32_t cb; … … 140 140 #endif 141 141 142 memset(& Cpu, 0, sizeof(Cpu));142 memset(&Dis, 0, sizeof(Dis)); 143 143 144 144 #define DISAS_AND_CHECK(cbInstr, enmOp) \ 145 145 do { \ 146 rc = MyDisasm(CodeIndex, & Cpu, &cb); \146 rc = MyDisasm(CodeIndex, &Dis, &cb); \ 147 147 if (RT_FAILURE(rc)) \ 148 148 return CodeIndex | 0xf000; \ 149 if ( Cpu.pCurInstr->uOpcode != (enmOp)) \149 if (Dis.pCurInstr->uOpcode != (enmOp)) \ 150 150 return CodeIndex| 0xe000; \ 151 151 if (cb != (cbInstr)) \
Note:
See TracChangeset
for help on using the changeset viewer.