Changeset 918 in vbox
- Timestamp:
- Feb 15, 2007 3:30:26 AM (18 years ago)
- svn:sync-xref-src-repo-rev:
- 18646
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/testcase/tstLdrDisasmTest.cpp
r916 r918 34 34 #include <iprt/string.h> 35 35 36 #if 0 && defined(IN_RING0)36 #if defined(IN_RING0) && !defined(__WIN__) && !defined(__OS2__) /* Too lazy to make import libs. */ 37 37 extern "C" DECLIMPORT(int) MyPrintf(const char *pszFormat, ...); 38 38 # define MY_PRINTF(a) MyPrintf a … … 75 75 76 76 77 78 77 DECLCALLBACK(int32_t) DisasmTest1ReadCode(RTUINTPTR SrcAddr, uint8_t *pbDst, uint32_t cb, RTUINTPTR uUser) 79 78 { … … 90 89 91 90 91 /* 92 * Use an inline function here just to test '__textcoal_nt' sections on darwin. 93 */ 94 inline int MyDisasm(uintptr_t CodeIndex, PDISCPUSTATE pCpu, uint32_t *pcb) 95 { 96 uint32_t cb; 97 int rc = DISCoreOneEx(CodeIndex, CPUMODE_32BIT, DisasmTest1ReadCode, 0, pCpu, &cb); 98 *pcb = cb; 99 MY_PRINTF(("DISCoreOneEx -> rc=%d cb=%d Cpu: opcode=%#x pCurInstr=%p (42=%d)\n", \ 100 rc, cb, pCpu->opcode, pCpu->pCurInstr, 42)); \ 101 return rc; 102 } 103 104 92 105 extern "C" DECLEXPORT(int) DisasmTest1(void) 93 106 { … … 96 109 uint32_t cb; 97 110 int rc; 111 MY_PRINTF(("DisasmTest1: %p\n", &DisasmTest1)); 112 98 113 #define DISAS_AND_CHECK(cbInstr, enmOp) \ 99 114 do { \ 100 rc = DISCoreOneEx(CodeIndex, CPUMODE_32BIT, DisasmTest1ReadCode, 0, &Cpu, &cb); \ 101 MY_PRINTF(("%d: rc=%d cb=%d Cpu: opcode=%#x pCurInstr=%p pfnReadBytes=%p (42=42)\n", \ 102 __LINE__, rc, cb, Cpu.opcode, Cpu.pCurInstr, Cpu.pfnReadBytes, 42)); \ 115 rc = MyDisasm(CodeIndex, &Cpu, &cb); \ 103 116 if (RT_FAILURE(rc)) \ 104 117 return CodeIndex | 0xf000; \
Note:
See TracChangeset
for help on using the changeset viewer.