VirtualBox

Changeset 4953 in vbox for trunk/include/VBox/dis.h


Ignore:
Timestamp:
Sep 21, 2007 2:08:19 PM (18 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
24710
Message:

Cleaned up disassembler

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/dis.h

    r4071 r4953  
    3333 * @{
    3434 */
    35 #define CPUMODE_16BIT                   1
    36 #define CPUMODE_32BIT                   2
     35typedef enum
     36{
     37    CPUMODE_16BIT = 1,
     38    CPUMODE_32BIT = 2,
     39    CPUMODE_64BIT = 3
     40} DISCPUMODE;
    3741/** @} */
    3842
     
    313317typedef const struct _OPCODE *PCOPCODE;
    314318
    315 typedef DECLCALLBACK(int32_t) FN_DIS_READBYTES(RTUINTPTR pSrc, uint8_t *pDest, uint32_t size, RTUINTPTR dwUserdata);
     319typedef DECLCALLBACK(int) FN_DIS_READBYTES(RTUINTPTR pSrc, uint8_t *pDest, uint32_t size, void *pvUserdata);
    316320typedef FN_DIS_READBYTES *PFN_DIS_READBYTES;
    317321
     
    323327/** Parser callback.
    324328 * @remark no DECLCALLBACK() here because it's considered to be internal (really, I'm too lazy to update all the functions). */
    325 typedef int FNDISPARSE(RTUINTPTR pu8CodeBlock, PCOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu);
     329typedef unsigned FNDISPARSE(RTUINTPTR pu8CodeBlock, PCOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu);
    326330typedef FNDISPARSE *PFNDISPARSE;
    327331
     
    370374    PCOPCODE        pCurInstr;
    371375
    372     RTUINTPTR       dwUserData[3];
     376    void           *apvUserData[3];
    373377
    374378    /** Optional read function */
     
    402406 * Disassembles a code block.
    403407 *
    404  * @returns Success indicator.
     408 * @returns VBox error code
    405409 * @param   pCpu            Pointer to cpu structure which have DISCPUSTATE::mode
    406410 *                          set correctly.
     
    419423 *          This means *pcbSize >= cbMax sometimes.
    420424 */
    421 DISDECL(bool) DISBlock(PDISCPUSTATE pCpu, RTUINTPTR pvCodeBlock, int32_t cbMax, uint32_t *pSize);
     425DISDECL(int) DISBlock(PDISCPUSTATE pCpu, RTUINTPTR pvCodeBlock, unsigned cbMax, unsigned *pSize);
    422426
    423427/**
    424428 * Disassembles one instruction
    425429 *
    426  * @returns Success indicator.
     430 * @returns VBox error code
    427431 * @param   pCpu            Pointer to cpu structure which have DISCPUSTATE::mode
    428432 *                          set correctly.
     
    435439 * @todo    Define output callback.
    436440 */
    437 DISDECL(bool) DISInstr(PDISCPUSTATE pCpu, RTUINTPTR pu8Instruction, uint32_t u32EipOffset, uint32_t *pcbSize, char *pszOutput);
     441DISDECL(int) DISInstr(PDISCPUSTATE pCpu, RTUINTPTR pu8Instruction, unsigned u32EipOffset, unsigned *pcbSize, char *pszOutput);
    438442
    439443/**
    440444 * Disassembles one instruction
    441445 *
    442  * @returns Success indicator.
     446 * @returns VBox error code
    443447 * @param   pCpu            Pointer to cpu structure which have DISCPUSTATE::mode
    444448 *                          set correctly.
     
    452456 * @todo    Define output callback.
    453457 */
    454 DISDECL(bool) DISInstrEx(PDISCPUSTATE pCpu, RTUINTPTR pu8Instruction, uint32_t u32EipOffset, uint32_t *pcbSize,
    455                          char *pszOutput, uint32_t uFilter);
     458DISDECL(int) DISInstrEx(PDISCPUSTATE pCpu, RTUINTPTR pu8Instruction, uint32_t u32EipOffset, uint32_t *pcbSize,
     459                         char *pszOutput, unsigned uFilter);
    456460
    457461/**
     
    459463 * The result is found in pCpu.
    460464 *
    461  * @returns Success indicator.
     465 * @returns VBox error code
    462466 * @param   pCpu            Pointer to cpu structure which has DISCPUSTATE::mode set correctly.
    463467 * @param   InstructionAddr Pointer to the instruction to parse.
     
    465469 *                          NULL is allowed.
    466470 */
    467 DISDECL(bool) DISCoreOne(PDISCPUSTATE pCpu, RTUINTPTR InstructionAddr, unsigned *pcbInstruction);
     471DISDECL(int) DISCoreOne(PDISCPUSTATE pCpu, RTUINTPTR InstructionAddr, unsigned *pcbInstruction);
    468472
    469473/**
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette