VirtualBox

Changeset 64586 in vbox for trunk/include/VBox


Ignore:
Timestamp:
Nov 6, 2016 1:56:36 PM (8 years ago)
Author:
vboxsync
Message:

DBGFR3Flow: Started working on resolving indirect branches. Compilers tend to create a branch table for large switch() {} statements to avoid loads of conditional branches

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/vmm/dbgf.h

    r64559 r64586  
    25002500/** Pointer to a DBGF control flow graph basic block handle. */
    25012501typedef DBGFFLOWBB *PDBGFFLOWBB;
     2502/** A DBGF control flow graph branch table handle. */
     2503typedef struct DBGFFLOWBRANCHTBLINT *DBGFFLOWBRANCHTBL;
     2504/** Pointer to a DBGF flow control graph branch table handle. */
     2505typedef DBGFFLOWBRANCHTBL *PDBGFFLOWBRANCHTBL;
    25022506/** A DBGF control flow graph iterator. */
    25032507typedef struct DBGFFLOWITINT *DBGFFLOWIT;
     
    25132517/** The basic block is not complete because an error happened during disassembly. */
    25142518#define DBGF_FLOW_BB_F_INCOMPLETE_ERR    RT_BIT_32(2)
     2519/** The basic block is reached through a branch table. */
     2520#define DBGF_FLOW_BB_F_BRANCH_TABLE      RT_BIT_32(3)
     2521/** @} */
     2522
     2523/** @name Flags controlling the creating of a control flow graph.
     2524 * @{ */
     2525/** Default options. */
     2526#define DBGF_FLOW_CREATE_F_DEFAULT                       0
     2527/** Tries to resolve indirect branches, useful for code using
     2528 * jump tables generated for large switch statements by some compilers. */
     2529#define DBGF_FLOW_CREATE_F_TRY_RESOLVE_INDIRECT_BRANCHES RT_BIT_32(0)
    25152530/** @} */
    25162531
     
    25322547     * basic blocks. - 1 successor. */
    25332548    DBGFFLOWBBENDTYPE_UNCOND,
    2534     /** Unconditional control flow change because of a jump instruction - 1 successor. */
     2549    /** Unconditional control flow change because of an direct branch - 1 successor. */
    25352550    DBGFFLOWBBENDTYPE_UNCOND_JMP,
     2551    /** Unconditional control flow change because of an indirect branch - n successors. */
     2552    DBGFFLOWBBENDTYPE_UNCOND_INDIRECT_JMP,
    25362553    /** Conditional control flow change - 2 successors. */
    25372554    DBGFFLOWBBENDTYPE_COND,
     
    25582575    DBGFFLOWITORDER_32BIT_HACK = 0x7fffffff
    25592576} DBGFFLOWITORDER;
    2560 /** POinter to a iteration order enum. */
     2577/** Pointer to a iteration order enum. */
    25612578typedef DBGFFLOWITORDER *PDBGFFLOWITORDER;
    25622579
    25632580
    25642581VMMR3DECL(int)               DBGFR3FlowCreate(PUVM pUVM, VMCPUID idCpu, PDBGFADDRESS pAddressStart, uint32_t cbDisasmMax,
    2565                                              uint32_t fFlags, PDBGFFLOW phFlow);
     2582                                              uint32_t fFlagsFlow, uint32_t fFlagsDisasm, PDBGFFLOW phFlow);
    25662583VMMR3DECL(uint32_t)          DBGFR3FlowRetain(DBGFFLOW hFlow);
    25672584VMMR3DECL(uint32_t)          DBGFR3FlowRelease(DBGFFLOW hFlow);
    25682585VMMR3DECL(int)               DBGFR3FlowQueryStartBb(DBGFFLOW hFlow, PDBGFFLOWBB phFlowBb);
    25692586VMMR3DECL(int)               DBGFR3FlowQueryBbByAddress(DBGFFLOW hFlow, PDBGFADDRESS pAddr, PDBGFFLOWBB phFlowBb);
     2587VMMR3DECL(int)               DBGFR3FlowQueryBranchTblByAddress(DBGFFLOW hFlow, PDBGFADDRESS pAddr, PDBGFFLOWBRANCHTBL phFlowBranchTbl);
    25702588VMMR3DECL(uint32_t)          DBGFR3FlowGetBbCount(DBGFFLOW hFlow);
     2589VMMR3DECL(uint32_t)          DBGFR3FlowGetBranchTblCount(DBGFFLOW hFlow);
     2590
    25712591VMMR3DECL(uint32_t)          DBGFR3FlowBbRetain(DBGFFLOWBB hFlowBb);
    25722592VMMR3DECL(uint32_t)          DBGFR3FlowBbRelease(DBGFFLOWBB hFlowBb);
     
    25782598VMMR3DECL(uint32_t)          DBGFR3FlowBbGetInstrCount(DBGFFLOWBB hFlowBb);
    25792599VMMR3DECL(uint32_t)          DBGFR3FlowBbGetFlags(DBGFFLOWBB hFlowBb);
     2600VMMR3DECL(int)               DBGFR3FlowBbQueryBranchTbl(DBGFFLOWBB hFlowBb, PDBGFFLOWBRANCHTBL phBranchTbl);
    25802601VMMR3DECL(int)               DBGFR3FlowBbQueryError(DBGFFLOWBB hFlowBb, const char **ppszErr);
    25812602VMMR3DECL(int)               DBGFR3FlowBbQueryInstr(DBGFFLOWBB hFlowBb, uint32_t idxInstr, PDBGFADDRESS pAddrInstr,
     
    25832604VMMR3DECL(int)               DBGFR3FlowBbQuerySuccessors(DBGFFLOWBB hFlowBb, PDBGFFLOWBB phFlowBbFollow,
    25842605                                                         PDBGFFLOWBB phFlowBbTarget);
     2606
    25852607VMMR3DECL(uint32_t)          DBGFR3FlowBbGetRefBbCount(DBGFFLOWBB hFlowBb);
    25862608VMMR3DECL(int)               DBGFR3FlowBbGetRefBb(DBGFFLOWBB hFlowBb, PDBGFFLOWBB pahFlowBbRef, uint32_t cRef);
     2609
     2610VMMR3DECL(uint32_t)          DBGFR3FlowBranchTblRetain(DBGFFLOWBRANCHTBL hFlowBranchTbl);
     2611VMMR3DECL(uint32_t)          DBGFR3FlowBranchTblRelease(DBGFFLOWBRANCHTBL hFlowBranchTbl);
     2612VMMR3DECL(uint32_t)          DBGFR3FlowBranchTblGetSlots(DBGFFLOWBRANCHTBL hFlowBranchTbl);
     2613VMMR3DECL(PDBGFADDRESS)      DBGFR3FlowBranchTblGetStartAddress(DBGFFLOWBRANCHTBL hFlowBranchTbl, PDBGFADDRESS pAddrStart);
     2614VMMR3DECL(int)               DBGFR3FlowBranchTblQueryAddresses(DBGFFLOWBRANCHTBL hFlowBranchTbl, PDBGFADDRESS paAddrs, uint32_t cAddrs);
     2615
    25872616VMMR3DECL(int)               DBGFR3FlowItCreate(DBGFFLOW hFlow, DBGFFLOWITORDER enmOrder, PDBGFFLOWIT phFlowIt);
    25882617VMMR3DECL(void)              DBGFR3FlowItDestroy(DBGFFLOWIT hFlowIt);
Note: See TracChangeset for help on using the changeset viewer.

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