Changeset 41790 in vbox for trunk/include/VBox/dis.h
- Timestamp:
- Jun 16, 2012 8:33:45 PM (13 years ago)
- svn:sync-xref-src-repo-rev:
- 78608
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/dis.h
r41789 r41790 36 36 37 37 /** 38 * CPU mode flags (DIS CPUSTATE::mode).38 * CPU mode flags (DISSTATE::mode). 39 39 */ 40 40 typedef enum DISCPUMODE … … 48 48 } DISCPUMODE; 49 49 50 /** @name Prefix byte flags (DIS CPUSTATE::fPrefix).50 /** @name Prefix byte flags (DISSTATE::fPrefix). 51 51 * @{ 52 52 */ … … 68 68 /** @} */ 69 69 70 /** @name 64 bits prefix byte flags (DIS CPUSTATE::fRexPrefix).70 /** @name 64 bits prefix byte flags (DISSTATE::fRexPrefix). 71 71 * Requires VBox/disopcode.h. 72 72 * @{ … … 499 499 * Callback for reading instruction bytes. 500 500 * 501 * @returns VBox status code, bytes in DIS CPUSTATE::abInstr and byte count in502 * DIS CPUSTATE::cbCachedInstr.501 * @returns VBox status code, bytes in DISSTATE::abInstr and byte count in 502 * DISSTATE::cbCachedInstr. 503 503 * @param pDis Pointer to the disassembler state. The user 504 * argument can be found in DISCPUSTATE::pvUser if 505 * needed. 504 * argument can be found in DISSTATE::pvUser if needed. 506 505 * @param offInstr The offset relative to the start of the instruction. 507 506 * 508 507 * To get the source address, add this to 509 * DIS CPUSTATE::uInstrAddr.508 * DISSTATE::uInstrAddr. 510 509 * 511 510 * To calculate the destination buffer address, use it 512 * as an index into DIS CPUSTATE::abInstr.511 * as an index into DISSTATE::abInstr. 513 512 * 514 513 * @param cbMinRead The minimum number of bytes to read. 515 514 * @param cbMaxRead The maximum number of bytes that may be read. 516 515 */ 517 typedef DECLCALLBACK(int) FNDISREADBYTES(PDIS CPUSTATE pDis, uint8_t offInstr, uint8_t cbMinRead, uint8_t cbMaxRead);516 typedef DECLCALLBACK(int) FNDISREADBYTES(PDISSTATE pDis, uint8_t offInstr, uint8_t cbMinRead, uint8_t cbMaxRead); 518 517 /** Pointer to a opcode byte reader. */ 519 518 typedef FNDISREADBYTES *PFNDISREADBYTES; … … 522 521 * @remark no DECLCALLBACK() here because it's considered to be internal and 523 522 * there is no point in enforcing CDECL. */ 524 typedef size_t FNDISPARSE(size_t offInstr, PCDISOPCODE pOp, PDISOPPARAM pParam, PDIS CPUSTATE pCpu);523 typedef size_t FNDISPARSE(size_t offInstr, PCDISOPCODE pOp, PDISOPPARAM pParam, PDISSTATE pDis); 525 524 /** Pointer to a disassembler parser function. */ 526 525 typedef FNDISPARSE *PFNDISPARSE; … … 534 533 * doesn't make any sense right now because of structure alignment. 535 534 */ 536 typedef struct DIS CPUSTATE535 typedef struct DISSTATE 537 536 { 538 537 /* Because of pvUser2, put the less frequently used bits at the top for … … 639 638 uint32_t uPadding5; 640 639 #endif 641 } DISCPUSTATE; 640 } DISSTATE; 641 642 /** @deprecated Use DISSTATE and change Cpu and DisState to Dis. */ 643 typedef DISSTATE DISCPUSTATE; 642 644 643 645 644 646 645 647 DISDECL(int) DISInstrToStr(void const *pvInstr, DISCPUMODE enmCpuMode, 646 PDIS CPUSTATE pCpu, uint32_t *pcbInstr, char *pszOutput, size_t cbOutput);648 PDISSTATE pDis, uint32_t *pcbInstr, char *pszOutput, size_t cbOutput); 647 649 DISDECL(int) DISInstrToStrWithReader(RTUINTPTR uInstrAddr, DISCPUMODE enmCpuMode, PFNDISREADBYTES pfnReadBytes, void *pvUser, 648 PDIS CPUSTATE pCpu, uint32_t *pcbInstr, char *pszOutput, size_t cbOutput);650 PDISSTATE pDis, uint32_t *pcbInstr, char *pszOutput, size_t cbOutput); 649 651 DISDECL(int) DISInstrToStrEx(RTUINTPTR uInstrAddr, DISCPUMODE enmCpuMode, 650 652 PFNDISREADBYTES pfnReadBytes, void *pvUser, uint32_t uFilter, 651 PDIS CPUSTATE pCpu, uint32_t *pcbInstr, char *pszOutput, size_t cbOutput);652 653 DISDECL(int) DISInstr(void const *pvInstr, DISCPUMODE enmCpuMode, PDIS CPUSTATE pCpu, uint32_t *pcbInstr);653 PDISSTATE pDis, uint32_t *pcbInstr, char *pszOutput, size_t cbOutput); 654 655 DISDECL(int) DISInstr(void const *pvInstr, DISCPUMODE enmCpuMode, PDISSTATE pDis, uint32_t *pcbInstr); 654 656 DISDECL(int) DISInstrWithReader(RTUINTPTR uInstrAddr, DISCPUMODE enmCpuMode, PFNDISREADBYTES pfnReadBytes, void *pvUser, 655 PDIS CPUSTATE pCpu, uint32_t *pcbInstr);657 PDISSTATE pDis, uint32_t *pcbInstr); 656 658 DISDECL(int) DISInstEx(RTUINTPTR uInstrAddr, DISCPUMODE enmCpuMode, uint32_t uFilter, 657 659 PFNDISREADBYTES pfnReadBytes, void *pvUser, 658 PDIS CPUSTATE pCpu, uint32_t *pcbInstr);660 PDISSTATE pDis, uint32_t *pcbInstr); 659 661 DISDECL(int) DISInstWithPrefetchedBytes(RTUINTPTR uInstrAddr, DISCPUMODE enmCpuMode, uint32_t fFilter, 660 662 void const *pvPrefetched, size_t cbPretched, 661 663 PFNDISREADBYTES pfnReadBytes, void *pvUser, 662 PDIS CPUSTATE pCpu, uint32_t *pcbInstr);663 664 DISDECL(int) DISGetParamSize(PCDIS CPUSTATE pCpu, PCDISOPPARAM pParam);665 DISDECL(DISSELREG) DISDetectSegReg(PCDIS CPUSTATE pCpu, PCDISOPPARAM pParam);666 DISDECL(uint8_t) DISQuerySegPrefixByte(PCDIS CPUSTATE pCpu);664 PDISSTATE pDis, uint32_t *pcbInstr); 665 666 DISDECL(int) DISGetParamSize(PCDISSTATE pDis, PCDISOPPARAM pParam); 667 DISDECL(DISSELREG) DISDetectSegReg(PCDISSTATE pDis, PCDISOPPARAM pParam); 668 DISDECL(uint8_t) DISQuerySegPrefixByte(PCDISSTATE pDis); 667 669 668 670 … … 716 718 DISQPVWHAT_32_BIT_HACK = 0x7fffffff 717 719 } DISQPVWHICH; 718 DISDECL(int) DISQueryParamVal(PCPUMCTXCORE pCtx, PCDIS CPUSTATE pCpu, PCDISOPPARAM pParam, PDISQPVPARAMVAL pParamVal, DISQPVWHICH parmtype);719 DISDECL(int) DISQueryParamRegPtr(PCPUMCTXCORE pCtx, PCDIS CPUSTATE pCpu, PCDISOPPARAM pParam, void **ppReg, size_t *pcbSize);720 DISDECL(int) DISQueryParamVal(PCPUMCTXCORE pCtx, PCDISSTATE pDis, PCDISOPPARAM pParam, PDISQPVPARAMVAL pParamVal, DISQPVWHICH parmtype); 721 DISDECL(int) DISQueryParamRegPtr(PCPUMCTXCORE pCtx, PCDISSTATE pDis, PCDISOPPARAM pParam, void **ppReg, size_t *pcbSize); 720 722 721 723 DISDECL(int) DISFetchReg8(PCCPUMCTXCORE pCtx, unsigned reg8, uint8_t *pVal); … … 747 749 * @retval VERR_SYMBOL_NOT_FOUND if no matching symbol was found for the address. 748 750 * 749 * @param p CpuPointer to the disassembler CPU state.751 * @param pDis Pointer to the disassembler CPU state. 750 752 * @param u32Sel The selector value. Use DIS_FMT_SEL_IS_REG, DIS_FMT_SEL_GET_VALUE, 751 753 * DIS_FMT_SEL_GET_REG to access this. … … 757 759 * @param pvUser The user argument. 758 760 */ 759 typedef DECLCALLBACK(int) FNDISGETSYMBOL(PCDIS CPUSTATE pCpu, uint32_t u32Sel, RTUINTPTR uAddress, char *pszBuf, size_t cchBuf, RTINTPTR *poff, void *pvUser);761 typedef DECLCALLBACK(int) FNDISGETSYMBOL(PCDISSTATE pDis, uint32_t u32Sel, RTUINTPTR uAddress, char *pszBuf, size_t cchBuf, RTINTPTR *poff, void *pvUser); 760 762 /** Pointer to a FNDISGETSYMBOL(). */ 761 763 typedef FNDISGETSYMBOL *PFNDISGETSYMBOL; … … 824 826 /** @} */ 825 827 826 DISDECL(size_t) DISFormatYasm( PCDISCPUSTATE pCpu, char *pszBuf, size_t cchBuf); 827 DISDECL(size_t) DISFormatYasmEx(PCDISCPUSTATE pCpu, char *pszBuf, size_t cchBuf, uint32_t fFlags, PFNDISGETSYMBOL pfnGetSymbol, void *pvUser); 828 DISDECL(size_t) DISFormatMasm( PCDISCPUSTATE pCpu, char *pszBuf, size_t cchBuf); 829 DISDECL(size_t) DISFormatMasmEx(PCDISCPUSTATE pCpu, char *pszBuf, size_t cchBuf, uint32_t fFlags, PFNDISGETSYMBOL pfnGetSymbol, void *pvUser); 830 DISDECL(size_t) DISFormatGas( PCDISCPUSTATE pCpu, char *pszBuf, size_t cchBuf); 831 DISDECL(size_t) DISFormatGasEx( PCDISCPUSTATE pCpu, char *pszBuf, size_t cchBuf, uint32_t fFlags, PFNDISGETSYMBOL pfnGetSymbol, void *pvUser); 832 833 /** @todo DISAnnotate(PCDISCPUSTATE pCpu, char *pszBuf, size_t cchBuf, register reader, memory reader); */ 834 835 DISDECL(bool) DISFormatYasmIsOddEncoding(PDISCPUSTATE pCpu); 828 DISDECL(size_t) DISFormatYasm( PCDISSTATE pDis, char *pszBuf, size_t cchBuf); 829 DISDECL(size_t) DISFormatYasmEx(PCDISSTATE pDis, char *pszBuf, size_t cchBuf, uint32_t fFlags, PFNDISGETSYMBOL pfnGetSymbol, void *pvUser); 830 DISDECL(size_t) DISFormatMasm( PCDISSTATE pDis, char *pszBuf, size_t cchBuf); 831 DISDECL(size_t) DISFormatMasmEx(PCDISSTATE pDis, char *pszBuf, size_t cchBuf, uint32_t fFlags, PFNDISGETSYMBOL pfnGetSymbol, void *pvUser); 832 DISDECL(size_t) DISFormatGas( PCDISSTATE pDis, char *pszBuf, size_t cchBuf); 833 DISDECL(size_t) DISFormatGasEx( PCDISSTATE pDis, char *pszBuf, size_t cchBuf, uint32_t fFlags, PFNDISGETSYMBOL pfnGetSymbol, void *pvUser); 834 835 /** @todo DISAnnotate(PCDISSTATE pDis, char *pszBuf, size_t cchBuf, register 836 * reader, memory reader); */ 837 838 DISDECL(bool) DISFormatYasmIsOddEncoding(PDISSTATE pDis); 836 839 837 840
Note:
See TracChangeset
for help on using the changeset viewer.