VirtualBox

Changeset 64500 in vbox for trunk


Ignore:
Timestamp:
Nov 1, 2016 9:07:45 AM (8 years ago)
Author:
vboxsync
Message:

VMM/DBGF: Add DBGFR3Cfg* API to create control flow graphs

Location:
trunk
Files:
1 added
3 edited

Legend:

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

    r62476 r64500  
    24872487/** @} */
    24882488
     2489
     2490/** @defgroup grp_dbgf_cfg       The DBGF control flow graph Interface.
     2491 * @{
     2492 */
     2493
     2494/** A DBGF control flow graph handle. */
     2495typedef struct DBGFCFGINT *DBGFCFG;
     2496/** Pointer to a DBGF control flow graph handle. */
     2497typedef DBGFCFG *PDBGFCFG;
     2498/** A DBGF control flow graph basic block handle. */
     2499typedef struct DBGFCFGBBINT *DBGFCFGBB;
     2500/** Pointer to a DBGF control flow graph basic block handle. */
     2501typedef DBGFCFGBB *PDBGFCFGBB;
     2502
     2503/** @name DBGFCFGBB Flags.
     2504 * @{ */
     2505/** The basic block is the entry into the owning control flow graph. */
     2506#define DBGF_CFG_BB_F_ENTRY             RT_BIT_32(0)
     2507/** The basic block was not populated because the limit was reached. */
     2508#define DBGF_CFG_BB_F_EMPTY             RT_BIT_32(1)
     2509/** The basic block is not complete because an error happened during disassembly. */
     2510#define DBGF_CFG_BB_F_INCOMPLETE_ERR    RT_BIT_32(2)
     2511/** @} */
     2512
     2513/**
     2514 * DBGF control graph basic block end type.
     2515 */
     2516typedef enum DBGFCFGBBENDTYPE
     2517{
     2518    /** Invalid type. */
     2519    DBGFCFGBBENDTYPE_INVALID = 0,
     2520    /** Basic block is the exit block and has no successor. */
     2521    DBGFCFGBBENDTYPE_EXIT,
     2522    /** Basic block is the last disassembled block because the
     2523     * maximum amount to disassemble was reached but is not an
     2524     * exit block - no successors.
     2525     */
     2526    DBGFCFGBBENDTYPE_LAST_DISASSEMBLED,
     2527    /** Unconditional control flow change because the successor is referenced by multiple
     2528     * basic blocks. - 1 successor. */
     2529    DBGFCFGBBENDTYPE_UNCOND,
     2530    /** Unconditional control flow change because of a jump instruction - 1 successor. */
     2531    DBGFCFGBBENDTYPE_UNCOND_JMP,
     2532    /** Conditional control flow change - 2 successors. */
     2533    DBGFCFGBBENDTYPE_COND,
     2534    /** 32bit hack. */
     2535    DBGFCFGBBENDTYPE_32BIT_HACK = 0x7fffffff
     2536} DBGFCFGBBENDTYPE;
     2537
     2538/**
     2539 * DBGF control flow graph dumper callback.
     2540 *
     2541 * @returns VBox status code. Any non VINF_SUCCESS status code will abort the dumping.
     2542 *
     2543 * @param   psz             The string to dump
     2544 * @param   pvUser          Opaque user data.
     2545 */
     2546typedef DECLCALLBACK(int) FNDBGFR3CFGDUMP(const char *psz, void *pvUser);
     2547/** Pointer to a FNDBGFR3TYPEDUMP. */
     2548typedef FNDBGFR3CFGDUMP *PFNDBGFR3CFGDUMP;
     2549
     2550VMMR3DECL(int)              DBGFR3CfgCreate(PUVM pUVM, VMCPUID idCpu, PDBGFADDRESS pAddressStart, uint32_t cbDisasmMax,
     2551                                            uint32_t fFlags, PDBGFCFG phCfg);
     2552VMMR3DECL(uint32_t)         DBGFR3CfgRetain(DBGFCFG hCfg);
     2553VMMR3DECL(uint32_t)         DBGFR3CfgRelease(DBGFCFG hCfg);
     2554VMMR3DECL(int)              DBGFR3CfgQueryStartBb(DBGFCFG hCfg, PDBGFCFGBB phCfgBb);
     2555VMMR3DECL(int)              DBGFR3CfgDump(DBGFCFG hCfg, PFNDBGFR3CFGDUMP pfnDump, void *pvUser);
     2556VMMR3DECL(uint32_t)         DBGFR3CfgBbRetain(DBGFCFGBB hCfgBb);
     2557VMMR3DECL(uint32_t)         DBGFR3CfgBbRelease(DBGFCFGBB hCfgBb);
     2558VMMR3DECL(PDBGFADDRESS)     DBGFR3CfgBbGetStartAddress(DBGFCFGBB hCfgBb, PDBGFADDRESS pAddrStart);
     2559VMMR3DECL(PDBGFADDRESS)     DBGFR3CfgBbGetEndAddress(DBGFCFGBB hCfgBb, PDBGFADDRESS pAddrEnd);
     2560VMMR3DECL(DBGFCFGBBENDTYPE) DBGFR3CfgBbGetType(DBGFCFGBB hCfgBb);
     2561VMMR3DECL(uint32_t)         DBGFR3CfgBbGetInstrCount(DBGFCFGBB hCfgBb);
     2562VMMR3DECL(uint32_t)         DBGFR3CfgBbGetFlags(DBGFCFGBB hCfgBb);
     2563VMMR3DECL(int)              DBGFR3CfgBbQueryInstr(DBGFCFGBB hCfgBb, uint32_t idxInstr, PDBGFADDRESS pAddrInstr,
     2564                                                  uint32_t *pcbInstr, char *pszOutput, uint32_t cbOutput);
     2565VMMR3DECL(int)              DBGFR3CfgBbQuerySuccessors(DBGFCFGBB hCfgBb, PDBGFCFGBB pahCfgBbSucc, uint32_t cSucc);
     2566VMMR3DECL(uint32_t)         DBGFR3CfgBbGetRefBbCount(DBGFCFGBB hCfgBb);
     2567VMMR3DECL(int)              DBGFR3CfgBbGetRefBb(DBGFCFGBB hCfgBb, PDBGFCFGBB pahCfgBbRef, uint32_t cRef);
     2568
     2569/** @} */
     2570
    24892571#endif /* IN_RING3 */
    24902572
  • trunk/src/VBox/VMM/Makefile.kmk

    r62478 r64500  
    163163        VMMR3/DBGFReg.cpp \
    164164        VMMR3/DBGFStack.cpp \
     165        VMMR3/DBGFR3Cfg.cpp \
    165166        VMMR3/DBGFR3Trace.cpp \
    166167        VMMR3/DBGFR3Type.cpp \
  • trunk/src/VBox/VMM/VMMR3/VMMR3.def

    r64140 r64500  
    130130    DBGFR3CpuGetMode
    131131    DBGFR3AddrFromSelOff
     132    DBGFR3CfgCreate
     133    DBGFR3CfgRetain
     134    DBGFR3CfgRelease
     135    DBGFR3CfgQueryStartBb
     136    DBGFR3CfgDump
     137    DBGFR3CfgBbRetain
     138    DBGFR3CfgBbRelease
     139    DBGFR3CfgBbGetStartAddress
     140    DBGFR3CfgBbGetEndAddress
     141    DBGFR3CfgBbGetType
     142    DBGFR3CfgBbGetInstrCount
     143    DBGFR3CfgBbGetFlags
     144    DBGFR3CfgBbQueryInstr
     145    DBGFR3CfgBbQuerySuccessors
     146    DBGFR3CfgBbGetRefBbCount
     147    DBGFR3CfgBbGetRefBb
    132148    DBGFR3PlugInLoad
    133149    DBGFR3PlugInUnload
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