VirtualBox

Changeset 73397 in vbox for trunk/include


Ignore:
Timestamp:
Jul 30, 2018 3:25:28 PM (7 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
124015
Message:

DBGF: Unwinding PE/AMD64, considered sketches for generic unwinding using unwind info.

File:
1 edited

Legend:

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

    r73351 r73397  
    109109/** Checks if the mixed address is far 16:64 or not. */
    110110#define DBGFADDRESS_IS_FAR64(pAddress)   ( ((pAddress)->fFlags & DBGFADDRESS_FLAGS_TYPE_MASK) == DBGFADDRESS_FLAGS_FAR64 )
     111/** Checks if the mixed address is any kind of far address. */
     112#define DBGFADDRESS_IS_FAR(pAddress)     ( ((pAddress)->fFlags & DBGFADDRESS_FLAGS_TYPE_MASK) <= DBGFADDRESS_FLAGS_FAR64 )
    111113/** Checks if the mixed address host context ring-0 (special). */
    112114#define DBGFADDRESS_IS_R0_HC(pAddress)   ( ((pAddress)->fFlags & DBGFADDRESS_FLAGS_TYPE_MASK) == DBGFADDRESS_FLAGS_RING0 )
     
    12681270}
    12691271
     1272/**
     1273 * Check if near return.
     1274 *
     1275 * @returns true if near, false if far or iret.
     1276 * @param   enmRetType  The type of return.
     1277 */
     1278DECLINLINE(bool) DBGFReturnTypeIsNear(DBGFRETURNTYPE enmRetType)
     1279{
     1280    return enmRetType == DBGFRETURNTYPE_NEAR32
     1281        || enmRetType == DBGFRETURNTYPE_NEAR64
     1282        || enmRetType == DBGFRETURNTYPE_NEAR16;
     1283}
     1284
    12701285
    12711286/** Pointer to stack frame info. */
     
    12821297    /** Frame flags. */
    12831298    uint32_t        fFlags;
    1284     /** The frame address.
    1285      * The off member is [e|r]bp and the Sel member is ss. */
    1286     DBGFADDRESS     AddrFrame;
    12871299    /** The stack address of the frame.
    12881300     * The off member is [e|r]sp and the Sel member is ss. */
     
    12931305    /** Pointer to the symbol nearest the program counter (PC). NULL if not found. */
    12941306    PRTDBGSYMBOL    pSymPC;
    1295     /** Pointer to the linnumber nearest the program counter (PC). NULL if not found. */
     1307    /** Pointer to the linenumber nearest the program counter (PC). NULL if not found. */
    12961308    PRTDBGLINE      pLinePC;
    1297 
     1309    /** The frame address.
     1310     * The off member is [e|r]bp and the Sel member is ss. */
     1311    DBGFADDRESS     AddrFrame;
     1312    /** The way this frame returns to the next one. */
     1313    DBGFRETURNTYPE  enmReturnType;
     1314
     1315    /** The way the next frame returns.
     1316     * Only valid when DBGFSTACKFRAME_FLAGS_UNWIND_INFO_RET is set. */
     1317    DBGFRETURNTYPE  enmReturnFrameReturnType;
    12981318    /** The return frame address.
    12991319     * The off member is [e|r]bp and the Sel member is ss. */
     
    13021322     * The off member is [e|r]sp and the Sel member is ss. */
    13031323    DBGFADDRESS     AddrReturnStack;
    1304     /** The way this frame returns to the next one. */
    1305     DBGFRETURNTYPE  enmReturnType;
    13061324
    13071325    /** The program counter (PC) address which the frame returns to.
     
    13101328    /** Pointer to the symbol nearest the return PC. NULL if not found. */
    13111329    PRTDBGSYMBOL    pSymReturnPC;
    1312     /** Pointer to the linnumber nearest the return PC. NULL if not found. */
     1330    /** Pointer to the linenumber nearest the return PC. NULL if not found. */
    13131331    PRTDBGLINE      pLineReturnPC;
    13141332
     
    13361354/** @name DBGFSTACKFRAME Flags.
    13371355 * @{ */
    1338 /** Set if the content of the frame is filled in by DBGFR3StackWalk() and can be used
    1339  * to construct the next frame. */
    1340 # define DBGFSTACKFRAME_FLAGS_ALL_VALID     RT_BIT(0)
    13411356/** This is the last stack frame we can read.
    13421357 * This flag is not set if the walk stop because of max dept or recursion. */
    1343 # define DBGFSTACKFRAME_FLAGS_LAST          RT_BIT(1)
     1358# define DBGFSTACKFRAME_FLAGS_LAST              RT_BIT(1)
    13441359/** This is the last record because we detected a loop. */
    1345 # define DBGFSTACKFRAME_FLAGS_LOOP          RT_BIT(2)
     1360# define DBGFSTACKFRAME_FLAGS_LOOP              RT_BIT(2)
    13461361/** This is the last record because we reached the maximum depth. */
    1347 # define DBGFSTACKFRAME_FLAGS_MAX_DEPTH     RT_BIT(3)
     1362# define DBGFSTACKFRAME_FLAGS_MAX_DEPTH         RT_BIT(3)
    13481363/** 16-bit frame. */
    1349 # define DBGFSTACKFRAME_FLAGS_16BIT         RT_BIT(4)
     1364# define DBGFSTACKFRAME_FLAGS_16BIT             RT_BIT(4)
    13501365/** 32-bit frame. */
    1351 # define DBGFSTACKFRAME_FLAGS_32BIT         RT_BIT(5)
     1366# define DBGFSTACKFRAME_FLAGS_32BIT             RT_BIT(5)
    13521367/** 64-bit frame. */
    1353 # define DBGFSTACKFRAME_FLAGS_64BIT         RT_BIT(6)
     1368# define DBGFSTACKFRAME_FLAGS_64BIT             RT_BIT(6)
     1369/** Real mode or V86 frame. */
     1370# define DBGFSTACKFRAME_FLAGS_REAL_V86          RT_BIT(7)
    13541371/** Used Odd/even heuristics for far/near return. */
    1355 # define DBGFSTACKFRAME_FLAGS_USED_ODD_EVEN RT_BIT(7)
     1372# define DBGFSTACKFRAME_FLAGS_USED_ODD_EVEN     RT_BIT(8)
     1373/** Set if we used unwind info to construct the frame. (Kind of internal.) */
     1374# define DBGFSTACKFRAME_FLAGS_USED_UNWIND_INFO  RT_BIT(30)
     1375/** Internal: Unwind info used for the return frame.  */
     1376# define DBGFSTACKFRAME_FLAGS_UNWIND_INFO_RET   RT_BIT(31)
    13561377/** @} */
    13571378
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