VirtualBox

Changeset 38547 in vbox for trunk/include/iprt


Ignore:
Timestamp:
Aug 26, 2011 12:58:47 PM (13 years ago)
Author:
vboxsync
Message:

IPRT: More debug info hacking.

Location:
trunk/include/iprt
Files:
2 edited

Legend:

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

    r38515 r38547  
    3838
    3939RT_C_DECLS_BEGIN
     40
     41/** Loader address (unsigned integer). */
     42typedef RTUINTPTR           RTLDRADDR;
     43/** Pointer to a loader address. */
     44typedef RTLDRADDR          *PRTLDRADDR;
     45/** Pointer to a const loader address. */
     46typedef RTLDRADDR const    *PCRTLDRADDR;
     47/** The max loader address value. */
     48#define RTLDRADDR_MAX       RTUINTPTR_MAX
     49/** NIL loader address value. */
     50#define NIL_RTLDRADDR       RTLDRADDR_MAX
    4051
    4152
     
    237248 * @param   pValue          Where to store the symbol value.
    238249 */
    239 RTDECL(int) RTLdrGetSymbolEx(RTLDRMOD hLdrMod, const void *pvBits, RTUINTPTR BaseAddress, const char *pszSymbol, RTUINTPTR *pValue);
     250RTDECL(int) RTLdrGetSymbolEx(RTLDRMOD hLdrMod, const void *pvBits, RTLDRADDR BaseAddress, const char *pszSymbol,
     251                             PRTLDRADDR pValue);
    240252
    241253/**
     
    261273 * @param   pvUser          User argument.
    262274 */
    263 typedef DECLCALLBACK(int) RTLDRIMPORT(RTLDRMOD hLdrMod, const char *pszModule, const char *pszSymbol, unsigned uSymbol, RTUINTPTR *pValue, void *pvUser);
     275typedef DECLCALLBACK(int) RTLDRIMPORT(RTLDRMOD hLdrMod, const char *pszModule, const char *pszSymbol, unsigned uSymbol,
     276                                      PRTLDRADDR pValue, void *pvUser);
    264277/** Pointer to a FNRTLDRIMPORT() callback function. */
    265278typedef RTLDRIMPORT *PFNRTLDRIMPORT;
     
    278291 * @remark  Not supported for RTLdrLoad() images.
    279292 */
    280 RTDECL(int) RTLdrGetBits(RTLDRMOD hLdrMod, void *pvBits, RTUINTPTR BaseAddress, PFNRTLDRIMPORT pfnGetImport, void *pvUser);
     293RTDECL(int) RTLdrGetBits(RTLDRMOD hLdrMod, void *pvBits, RTLDRADDR BaseAddress, PFNRTLDRIMPORT pfnGetImport, void *pvUser);
    281294
    282295/**
     
    294307 * @remark  Not supported for RTLdrLoad() images.
    295308 */
    296 RTDECL(int) RTLdrRelocate(RTLDRMOD hLdrMod, void *pvBits, RTUINTPTR NewBaseAddress, RTUINTPTR OldBaseAddress,
     309RTDECL(int) RTLdrRelocate(RTLDRMOD hLdrMod, void *pvBits, RTLDRADDR NewBaseAddress, RTLDRADDR OldBaseAddress,
    297310                          PFNRTLDRIMPORT pfnGetImport, void *pvUser);
    298311
     
    307320 * @param   pvUser          The user argument specified to RTLdrEnumSymbols().
    308321 */
    309 typedef DECLCALLBACK(int) RTLDRENUMSYMS(RTLDRMOD hLdrMod, const char *pszSymbol, unsigned uSymbol, RTUINTPTR Value, void *pvUser);
     322typedef DECLCALLBACK(int) RTLDRENUMSYMS(RTLDRMOD hLdrMod, const char *pszSymbol, unsigned uSymbol, RTLDRADDR Value, void *pvUser);
    310323/** Pointer to a RTLDRENUMSYMS() callback function. */
    311324typedef RTLDRENUMSYMS *PFNRTLDRENUMSYMS;
     
    324337 * @remark  Not supported for RTLdrLoad() images.
    325338 */
    326 RTDECL(int) RTLdrEnumSymbols(RTLDRMOD hLdrMod, unsigned fFlags, const void *pvBits, RTUINTPTR BaseAddress, PFNRTLDRENUMSYMS pfnCallback, void *pvUser);
     339RTDECL(int) RTLdrEnumSymbols(RTLDRMOD hLdrMod, unsigned fFlags, const void *pvBits, RTLDRADDR BaseAddress, PFNRTLDRENUMSYMS pfnCallback, void *pvUser);
    327340
    328341/** @name RTLdrEnumSymbols flags.
     
    377390 *                          if there isn't any specific file location.
    378391 * @param   LinkAddress     The link address of the debug info if it's
    379  *                          loadable. RTUINTPTR_MAX if not loadable.
     392 *                          loadable. NIL_RTLDRADDR if not loadable.
    380393 * @param   cb              The size of the debug information. -1 is used if
    381394 *                          this isn't applicable.
     
    387400typedef DECLCALLBACK(int) FNRTLDRENUMDBG(RTLDRMOD hLdrMod, uint32_t iDbgInfo, RTLDRDBGINFOTYPE enmType,
    388401                                         uint16_t iMajorVer, uint16_t iMinorVer, const char *pszPartNm,
    389                                          RTFOFF offFile, RTUINTPTR LinkAddress, RTUINTPTR cb,
     402                                         RTFOFF offFile, RTLDRADDR LinkAddress, RTLDRADDR cb,
    390403                                         const char *pszExtFile, void *pvUser);
    391404/** Pointer to a debug info enumerator callback. */
    392405typedef FNRTLDRENUMDBG *PFNRTLDRENUMDBG;
    393 
    394406
    395407/**
     
    407419RTDECL(int) RTLdrEnumDbgInfo(RTLDRMOD hLdrMod, const void *pvBits, PFNRTLDRENUMDBG pfnCallback, void *pvUser);
    408420
     421
     422/**
     423 * Loader segment.
     424 */
     425typedef struct RTLDRSEG
     426{
     427    /** The segment name. (Might not be zero terminated!) */
     428    const char     *pchName;
     429    /** The length of the segment name. */
     430    uint32_t        cchName;
     431    /** The flat selector to use for the segment (i.e. data/code).
     432     * Primarily a way for the user to specify selectors for the LX/LE and NE interpreters. */
     433    uint16_t        SelFlat;
     434    /** The 16-bit selector to use for the segment.
     435     * Primarily a way for the user to specify selectors for the LX/LE and NE interpreters. */
     436    uint16_t        Sel16bit;
     437    /** Segment flags. */
     438    uint32_t        fFlags;
     439    /** The segment protection (RTMEM_PROT_XXX). */
     440    uint32_t        fProt;
     441    /** The size of the segment. */
     442    RTLDRADDR       cb;
     443    /** The required segment alignment.
     444     * The to 0 if the segment isn't supposed to be mapped. */
     445    RTLDRADDR       Alignment;
     446    /** The link address.
     447     * Set to NIL_RTLDRADDR if the segment isn't supposed to be mapped or if
     448     * the image doesn't have link addresses. */
     449    RTLDRADDR       LinkAddress;
     450    /** File offset of the segment.
     451     * Set to -1 if no file backing (like BSS). */
     452    RTFOFF          offFile;
     453    /** Size of the file bits of the segment.
     454     * Set to -1 if no file backing (like BSS). */
     455    RTFOFF          cbFile;
     456    /** The relative virtual address when mapped.
     457     * Set to NIL_RTLDRADDR if the segment isn't supposed to be mapped. */
     458    RTLDRADDR       RVA;
     459    /** The size of the segment including the alignment gap up to the next segment when mapped.
     460     * This is set to NIL_RTLDRADDR if not implemented. */
     461    RTLDRADDR       cbMapped;
     462} RTLDRSEG;
     463/** Pointer to a loader segment. */
     464typedef RTLDRSEG *PRTLDRSEG;
     465/** Pointer to a read only loader segment. */
     466typedef RTLDRSEG const *PCRTLDRSEG;
     467
     468
     469/** @name Segment flags
     470 * @{ */
     471/** The segment is 16-bit. When not set the default of the target architecture is assumed. */
     472#define RTLDRSEG_FLAG_16BIT         UINT32_C(1)
     473/** The segment requires a 16-bit selector alias. (OS/2) */
     474#define RTLDRSEG_FLAG_OS2_ALIAS16   UINT32_C(2)
     475/** Conforming segment (x86 weirdness). (OS/2) */
     476#define RTLDRSEG_FLAG_OS2_CONFORM   UINT32_C(4)
     477/** IOPL (ring-2) segment. (OS/2) */
     478#define RTLDRSEG_FLAG_OS2_IOPL      UINT32_C(8)
     479/** @} */
     480
     481/**
     482 * Segment enumerator callback.
     483 *
     484 * @returns VINF_SUCCESS to continue the enumeration.  Any other status code
     485 *          will cause RTLdrEnumSegments to immediately return with that
     486 *          status.
     487 *
     488 * @param   hLdrMod         The module handle.
     489 * @param   pSeg            The segment information.
     490 * @param   pvUser          The user parameter specified to RTLdrEnumSegments.
     491 */
     492typedef DECLCALLBACK(int) FNRTLDRENUMSEGS(RTLDRMOD hLdrMod, PCRTLDRSEG pSeg, void *pvUser);
     493/** Pointer to a segment enumerator callback. */
     494typedef FNRTLDRENUMSEGS *PFNRTLDRENUMSEGS;
     495
     496/**
     497 * Enumerate the debug info contained in the executable image.
     498 *
     499 * @returns IPRT status code or whatever pfnCallback returns.
     500 *
     501 * @param   hLdrMod         The module handle.
     502 * @param   pfnCallback     The callback function.
     503 * @param   pvUser          The user argument.
     504 */
     505RTDECL(int) RTLdrEnumSegments(RTLDRMOD hLdrMod, PFNRTLDRENUMSEGS pfnCallback, void *pvUser);
     506
     507
    409508RT_C_DECLS_END
    410509
  • trunk/include/iprt/mangling.h

    r38539 r38547  
    552552# define RTLdrClose                                     RT_MANGLER(RTLdrClose)
    553553# define RTLdrEnumDbgInfo                               RT_MANGLER(RTLdrEnumDbgInfo)
     554# define RTLdrEnumSegments                              RT_MANGLER(RTLdrEnumSegments)
    554555# define RTLdrEnumSymbols                               RT_MANGLER(RTLdrEnumSymbols)
    555556# define RTLdrGetBits                                   RT_MANGLER(RTLdrGetBits)
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