VirtualBox

Changeset 20744 in vbox for trunk/include/iprt/dbg.h


Ignore:
Timestamp:
Jun 21, 2009 3:43:57 PM (15 years ago)
Author:
vboxsync
Message:

IPRT: RTDbg coding.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/dbg.h

    r20741 r20744  
    6363#define RTDBGSEGIDX_SPECIAL_FIRST   (RTDBGSEGIDX_LAST + 1U)
    6464
     65
     66/** Max length (including '\\0') of a segment name. */
     67#define RTDBG_SEGMENT_NAME_LENGTH   (128 - 8 - 8 - 8 - 4 - 4)
     68
     69/**
     70 * Debug module segment.
     71 */
     72typedef struct RTDBGSEGMENT
     73{
     74    /** The load address.
     75     * RTUINTPTR_MAX if not applicable. */
     76    RTUINTPTR           Address;
     77    /** The image relative virtual address of the segment.
     78     * RTUINTPTR_MAX if not applicable. */
     79    RTUINTPTR           uRva;
     80    /** The segment size. */
     81    RTUINTPTR           cb;
     82    /** The segment flags. (reserved) */
     83    uint32_t            fFlags;
     84    /** The segment index. */
     85    RTDBGSEGIDX         iSeg;
     86    /** Symbol name. */
     87    char                szName[RTDBG_SEGMENT_NAME_LENGTH];
     88} RTDBGSEGMENT;
     89/** Pointer to a debug module segment. */
     90typedef RTDBGSEGMENT *PRTDBGSEGMENT;
     91/** Pointer to a const debug module segment. */
     92typedef RTDBGSEGMENT const *PCRTDBGSEGMENT;
     93
     94
     95
    6596/** Max length (including '\\0') of a symbol name. */
    66 #define RTDBG_SYMBOL_NAME_LENGTH   (512 - 8 - 4 - 4 - 4)
     97#define RTDBG_SYMBOL_NAME_LENGTH    (384 - 8 - 8 - 8 - 4 - 4 - 8)
    6798
    6899/**
     
    75106     * as RTDbgMod, but the mapping address if you ask RTDbgAs. */
    76107    RTUINTPTR           Value;
     108    /** Symbol size. */
     109    RTUINTPTR           cb;
    77110    /** Offset into the segment specified by iSeg. */
    78111    RTUINTPTR           offSeg;
    79112    /** Segment number. */
    80113    RTDBGSEGIDX         iSeg;
    81     /** Symbol size. */
    82     uint32_t            cb;
    83114    /** Symbol Flags. (reserved). */
    84115    uint32_t            fFlags;
     116    /** Symbol ordinal.
     117     * This is set to UINT32_MAX if the ordinals aren't supported. */
     118    uint32_t            iOrdinal;
    85119    /** Symbol name. */
    86120    char                szName[RTDBG_SYMBOL_NAME_LENGTH];
     
    116150
    117151/** Max length (including '\\0') of a debug info file name. */
    118 #define RTDBG_FILE_NAME_LENGTH   (260)
     152#define RTDBG_FILE_NAME_LENGTH      (260)
    119153
    120154
     
    134168    /** Line number. */
    135169    uint32_t            uLineNo;
     170    /** Symbol ordinal.
     171     * This is set to UINT32_MAX if the ordinals aren't supported. */
     172    uint32_t            iOrdinal;
    136173    /** Filename. */
    137174    char                szFilename[RTDBG_FILE_NAME_LENGTH];
     
    418455 * @param   cb              The size of the symbol.
    419456 * @param   fFlags          Symbol flags.
    420  */
    421 RTDECL(int) RTDbgAsSymbolAdd(RTDBGAS hDbgAs, const char *pszSymbol, RTUINTPTR Addr, RTUINTPTR cb, uint32_t fFlags);
     457 * @param   piOrdinal       Where to return the symbol ordinal on success. If
     458 *                          the interpreter doesn't do ordinals, this will be set to
     459 *                          UINT32_MAX. Optional
     460 */
     461RTDECL(int) RTDbgAsSymbolAdd(RTDBGAS hDbgAs, const char *pszSymbol, RTUINTPTR Addr, RTUINTPTR cb, uint32_t fFlags, uint32_t *piOrdinal);
    422462
    423463/**
     
    491531 */
    492532RTDECL(int) RTDbgAs(RTDBGAS hDbgAs, RTUINTPTR Addr, PRTINTPTR poffDisp, PRTDBGLINE pLine);
     533
     534/**
     535 * Adds a line number to a module in the address space.
     536 *
     537 * @returns IPRT status code. See RTDbgModSymbolAdd for more specific ones.
     538 * @retval  VERR_INVALID_HANDLE if hDbgAs is invalid.
     539 * @retval  VERR_NOT_FOUND if no module was found at the specified address.
     540 * @retval  VERR_NOT_SUPPORTED if the module interpret doesn't support adding
     541 *          custom symbols.
     542 *
     543 * @param   hDbgAs          The address space handle.
     544 * @param   pszFile         The file name.
     545 * @param   uLineNo         The line number.
     546 * @param   Addr            The address of the symbol.
     547 * @param   piOrdinal       Where to return the line number ordinal on success.
     548 *                          If the interpreter doesn't do ordinals, this will be
     549 *                          set to UINT32_MAX. Optional.
     550 */
     551RTDECL(int) RTDbgAsLineAdd(RTDBGAS hDbgAs, const char *pszFile, uint32_t uLineNo, RTUINTPTR Addr, uint32_t *piOrdinal);
    493552
    494553/**
     
    524583RTDECL(const char *) RTDbgModName(RTDBGMOD hDbgMod);
    525584RTDECL(RTUINTPTR)   RTDbgModImageSize(RTDBGMOD hDbgMod);
     585
     586RTDECL(int)         RTDbgModSegmentAdd(RTDBGMOD hDbgMod, RTUINTPTR uRva, RTUINTPTR cb, const char *pszName, size_t cchName, uint32_t fFlags, PRTDBGSEGIDX piSeg);
     587RTDECL(RTDBGSEGIDX) RTDbgModSegmentCount(RTDBGMOD hDbgMod);
     588RTDECL(int)         RTDbgModSegmentByIndex(RTDBGMOD hDbgMod, RTDBGSEGIDX iSeg, PRTDBGSEGMENT pSegInfo);
    526589RTDECL(RTUINTPTR)   RTDbgModSegmentSize(RTDBGMOD hDbgMod, RTDBGSEGIDX iSeg);
    527590RTDECL(RTUINTPTR)   RTDbgModSegmentRva(RTDBGMOD hDbgMod, RTDBGSEGIDX iSeg);
    528 RTDECL(RTDBGSEGIDX) RTDbgModSegmentCount(RTDBGMOD hDbgMod);
    529 
    530 RTDECL(int)         RTDbgModSymbolAdd(RTDBGMOD hDbgMod, const char *pszSymbol, RTDBGSEGIDX iSeg, RTUINTPTR off, RTUINTPTR cb, uint32_t fFlags);
     591
     592RTDECL(int)         RTDbgModSymbolAdd(RTDBGMOD hDbgMod, const char *pszSymbol, RTDBGSEGIDX iSeg, RTUINTPTR off, RTUINTPTR cb, uint32_t fFlags, uint32_t *piOrdinal);
    531593RTDECL(uint32_t)    RTDbgModSymbolCount(RTDBGMOD hDbgMod);
    532594RTDECL(int)         RTDbgModSymbolByIndex(RTDBGMOD hDbgMod, uint32_t iSymbol, PRTDBGSYMBOL pSymbol);
     
    536598RTDECL(int)         RTDbgModSymbolByNameA(RTDBGMOD hDbgMod, const char *pszSymbol, PRTDBGSYMBOL *ppSymbol);
    537599
    538 RTDECL(int)         RTDbgModLineAdd(RTDBGMOD hDbgMod, const char *pszFile, uint32_t uLineNo, RTDBGSEGIDX iSeg, RTUINTPTR off);
     600RTDECL(int)         RTDbgModLineAdd(RTDBGMOD hDbgMod, const char *pszFile, uint32_t uLineNo, RTDBGSEGIDX iSeg, RTUINTPTR off, uint32_t *piOrdinal);
    539601RTDECL(int)         RTDbgModLineByAddr(RTDBGMOD hDbgMod, RTDBGSEGIDX iSeg, RTUINTPTR off, PRTINTPTR poffDisp, PRTDBGLINE pLine);
    540602RTDECL(int)         RTDbgModLineByAddrA(RTDBGMOD hDbgMod, RTDBGSEGIDX iSeg, RTUINTPTR off, PRTINTPTR poffDisp, PRTDBGLINE *ppLine);
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