VirtualBox

Changeset 20744 in vbox


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

IPRT: RTDbg coding.

Location:
trunk
Files:
7 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);
  • trunk/include/iprt/err.h

    r20740 r20744  
    939939 * @{
    940940 */
     941/** The module contains no line number information. */
     942#define VERR_DBG_NO_LINE_NUMBERS                (-650)
     943/** The module contains no symbol information. */
     944#define VERR_DBG_NO_SYMBOLS                     (-651)
    941945/** The specified segment:offset address was invalid. Typically an attempt at
    942946 * addressing outside the segment boundrary. */
    943 #define VERR_DBG_INVALID_ADDRESS                (-650)
     947#define VERR_DBG_INVALID_ADDRESS                (-652)
    944948/** Invalid segment index. */
    945 #define VERR_DBG_INVALID_SEGMENT_INDEX          (-651)
     949#define VERR_DBG_INVALID_SEGMENT_INDEX          (-653)
    946950/** Invalid segment offset. */
    947 #define VERR_DBG_INVALID_SEGMENT_OFFSET         (-652)
     951#define VERR_DBG_INVALID_SEGMENT_OFFSET         (-654)
    948952/** Invalid image relative virtual address. */
    949 #define VERR_DBG_INVALID_RVA                    (-653)
    950 /** The module contains no line number information. */
    951 #define VERR_DBG_NO_LINE_NUMBERS                (-654)
     953#define VERR_DBG_INVALID_RVA                    (-655)
    952954/** Address conflict within a module/segment.
    953955 * Attempted to add a symbol or line number that fully or partially overlaps with an existing one.  */
    954 #define VERR_DBG_ADDRESS_CONFLICT               (-655)
     956#define VERR_DBG_ADDRESS_CONFLICT               (-656)
    955957/** Duplicate symbol within the module.
    956958 * Attempted to add a symbol which name already exists within the module.  */
    957 #define VERR_DBG_DUPLICATE_SYMBOL               (-656)
     959#define VERR_DBG_DUPLICATE_SYMBOL               (-657)
     960/** The segment index specified when adding a new segment is already in use. */
     961#define VERR_DBG_SEGMENT_INDEX_CONFLICT         (-658)
     962/** No line number was found for the specified address/ordinal/whatever. */
     963#define VERR_DBG_LINE_NOT_FOUND                 (-659)
    958964/** The length of the symbol name is out of range.
    959965 * This means it is an empty string or that it's greater or equal to
    960966 * RTDBG_SYMBOL_NAME_LENGTH. */
    961 #define VERR_DBG_SYMBOL_NAME_OUT_OF_RANGE       (-657)
     967#define VERR_DBG_SYMBOL_NAME_OUT_OF_RANGE       (-660)
    962968/** The length of the file name is out of range.
    963969 * This means it is an empty string or that it's greater or equal to
    964970 * RTDBG_FILE_NAME_LENGTH. */
    965 #define VERR_DBG_FILE_NAME_OUT_OF_RANGE         (-658)
     971#define VERR_DBG_FILE_NAME_OUT_OF_RANGE         (-661)
    966972/** @} */
    967973
  • trunk/include/iprt/err.mac

    r20542 r20744  
    274274%define VERR_LDRELF_INVALID_RELOCATION_OFFSET    (-639)
    275275%define VERR_LDRELF_NO_SYMBOL_OR_NO_STRING_TABS    (-640)
    276 %define VERR_DBGMOD_INVALID_ADDRESS    (-650)
     276%define VERR_DBG_NO_LINE_NUMBERS    (-650)
     277%define VERR_DBG_NO_SYMBOLS    (-651)
     278%define VERR_DBG_INVALID_ADDRESS    (-652)
     279%define VERR_DBG_INVALID_SEGMENT_INDEX    (-653)
     280%define VERR_DBG_INVALID_SEGMENT_OFFSET    (-654)
     281%define VERR_DBG_INVALID_RVA    (-655)
     282%define VERR_DBG_ADDRESS_CONFLICT    (-656)
     283%define VERR_DBG_DUPLICATE_SYMBOL    (-657)
     284%define VERR_DBG_SEGMENT_INDEX_CONFLICT    (-658)
     285%define VERR_DBG_LINE_NOT_FOUND    (-659)
     286%define VERR_DBG_SYMBOL_NAME_OUT_OF_RANGE    (-660)
     287%define VERR_DBG_FILE_NAME_OUT_OF_RANGE    (-661)
    277288%define VERR_RT_REQUEST_INVALID_TYPE    (-700)
    278289%define VERR_RT_REQUEST_STATE    (-701)
  • trunk/src/VBox/Runtime/common/dbg/dbgas.cpp

    r20740 r20744  
    11481148 * @param   fFlags          Symbol flags.
    11491149 */
    1150 RTDECL(int) RTDbgAsSymbolAdd(RTDBGAS hDbgAs, const char *pszSymbol, RTUINTPTR Addr, RTUINTPTR cb, uint32_t fFlags)
     1150RTDECL(int) RTDbgAsSymbolAdd(RTDBGAS hDbgAs, const char *pszSymbol, RTUINTPTR Addr, RTUINTPTR cb, uint32_t fFlags, uint32_t *piOrdinal)
    11511151{
    11521152    /*
     
    11651165     * Forward the call.
    11661166     */
    1167     int rc = RTDbgModSymbolAdd(hMod, pszSymbol, iSeg, offSeg, cb, fFlags);
     1167    int rc = RTDbgModSymbolAdd(hMod, pszSymbol, iSeg, offSeg, cb, fFlags, piOrdinal);
    11681168    RTDbgModRelease(hMod);
    11691169    return rc;
     
    14641464 * @param   uLineNo         The line number.
    14651465 * @param   Addr            The address of the symbol.
    1466  */
    1467 RTDECL(int) RTDbgAsLineAdd(RTDBGAS hDbgAs, const char *pszFile, uint32_t uLineNo, RTUINTPTR Addr)
     1466 * @param   piOrdinal       Where to return the line number ordinal on success.
     1467 *                          If the interpreter doesn't do ordinals, this will be
     1468 *                          set to UINT32_MAX. Optional.
     1469 */
     1470RTDECL(int) RTDbgAsLineAdd(RTDBGAS hDbgAs, const char *pszFile, uint32_t uLineNo, RTUINTPTR Addr, uint32_t *piOrdinal)
    14681471{
    14691472    /*
     
    14821485     * Forward the call.
    14831486     */
    1484     int rc = RTDbgModLineAdd(hMod, pszFile, uLineNo, iSeg, offSeg);
     1487    int rc = RTDbgModLineAdd(hMod, pszFile, uLineNo, iSeg, offSeg, piOrdinal);
    14851488    RTDbgModRelease(hMod);
    14861489    return rc;
  • trunk/src/VBox/Runtime/common/dbg/dbgmod.cpp

    r20740 r20744  
    405405 * @param   cb              The size of the symbol.
    406406 * @param   fFlags          Symbol flags.
    407  */
    408 RTDECL(int) RTDbgModSymbolAdd(RTDBGMOD hDbgMod, const char *pszSymbol, RTDBGSEGIDX iSeg, RTUINTPTR off, RTUINTPTR cb, uint32_t fFlags)
     407 * @param   piOrdinal       Where to return the symbol ordinal on success. If
     408 *                          the interpreter doesn't do ordinals, this will be set to
     409 *                          UINT32_MAX. Optional
     410 */
     411RTDECL(int) RTDbgModSymbolAdd(RTDBGMOD hDbgMod, const char *pszSymbol, RTDBGSEGIDX iSeg, RTUINTPTR off, RTUINTPTR cb, uint32_t fFlags, uint32_t *piOrdinal)
    409412{
    410413    /*
     
    442445     * Get down to business.
    443446     */
    444     int rc = pDbgMod->pDbgVt->pfnSymbolAdd(pDbgMod, pszSymbol, cchSymbol, iSeg, off, cb, fFlags);
     447    int rc = pDbgMod->pDbgVt->pfnSymbolAdd(pDbgMod, pszSymbol, cchSymbol, iSeg, off, cb, fFlags, piOrdinal);
    445448
    446449    RTDBGMOD_UNLOCK(pDbgMod);
     
    498501 * @param   iSeg            The segment index.
    499502 * @param   off             The segment offset.
    500  */
    501 RTDECL(int) RTDbgModLineAdd(RTDBGMOD hDbgMod, const char *pszFile, uint32_t uLineNo, RTDBGSEGIDX iSeg, RTUINTPTR off)
     503 * @param   piOrdinal       Where to return the line number ordinal on success.
     504 *                          If the interpreter doesn't do ordinals, this will be
     505 *                          set to UINT32_MAX. Optional.
     506 */
     507RTDECL(int) RTDbgModLineAdd(RTDBGMOD hDbgMod, const char *pszFile, uint32_t uLineNo, RTDBGSEGIDX iSeg, RTUINTPTR off, uint32_t *piOrdinal)
    502508{
    503509    /*
     
    534540     * Get down to business.
    535541     */
    536     int rc = pDbgMod->pDbgVt->pfnLineAdd(pDbgMod, pszFile, cchFile, uLineNo, iSeg, off);
     542    int rc = pDbgMod->pDbgVt->pfnLineAdd(pDbgMod, pszFile, cchFile, uLineNo, iSeg, off, piOrdinal);
    537543
    538544    RTDBGMOD_UNLOCK(pDbgMod);
  • trunk/src/VBox/Runtime/common/dbg/dbgmodcontainer.cpp

    r20740 r20744  
    1919 * Symbol entry.
    2020 */
    21 typedef struct RTDBGMODCONTAINERSYMBOL
     21typedef struct RTDBGMODCTNSYMBOL
    2222{
    2323    /** The address core. */
     
    2525    /** The name space core. */
    2626    RTSTRSPACECORE              NameCore;
     27    /** The ordinal number core. */
     28    AVLU32NODECORE              OrdinalCore;
    2729    /** The segment index. */
    2830    RTDBGSEGIDX                 iSeg;
     
    3234     * This may be zero while the range in AddrCore indicates 0. */
    3335    RTUINTPTR                   cb;
    34 } RTDBGMODCONTAINERSYMBOL;
     36} RTDBGMODCTNSYMBOL;
    3537/** Pointer to a symbol entry in the debug info container. */
    36 typedef RTDBGMODCONTAINERSYMBOL *PRTDBGMODCONTAINERSYMBOL;
     38typedef RTDBGMODCTNSYMBOL *PRTDBGMODCTNSYMBOL;
    3739/** Pointer to a const symbol entry in the debug info container. */
    38 typedef RTDBGMODCONTAINERSYMBOL const *PCRTDBGMODCONTAINERSYMBOL;
     40typedef RTDBGMODCTNSYMBOL const *PCRTDBGMODCTNSYMBOL;
    3941
    4042/**
    4143 * Line number entry.
    4244 */
    43 typedef struct RTDBGMODCONTAINERLINE
     45typedef struct RTDBGMODCTNLINE
    4446{
    4547    /** The address core.
    4648     * The Key is the address of the line number. */
    47     AVLUINTPTRNODECORE  AddrCore;
     49    AVLUINTPTRNODECORE          AddrCore;
     50    /** The ordinal number core. */
     51    AVLU32NODECORE              OrdinalCore;
    4852    /** Pointer to the file name (in string cache). */
    49     const char         *pszFile;
     53    const char                 *pszFile;
    5054    /** The line number. */
    51     uint32_t            uLineNo;
    52 } RTDBGMODCONTAINERLINE;
     55    uint32_t                    uLineNo;
     56    /** The segment index. */
     57    RTDBGSEGIDX                 iSeg;
     58} RTDBGMODCTNLINE;
    5359/** Pointer to a line number entry. */
    54 typedef RTDBGMODCONTAINERLINE *PRTDBGMODCONTAINERLINE;
     60typedef RTDBGMODCTNLINE *PRTDBGMODCTNLINE;
    5561/** Pointer to const a line number entry. */
    56 typedef RTDBGMODCONTAINERLINE const *PCRTDBGMODCONTAINERLINE;
     62typedef RTDBGMODCTNLINE const *PCRTDBGMODCTNLINE;
    5763
    5864/**
    5965 * Segment entry.
    6066 */
    61 typedef struct RTDBGMODCONTAINERSEGMENT
     67typedef struct RTDBGMODCTNSEGMENT
    6268{
    6369    /** The symbol address space tree. */
     
    7177    /** The segment name. */
    7278    const char                 *pszName;
    73 } RTDBGMODCONTAINERSEGMENT;
     79} RTDBGMODCTNSEGMENT;
    7480/** Pointer to a segment entry in the debug info container. */
    75 typedef RTDBGMODCONTAINERSEGMENT *PRTDBGMODCONTAINERSEGMENT;
     81typedef RTDBGMODCTNSEGMENT *PRTDBGMODCTNSEGMENT;
    7682/** Pointer to a const segment entry in the debug info container. */
    77 typedef RTDBGMODCONTAINERSEGMENT const *PCRTDBGMODCONTAINERSEGMENT;
     83typedef RTDBGMODCTNSEGMENT const *PCRTDBGMODCTNSEGMENT;
    7884
    7985/**
    8086 * Instance data.
    8187 */
    82 typedef struct RTDBGMODCONTAINER
     88typedef struct RTDBGMODCTN
    8389{
    8490    /** The name space. */
     
    8692    /** Tree containing any absolute addresses. */
    8793    AVLRUINTPTRTREE             AbsAddrTree;
     94    /** Tree organizing the symbols by ordinal number. */
     95    AVLU32TREE                  SymbolOrdinalTree;
     96     /** Tree organizing the line numbers by ordinal number. */
     97    AVLU32TREE                  LineOrdinalTree;
    8898    /** Segment table. */
    89     PRTDBGMODCONTAINERSEGMENT   paSegs;
     99    PRTDBGMODCTNSEGMENT         paSegs;
    90100    /** The number of segments in the segment table. */
    91101    RTDBGSEGIDX                 cSegs;
    92102    /** The image size. 0 means unlimited. */
    93103    RTUINTPTR                   cb;
    94 } RTDBGMODCONTAINER;
     104    /** The next symbol ordinal. */
     105    uint32_t                    iNextSymbolOrdinal;
     106    /** The next line number ordinal. */
     107    uint32_t                    iNextLineOrdinal;
     108} RTDBGMODCTN;
    95109/** Pointer to instance data for the debug info container. */
    96 typedef RTDBGMODCONTAINER *PRTDBGMODCONTAINER;
     110typedef RTDBGMODCTN *PRTDBGMODCTN;
    97111
    98112
     
    104118 * @param   pExtSym         The external symbol representation.
    105119 */
    106 DECLINLINE(int) rtDbgModContainerReturnSymbol(PCRTDBGMODCONTAINERSYMBOL pMySym, PRTDBGSYMBOL pExtSym)
    107 {
    108     pExtSym->Value  = pMySym->AddrCore.Key;
    109     pExtSym->offSeg = pMySym->AddrCore.Key;
    110     pExtSym->iSeg   = pMySym->iSeg;
    111     pExtSym->fFlags = pMySym->fFlags;
    112     pExtSym->cb     = pMySym->cb;
     120DECLINLINE(int) rtDbgModContainerReturnSymbol(PCRTDBGMODCTNSYMBOL pMySym, PRTDBGSYMBOL pExtSym)
     121{
     122    pExtSym->Value    = pMySym->AddrCore.Key;
     123    pExtSym->offSeg   = pMySym->AddrCore.Key;
     124    pExtSym->iSeg     = pMySym->iSeg;
     125    pExtSym->fFlags   = pMySym->fFlags;
     126    pExtSym->cb       = pMySym->cb;
     127    pExtSym->iOrdinal = pMySym->OrdinalCore.Key;
    113128    Assert(pMySym->NameCore.cchString < sizeof(pExtSym->szName));
    114129    memcpy(pExtSym->szName, pMySym->NameCore.pszString, pMySym->NameCore.cchString + 1);
     
    122137                                                      PRTINTPTR poffDisp, PRTDBGLINE pLine)
    123138{
    124     PRTDBGMODCONTAINER pThis = (PRTDBGMODCONTAINER)pMod->pvDbgPriv;
     139    PRTDBGMODCTN pThis = (PRTDBGMODCTN)pMod->pvDbgPriv;
    125140
    126141    /*
     
    139154    PAVLUINTPTRNODECORE pAvlCore = RTAvlUIntPtrGetBestFit(&pThis->paSegs[iSeg].LineAddrTree, off, false /*fAbove*/);
    140155    if (!pAvlCore)
    141         return VERR_SYMBOL_NOT_FOUND;
    142     PCRTDBGMODCONTAINERLINE pMyLine = RT_FROM_MEMBER(pAvlCore, RTDBGMODCONTAINERLINE const, AddrCore);
    143     if (poffDisp)
    144         *poffDisp = off - pMyLine->AddrCore.Key;
     156        return pThis->iNextLineOrdinal
     157             ? VERR_DBG_LINE_NOT_FOUND
     158             : VERR_DBG_NO_LINE_NUMBERS;
     159    PCRTDBGMODCTNLINE pMyLine = RT_FROM_MEMBER(pAvlCore, RTDBGMODCTNLINE const, AddrCore);
    145160    pLine->Address = pMyLine->AddrCore.Key;
    146161    pLine->offSeg  = pMyLine->AddrCore.Key;
    147162    pLine->iSeg    = iSeg;
    148163    pLine->uLineNo = pMyLine->uLineNo;
     164    pLine->iOrdinal = pMyLine->OrdinalCore.Key;
     165    strcpy(pLine->szFilename, pMyLine->pszFile);
     166    if (poffDisp)
     167        *poffDisp = off - pMyLine->AddrCore.Key;
     168    return VINF_SUCCESS;
     169}
     170
     171
     172/** @copydoc RTDBGMODVTDBG::pfnLineByOrdinal */
     173static DECLCALLBACK(int) rtDbgModContainer_LineByOrdinal(PRTDBGMODINT pMod, uint32_t iOrdinal, PRTDBGLINE pLine)
     174{
     175    PRTDBGMODCTN pThis = (PRTDBGMODCTN)pMod->pvDbgPriv;
     176
     177    /*
     178     * Look it up.
     179     */
     180    if (iOrdinal >= pThis->iNextLineOrdinal)
     181        return pThis->iNextLineOrdinal
     182             ? VERR_DBG_LINE_NOT_FOUND
     183             : VERR_DBG_NO_LINE_NUMBERS;
     184    PAVLU32NODECORE pAvlCore = RTAvlU32Get(&pThis->LineOrdinalTree, iOrdinal);
     185    AssertReturn(pAvlCore, VERR_DBG_LINE_NOT_FOUND);
     186    PCRTDBGMODCTNLINE pMyLine = RT_FROM_MEMBER(pAvlCore, RTDBGMODCTNLINE const, OrdinalCore);
     187    pLine->Address  = pMyLine->AddrCore.Key;
     188    pLine->offSeg   = pMyLine->AddrCore.Key;
     189    pLine->iSeg     = pMyLine->iSeg;
     190    pLine->uLineNo  = pMyLine->uLineNo;
     191    pLine->iOrdinal = pMyLine->OrdinalCore.Key;
    149192    strcpy(pLine->szFilename, pMyLine->pszFile);
    150193    return VINF_SUCCESS;
     
    152195
    153196
     197/** @copydoc RTDBGMODVTDBG::pfnLineCount */
     198static DECLCALLBACK(uint32_t) rtDbgModContainer_LineCount(PRTDBGMODINT pMod)
     199{
     200    PRTDBGMODCTN pThis = (PRTDBGMODCTN)pMod->pvDbgPriv;
     201
     202    /* Note! The ordinal numbers are 0-based. */
     203    return pThis->iNextLineOrdinal;
     204}
     205
     206
    154207/** @copydoc RTDBGMODVTDBG::pfnLineAdd */
    155208static DECLCALLBACK(int) rtDbgModContainer_LineAdd(PRTDBGMODINT pMod, const char *pszFile, size_t cchFile, uint32_t uLineNo,
    156                                                    uint32_t iSeg, RTUINTPTR off)
    157 {
    158     PRTDBGMODCONTAINER pThis = (PRTDBGMODCONTAINER)pMod->pvDbgPriv;
     209                                                   uint32_t iSeg, RTUINTPTR off, uint32_t *piOrdinal)
     210{
     211    PRTDBGMODCTN pThis = (PRTDBGMODCTN)pMod->pvDbgPriv;
    159212
    160213    /*
     
    169222     * Create a new entry.
    170223     */
    171     PRTDBGMODCONTAINERLINE pLine = (PRTDBGMODCONTAINERLINE)RTMemAllocZ(sizeof(*pLine));
     224    PRTDBGMODCTNLINE pLine = (PRTDBGMODCTNLINE)RTMemAllocZ(sizeof(*pLine));
    172225    if (!pLine)
    173226        return VERR_NO_MEMORY;
    174     pLine->AddrCore.Key = off;
    175     pLine->uLineNo = uLineNo;
    176     pLine->pszFile = RTStrCacheEnterN(g_hDbgModStrCache, pszFile, cchFile);
     227    pLine->AddrCore.Key     = off;
     228    pLine->OrdinalCore.Key  = pThis->iNextLineOrdinal;
     229    pLine->uLineNo          = uLineNo;
     230    pLine->iSeg             = iSeg;
     231    pLine->pszFile          = RTStrCacheEnterN(g_hDbgModStrCache, pszFile, cchFile);
    177232    int rc;
    178233    if (pLine->pszFile)
    179234    {
    180235        if (RTAvlUIntPtrInsert(&pThis->paSegs[iSeg].LineAddrTree, &pLine->AddrCore))
    181             return VINF_SUCCESS;
     236        {
     237            if (RTAvlU32Insert(&pThis->LineOrdinalTree, &pLine->OrdinalCore))
     238            {
     239                if (piOrdinal)
     240                    *piOrdinal = pThis->iNextLineOrdinal;
     241                pThis->iNextLineOrdinal++;
     242                return VINF_SUCCESS;
     243            }
     244
     245            rc = VERR_INTERNAL_ERROR_5;
     246            RTAvlUIntPtrRemove(&pThis->paSegs[iSeg].LineAddrTree, pLine->AddrCore.Key);
     247        }
    182248
    183249        /* bail out */
     
    196262                                                        PRTINTPTR poffDisp, PRTDBGSYMBOL pSymbol)
    197263{
    198     PRTDBGMODCONTAINER pThis = (PRTDBGMODCONTAINER)pMod->pvDbgPriv;
     264    PRTDBGMODCTN pThis = (PRTDBGMODCTN)pMod->pvDbgPriv;
    199265
    200266    /*
     
    220286    if (!pAvlCore)
    221287        return VERR_SYMBOL_NOT_FOUND;
    222     PCRTDBGMODCONTAINERSYMBOL pMySym = RT_FROM_MEMBER(pAvlCore, RTDBGMODCONTAINERSYMBOL const, AddrCore);
     288    PCRTDBGMODCTNSYMBOL pMySym = RT_FROM_MEMBER(pAvlCore, RTDBGMODCTNSYMBOL const, AddrCore);
    223289    if (poffDisp)
    224290        *poffDisp = off - pMySym->AddrCore.Key;
     
    230296static DECLCALLBACK(int) rtDbgModContainer_SymbolByName(PRTDBGMODINT pMod, const char *pszSymbol, PRTDBGSYMBOL pSymbol)
    231297{
    232     PRTDBGMODCONTAINER pThis = (PRTDBGMODCONTAINER)pMod->pvDbgPriv;
     298    PRTDBGMODCTN pThis = (PRTDBGMODCTN)pMod->pvDbgPriv;
    233299
    234300    /*
     
    238304    if (!pStrCore)
    239305        return VERR_SYMBOL_NOT_FOUND;
    240     PCRTDBGMODCONTAINERSYMBOL pMySym = RT_FROM_MEMBER(pStrCore, RTDBGMODCONTAINERSYMBOL const, NameCore);
     306    PCRTDBGMODCTNSYMBOL pMySym = RT_FROM_MEMBER(pStrCore, RTDBGMODCTNSYMBOL const, NameCore);
    241307    return rtDbgModContainerReturnSymbol(pMySym, pSymbol);
     308}
     309
     310
     311/** @copydoc RTDBGMODVTDBG::pfnSymbolByOrdinal */
     312static DECLCALLBACK(int) rtDbgModContainer_SymbolByOrdinal(PRTDBGMODINT pMod, uint32_t iOrdinal, PRTDBGSYMBOL pSymbol)
     313{
     314    PRTDBGMODCTN pThis = (PRTDBGMODCTN)pMod->pvDbgPriv;
     315
     316    /*
     317     * Look it up in the ordinal tree.
     318     */
     319    if (iOrdinal >= pThis->iNextSymbolOrdinal)
     320        return pThis->iNextSymbolOrdinal
     321             ? VERR_DBG_NO_SYMBOLS
     322             : VERR_SYMBOL_NOT_FOUND;
     323    PAVLU32NODECORE pAvlCore = RTAvlU32Get(&pThis->SymbolOrdinalTree, iOrdinal);
     324    AssertReturn(pAvlCore, VERR_SYMBOL_NOT_FOUND);
     325    PCRTDBGMODCTNSYMBOL pMySym = RT_FROM_MEMBER(pAvlCore, RTDBGMODCTNSYMBOL const, OrdinalCore);
     326    return rtDbgModContainerReturnSymbol(pMySym, pSymbol);
     327}
     328
     329
     330/** @copydoc RTDBGMODVTDBG::pfnSymbolCount */
     331static DECLCALLBACK(uint32_t) rtDbgModContainer_SymbolCount(PRTDBGMODINT pMod)
     332{
     333    PRTDBGMODCTN pThis = (PRTDBGMODCTN)pMod->pvDbgPriv;
     334
     335    /* Note! The ordinal numbers are 0-based. */
     336    return pThis->iNextSymbolOrdinal;
    242337}
    243338
     
    245340/** @copydoc RTDBGMODVTDBG::pfnSymbolAdd */
    246341static DECLCALLBACK(int) rtDbgModContainer_SymbolAdd(PRTDBGMODINT pMod, const char *pszSymbol, size_t cchSymbol,
    247                                                      RTDBGSEGIDX iSeg, RTUINTPTR off, RTUINTPTR cb, uint32_t fFlags)
    248 {
    249     PRTDBGMODCONTAINER pThis = (PRTDBGMODCONTAINER)pMod->pvDbgPriv;
     342                                                     RTDBGSEGIDX iSeg, RTUINTPTR off, RTUINTPTR cb, uint32_t fFlags,
     343                                                     uint32_t *piOrdinal)
     344{
     345    PRTDBGMODCTN pThis = (PRTDBGMODCTN)pMod->pvDbgPriv;
    250346
    251347    /*
     
    264360     * Create a new entry.
    265361     */
    266     PRTDBGMODCONTAINERSYMBOL pSymbol = (PRTDBGMODCONTAINERSYMBOL)RTMemAllocZ(sizeof(*pSymbol));
     362    PRTDBGMODCTNSYMBOL pSymbol = (PRTDBGMODCTNSYMBOL)RTMemAllocZ(sizeof(*pSymbol));
    267363    if (!pSymbol)
    268364        return VERR_NO_MEMORY;
     
    270366    pSymbol->AddrCore.Key       = off;
    271367    pSymbol->AddrCore.KeyLast   = off + RT_MIN(cb, 1);
     368    pSymbol->OrdinalCore.Key    = pThis->iNextSymbolOrdinal;
    272369    pSymbol->iSeg               = iSeg;
    273370    pSymbol->cb                 = cb;
     
    279376        if (RTStrSpaceInsert(&pThis->Names, &pSymbol->NameCore))
    280377        {
    281             if (RTAvlrUIntPtrInsert(  iSeg == RTDBGSEGIDX_ABS
    282                                     ? &pThis->AbsAddrTree
    283                                     : &pThis->paSegs[iSeg].SymAddrTree,
    284                                     &pSymbol->AddrCore))
    285                 return VINF_SUCCESS;
    286 
    287             /* bail out */
    288             rc = VERR_DBG_ADDRESS_CONFLICT;
     378            PAVLRUINTPTRTREE pAddrTree = iSeg == RTDBGSEGIDX_ABS
     379                                       ? &pThis->AbsAddrTree
     380                                       : &pThis->paSegs[iSeg].SymAddrTree;
     381            if (RTAvlrUIntPtrInsert(pAddrTree, &pSymbol->AddrCore))
     382            {
     383                if (RTAvlU32Insert(&pThis->LineOrdinalTree, &pSymbol->OrdinalCore))
     384                {
     385                    if (piOrdinal)
     386                        *piOrdinal = pThis->iNextSymbolOrdinal;
     387                    pThis->iNextSymbolOrdinal++;
     388                    return VINF_SUCCESS;
     389                }
     390
     391                /* bail out */
     392                rc = VERR_INTERNAL_ERROR_5;
     393                RTAvlrUIntPtrRemove(pAddrTree, pSymbol->AddrCore.Key);
     394            }
     395            else
     396                rc = VERR_DBG_ADDRESS_CONFLICT;
    289397            RTStrSpaceRemove(&pThis->Names, pSymbol->NameCore.pszString);
    290398        }
     
    303411static DECLCALLBACK(RTDBGSEGIDX) rtDbgModContainer_RvaToSegOff(PRTDBGMODINT pMod, RTUINTPTR uRva, PRTUINTPTR poffSeg)
    304412{
    305     PRTDBGMODCONTAINER          pThis = (PRTDBGMODCONTAINER)pMod->pvDbgPriv;
    306     PCRTDBGMODCONTAINERSEGMENT  paSeg = pThis->paSegs;
     413    PRTDBGMODCTN          pThis = (PRTDBGMODCTN)pMod->pvDbgPriv;
     414    PCRTDBGMODCTNSEGMENT  paSeg = pThis->paSegs;
    307415    uint32_t const              cSegs = pThis->cSegs;
    308416    if (cSegs <= 7)
     
    366474static DECLCALLBACK(int)  rtDbgModContainer_DestroyTreeNode(PAVLRUINTPTRNODECORE pNode, void *pvUser)
    367475{
    368     PRTDBGMODCONTAINERSYMBOL pSym = RT_FROM_MEMBER(pNode, RTDBGMODCONTAINERSYMBOL, AddrCore);
     476    PRTDBGMODCTNSYMBOL pSym = RT_FROM_MEMBER(pNode, RTDBGMODCTNSYMBOL, AddrCore);
    369477    RTStrCacheRelease(g_hDbgModStrCache, pSym->NameCore.pszString);
    370478    pSym->NameCore.pszString = NULL;
     
    377485static DECLCALLBACK(int) rtDbgModContainer_Close(PRTDBGMODINT pMod)
    378486{
    379     PRTDBGMODCONTAINER pThis = (PRTDBGMODCONTAINER)pMod->pvDbgPriv;
     487    PRTDBGMODCTN pThis = (PRTDBGMODCTN)pMod->pvDbgPriv;
    380488
    381489    /*
     
    416524    /*.pfnClose = */            rtDbgModContainer_Close,
    417525    /*.pfnRvaToSegOff = */      rtDbgModContainer_RvaToSegOff,
     526
     527    /*.pfnSegmentAdd = */       NULL,//rtDbgModContainer_SegmentAdd,
     528    /*.pfnSegmentCount = */     NULL,//rtDbgModContainer_SegmentCount,
     529    /*.pfnSegmentByIndex = */   NULL,//rtDbgModContainer_SegmentByIndex,
     530
    418531    /*.pfnSymbolAdd = */        rtDbgModContainer_SymbolAdd,
     532    /*.pfnSymbolCount = */      rtDbgModContainer_SymbolCount,
     533    /*.pfnSymbolByOrdinal = */  rtDbgModContainer_SymbolByOrdinal,
    419534    /*.pfnSymbolByName = */     rtDbgModContainer_SymbolByName,
    420535    /*.pfnSymbolByAddr = */     rtDbgModContainer_SymbolByAddr,
     536
    421537    /*.pfnLineAdd = */          rtDbgModContainer_LineAdd,
     538    /*.pfnLineCount = */        rtDbgModContainer_LineCount,
     539    /*.pfnLineByOrdinal = */    rtDbgModContainer_LineByOrdinal,
    422540    /*.pfnLineByAddr = */       rtDbgModContainer_LineByAddr,
     541
    423542    /*.u32EndMagic = */         RTDBGMODVTDBG_MAGIC
    424543};
     
    435554int rtDbgModContainerCreate(PRTDBGMODINT pMod, RTUINTPTR cb)
    436555{
    437     PRTDBGMODCONTAINER pThis = (PRTDBGMODCONTAINER)RTMemAlloc(sizeof(*pThis));
     556    PRTDBGMODCTN pThis = (PRTDBGMODCTN)RTMemAlloc(sizeof(*pThis));
    438557    if (!pThis)
    439558        return VERR_NO_MEMORY;
     
    441560    pThis->Names = NULL;
    442561    pThis->AbsAddrTree = NULL;
     562    pThis->SymbolOrdinalTree = NULL;
     563    pThis->LineOrdinalTree = NULL;
    443564    pThis->paSegs = NULL;
    444565    pThis->cSegs = 0;
    445     pThis->cb = cb;
     566    pThis->cb = cb; /** @todo the module size stuff doesn't quite make sense yet. Need to look at segments first, I guess. */
     567    pThis->iNextSymbolOrdinal = 0;
     568    pThis->iNextLineOrdinal = 0;
    446569
    447570    pMod->pDbgVt = &g_rtDbgModVtDbgContainer;
  • trunk/src/VBox/Runtime/include/internal/dbgmod.h

    r20740 r20744  
    6666     * This combines probing and opening.
    6767     *
    68      * @returns VBox status code. No informational returns defined.
     68     * @returns IPRT status code. No informational returns defined.
    6969     *
    7070     * @param   pMod        Pointer to the module that is being opened.
     
    116116     * This combines probing and opening.
    117117     *
    118      * @returns VBox status code. No informational returns defined.
     118     * @returns IPRT status code. No informational returns defined.
    119119     *
    120120     * @param   pMod        Pointer to the module that is being opened.
     
    143143    DECLCALLBACKMEMBER(int, pfnClose)(PRTDBGMODINT pMod);
    144144
     145
     146
    145147    /**
    146148     * Converts an image relative virtual address address to a segmented address.
     
    153155    DECLCALLBACKMEMBER(RTDBGSEGIDX, pfnRvaToSegOff)(PRTDBGMODINT pMod, RTUINTPTR uRva, PRTUINTPTR poffSeg);
    154156
     157
     158
     159    /**
     160     * Adds a segment to the module (optional).
     161     *
     162     * @returns IPRT status code.
     163     * @retval  VERR_NOT_SUPPORTED if the interpreter doesn't support this feature.
     164     * @retval  VERR_DBG_SEGMENT_INDEX_CONFLICT if the segment index exists already.
     165     *
     166     * @param   pMod        Pointer to the module structure.
     167     * @param   uRva        The segment image relative address.
     168     * @param   cb          The segment size.
     169     * @param   pszName     The segment name.
     170     * @param   cchName     The length of the segment name.
     171     * @param   fFlags      Segment flags.
     172     * @param   piSeg       The segment index or NIL_RTDBGSEGIDX on input.
     173     *                      The assigned segment index on successful return.
     174     *                      Optional.
     175     */
     176    DECLCALLBACKMEMBER(int, pfnSegmentAdd)(PRTDBGMODINT pMod, RTUINTPTR uRva, RTUINTPTR cb, const char *pszName, size_t cchName,
     177                                           uint32_t fFlags, PRTDBGSEGIDX piSeg);
     178
     179    /**
     180     * Gets the segment count.
     181     *
     182     * @returns Number of segments.
     183     * @retval  NIL_RTDBGSEGIDX if unknown.
     184     *
     185     * @param   pMod        Pointer to the module structure.
     186     */
     187    DECLCALLBACKMEMBER(RTDBGSEGIDX, pfnSegmentCount)(PRTDBGMODINT pMod);
     188
     189    /**
     190     * Gets information about a segment.
     191     *
     192     * @returns IPRT status code.
     193     * @retval  VERR_DBG_INVALID_SEGMENT_INDEX if iSeg is too high.
     194     *
     195     * @param   pMod        Pointer to the module structure.
     196     * @param   iSeg        The segment.
     197     * @param   pSegInfo    Where to store the segment information.
     198     */
     199    DECLCALLBACKMEMBER(int, pfnSegmentByIndex)(PRTDBGMODINT pMod, RTDBGSEGIDX iSeg, RTDBGSEGMENT pSegInfo);
     200
     201
     202
    155203    /**
    156204     * Adds a symbol to the module (optional).
    157205     *
    158      * @returns VBox status code.
     206     * @returns IPRT code.
    159207     * @retval  VERR_NOT_SUPPORTED if the interpreter doesn't support this feature.
    160208     *
     
    165213     * @param   off         The offset into the segment.
    166214     * @param   cb          The area covered by the symbol. 0 is fine.
     215     * @param   piOrdinal   Where to return the symbol ordinal on success. If the
     216     *                      interpreter doesn't do ordinals, this will be set to
     217     *                      UINT32_MAX. Optional
    167218     */
    168219    DECLCALLBACKMEMBER(int, pfnSymbolAdd)(PRTDBGMODINT pMod, const char *pszSymbol, size_t cchSymbol,
    169                                           uint32_t iSeg, RTUINTPTR off, RTUINTPTR cb, uint32_t fFlags);
     220                                          uint32_t iSeg, RTUINTPTR off, RTUINTPTR cb, uint32_t fFlags,
     221                                          uint32_t *piOrdinal);
     222
     223    /**
     224     * Gets the number of symbols in the module.
     225     *
     226     * This is used for figuring out the max value to pass to pfnSymbolByIndex among
     227     * other things.
     228     *
     229     * @returns The number of symbols, UINT32_MAX if not known/supported.
     230     *
     231     * @param   pMod        Pointer to the module structure.
     232     */
     233    DECLCALLBACKMEMBER(uint32_t, pfnSymbolCount)(PRTDBGMODINT pMod);
     234
     235    /**
     236     * Queries symbol information by ordinal number.
     237     *
     238     * @returns IPRT status code.
     239     * @retval  VINF_SUCCESS on success, no informational status code.
     240     * @retval  VERR_DBG_NO_SYMBOLS if there aren't any symbols.
     241     * @retval  VERR_NOT_SUPPORTED if lookup by ordinal is not supported.
     242     * @retval  VERR_SYMBOL_NOT_FOUND if there is no symbol at that index.
     243     *
     244     * @param   pMod        Pointer to the module structure.
     245     * @param   iSymbol     The symbol ordinal number.
     246     * @param   pSymbol     Where to store the symbol information.
     247     */
     248    DECLCALLBACKMEMBER(int, pfnSymbolByOrdinal)(PRTDBGMODINT pMod, uint32_t iSymbol, PRTDBGSYMBOL pSymbol);
    170249
    171250    /**
    172251     * Queries symbol information by symbol name.
    173252     *
    174      * @returns VBox status code.
     253     * @returns IPRT status code.
    175254     * @retval  VINF_SUCCESS on success, no informational status code.
    176      * @retval  VERR_RTDBGMOD_NO_SYMBOLS if there aren't any symbols.
     255     * @retval  VERR_DBG_NO_SYMBOLS if there aren't any symbols.
    177256     * @retval  VERR_SYMBOL_NOT_FOUND if no suitable symbol was found.
    178257     *
     
    190269     * address equal or lower than the requested.
    191270     *
    192      * @returns VBox status code.
     271     * @returns IPRT status code.
    193272     * @retval  VINF_SUCCESS on success, no informational status code.
    194      * @retval  VERR_RTDBGMOD_NO_SYMBOLS if there aren't any symbols.
     273     * @retval  VERR_DBG_NO_SYMBOLS if there aren't any symbols.
    195274     * @retval  VERR_SYMBOL_NOT_FOUND if no suitable symbol was found.
    196275     *
     
    204283    DECLCALLBACKMEMBER(int, pfnSymbolByAddr)(PRTDBGMODINT pMod, uint32_t iSeg, RTUINTPTR off, PRTINTPTR poffDisp, PRTDBGSYMBOL pSymbol);
    205284
     285
     286
    206287    /**
    207288     * Adds a line number to the module (optional).
    208289     *
    209      * @returns VBox status code.
     290     * @returns IPRT status code.
    210291     * @retval  VERR_NOT_SUPPORTED if the interpreter doesn't support this feature.
    211292     *
     
    215296     * @param   iSeg        The segment number (0-based).
    216297     * @param   off         The offset into the segment.
    217      */
    218     DECLCALLBACKMEMBER(int, pfnLineAdd)(PRTDBGMODINT pMod, const char *pszFile, size_t cchFile, uint32_t uLineNo, uint32_t iSeg, RTUINTPTR off);
     298     * @param   piOrdinal   Where to return the line number ordinal on success. If
     299     *                      the interpreter doesn't do ordinals, this will be set to
     300     *                      UINT32_MAX. Optional
     301     */
     302    DECLCALLBACKMEMBER(int, pfnLineAdd)(PRTDBGMODINT pMod, const char *pszFile, size_t cchFile, uint32_t uLineNo,
     303                                        uint32_t iSeg, RTUINTPTR off, uint32_t *piOrdinal);
     304
     305    /**
     306     * Gets the number of line numbers in the module.
     307     *
     308     * @returns The number or UINT32_MAX if not known/supported.
     309     *
     310     * @param   pMod        Pointer to the module structure.
     311     */
     312    DECLCALLBACKMEMBER(uint32_t, pfnLineCount)(PRTDBGMODINT pMod);
     313
     314    /**
     315     * Queries line number information by ordinal number.
     316     *
     317     * @returns IPRT status code.
     318     * @retval  VINF_SUCCESS on success, no informational status code.
     319     * @retval  VERR_DBG_NO_LINE_NUMBERS if there aren't any line numbers.
     320     * @retval  VERR_DBG_LINE_NOT_FOUND if there is no line number with that
     321     *          ordinal.
     322     *
     323     * @param   pMod        Pointer to the module structure.
     324     * @param   iOrdinal    The line number ordinal number.
     325     * @param   pLine       Where to store the information about the line number.
     326     */
     327    DECLCALLBACKMEMBER(int, pfnLineByOrdinal)(PRTDBGMODINT pMod, uint32_t iOrdinal, PRTDBGLINE pLine);
    219328
    220329    /**
    221330     * Queries line number information by address.
    222331     *
    223      * @returns VBox status code.
     332     * @returns IPRT status code.
    224333     * @retval  VINF_SUCCESS on success, no informational status code.
    225      * @retval  VERR_RTDBGMOD_NO_LINE_NUMBERS if there aren't any line numbers.
    226      * @retval  VERR_RTDBGMOD_LINE_NOT_FOUND if no suitable line number was found.
     334     * @retval  VERR_DBG_NO_LINE_NUMBERS if there aren't any line numbers.
     335     * @retval  VERR_DBG_LINE_NOT_FOUND if no suitable line number was found.
    227336     *
    228337     * @param   pMod        Pointer to the module structure.
     
    234343     */
    235344    DECLCALLBACKMEMBER(int, pfnLineByAddr)(PRTDBGMODINT pMod, uint32_t iSeg, RTUINTPTR off, PRTINTPTR poffDisp, PRTDBGLINE pLine);
     345
    236346
    237347    /** For catching initialization errors (RTDBGMODVTDBG_MAGIC). */
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