VirtualBox

Changeset 45994 in vbox for trunk/include


Ignore:
Timestamp:
May 12, 2013 7:16:16 PM (12 years ago)
Author:
vboxsync
Message:

RTDbgModCreateFromPeImage: Mostly implemented.

Location:
trunk/include/iprt
Files:
2 added
4 edited

Legend:

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

    r45985 r45994  
    400400RTDECL(int) RTDbgCfgQueryUInt(RTDBGCFG hDbgCfg, RTDBGCFGPROP enmProp, uint64_t *puValue);
    401401
     402
     403/**
     404 * Callback used by the RTDbgCfgOpen function to try out a file that was found.
     405 *
     406 * @returns On statuses other than VINF_CALLBACK_RETURN and
     407 *          VERR_CALLBACK_RETURN the search will continue till the end of the
     408 *          list.  The first error status code will be returned to the API
     409 *          caller.
     410 * @retval  VINF_CALLBACK_RETURN if successuflly opened the file and it's time
     411 *          to return
     412 * @retval  VERR_CALLBACK_RETURN if we shouldn't stop searching.
     413 *
     414 * @param   hDbgCfg             The debugging configuration handle.
     415 * @param   pszFilename         The path to the file that should be tried out.
     416 * @param   pvUser1             First user parameter.
     417 * @param   pvUser2             Second user parameter.
     418 */
     419typedef DECLCALLBACK(int) FNDBGCFGOPEN(RTDBGCFG hDbgCfg, const char *pszFilename, void *pvUser1, void *pvUser2);
     420/** Pointer to a open-file callback used to the RTDbgCfgOpen functions. */
     421typedef FNDBGCFGOPEN *PFNDBGCFGOPEN;
     422
     423
     424RTDECL(int) RTDbgCfgOpenPeImage(RTDBGCFG hDbgCfg, const char *pszFilename, uint32_t cbImage, uint32_t uTimestamp,
     425                                PFNDBGCFGOPEN pfnCallback, void *pvUser1, void *pvUser2);
     426RTDECL(int) RTDbgCfgOpenPdb70(RTDBGCFG hDbgCfg, const char *pszFilename, PCRTUUID pUuid, uint32_t uAge,
     427                              PFNDBGCFGOPEN pfnCallback, void *pvUser1, void *pvUser2);
     428RTDECL(int) RTDbgCfgOpenPdb20(RTDBGCFG hDbgCfg, const char *pszFilename, uint32_t cbImage, uint32_t uTimestamp, uint32_t uAge,
     429                              PFNDBGCFGOPEN pfnCallback, void *pvUser1, void *pvUser2);
     430RTDECL(int) RTDbgCfgOpenDbg(RTDBGCFG hDbgCfg, const char *pszFilename, uint32_t cbImage, uint32_t uTimestamp,
     431                            PFNDBGCFGOPEN pfnCallback, void *pvUser1, void *pvUser2);
     432RTDECL(int) RTDbgCfgOpenDwo(RTDBGCFG hDbgCfg, const char *pszFilename, uint32_t uCrc32,
     433                            PFNDBGCFGOPEN pfnCallback, void *pvUser1, void *pvUser2);
    402434/** @} */
    403435
     
    868900                                          RTDBGCFG hDbgCfg);
    869901RTDECL(int)         RTDbgModCreateFromPeImage(PRTDBGMOD phDbgMod, const char *pszFilename, const char *pszName, uint32_t cbImage,
    870                                               uint32_t uTimeDateStamp, RTDBGCFG pDbgCfg);
     902                                              uint32_t uTimeDateStamp, RTDBGCFG hDbgCfg);
    871903RTDECL(int)         RTDbgModCreateFromDbg(PRTDBGMOD phDbgMod, const char *pszFilename, const char *pszName, uint32_t cbImage,
    872                                           uint32_t uTimeDateStamp, RTDBGCFG pDbgCfg);
     904                                          uint32_t uTimeDateStamp, RTDBGCFG hDbgCfg);
    873905RTDECL(int)         RTDbgModCreateFromPdb(PRTDBGMOD phDbgMod, const char *pszFilename, const char *pszName, uint32_t cbImage,
    874                                           PCRTUUID pUuid, uint32_t Age, RTDBGCFG pDbgCfg);
     906                                          PCRTUUID pUuid, uint32_t Age, RTDBGCFG hDbgCfg);
    875907RTDECL(int)         RTDbgModCreateFromDwo(PRTDBGMOD phDbgMod, const char *pszFilename, const char *pszName, uint32_t cbImage,
    876                                           uint32_t uCrc32, RTDBGCFG pDbgCfg);
     908                                          uint32_t uCrc32, RTDBGCFG hDbgCfg);
    877909
    878910
  • trunk/include/iprt/err.h

    r45984 r45994  
    14941494/** Not an integer property. */
    14951495#define VERR_DBG_CFG_NOT_UINT_PROP              (-685)
     1496/** Deferred loading of information failed. */
     1497#define VERR_DBG_DEFERRED_LOAD_FAILED           (-686)
     1498/** Unfinished debug info reader code. */
     1499#define VERR_DBG_TODO                           (-687)
     1500/** Found file, but it didn't match the search criteria. */
     1501#define VERR_DBG_FILE_MISMATCH                  (-688)
     1502/** Internal processing error in the debug module reader code. */
     1503#define VERR_DBG_MOD_IPE                        (-689)
    14961504/** @} */
    14971505
  • trunk/include/iprt/ldr.h

    r44528 r45994  
    359359    /** Debug With Arbitrary Record Format (DWARF). */
    360360    RTLDRDBGINFOTYPE_DWARF,
     361    /** Debug With Arbitrary Record Format (DWARF), in external file (DWO). */
     362    RTLDRDBGINFOTYPE_DWARF_DWO,
    361363    /** Microsoft Codeview debug info. */
    362364    RTLDRDBGINFOTYPE_CODEVIEW,
     365    /** Microsoft Codeview debug info, in external v2.0+ program database (PDB). */
     366    RTLDRDBGINFOTYPE_CODEVIEW_PDB20,
     367    /** Microsoft Codeview debug info, in external v7.0+ program database (PDB). */
     368    RTLDRDBGINFOTYPE_CODEVIEW_PDB70,
     369    /** Microsoft Codeview debug info, in external file (DBG). */
     370    RTLDRDBGINFOTYPE_CODEVIEW_DBG,
    363371    /** Watcom debug info. */
    364372    RTLDRDBGINFOTYPE_WATCOM,
     
    371379} RTLDRDBGINFOTYPE;
    372380
     381
     382/**
     383 * Debug info details for the enumeration callback.
     384 */
     385typedef struct RTLDRDBGINFO
     386{
     387    /** The kind of debug info. */
     388    RTLDRDBGINFOTYPE    enmType;
     389    /** The debug info ordinal number / id. */
     390    uint32_t            iDbgInfo;
     391    /** The file offset *if* this type has one specific location in the executable
     392     * image file. This is -1 if there isn't any specific file location. */
     393    RTFOFF              offFile;
     394    /** The link address of the debug info if it's loadable. NIL_RTLDRADDR if not
     395     * loadable*/
     396    RTLDRADDR           LinkAddress;
     397    /** The size of the debug information. -1 is used if this isn't applicable.*/
     398    RTLDRADDR           cb;
     399    /** This is set if the debug information is found in an external file.  NULL
     400     * if no external file involved.
     401     * @note Putting it outside the union to allow lazy callback implementation. */
     402    const char         *pszExtFile;
     403    /** Type (enmType) specific information. */
     404    union
     405    {
     406        /** RTLDRDBGINFOTYPE_DWARF */
     407        struct
     408        {
     409            /** The section name. */
     410            const char *pszSection;
     411        } Dwarf;
     412
     413        /** RTLDRDBGINFOTYPE_DWARF_DWO */
     414        struct
     415        {
     416            /** The CRC32 of the external file. */
     417            uint32_t    uCrc32;
     418        } Dwo;
     419
     420        /** RTLDRDBGINFOTYPE_CODEVIEW_PDB20, RTLDRDBGINFOTYPE_CODEVIEW_DBG */
     421        struct
     422        {
     423            /** The PE image size. */
     424            uint32_t    cbImage;
     425            /** The timestamp. */
     426            uint32_t    uTimestamp;
     427            /** The major version from the entry. */
     428            uint32_t    uMajorVer;
     429            /** The minor version from the entry. */
     430            uint32_t    uMinorVer;
     431        } Cv;
     432
     433        /** RTLDRDBGINFOTYPE_CODEVIEW_DBG */
     434        struct
     435        {
     436            /** The PE image size. */
     437            uint32_t    cbImage;
     438            /** The timestamp. */
     439            uint32_t    uTimestamp;
     440        } Dbg;
     441
     442        /** RTLDRDBGINFOTYPE_CODEVIEW_PDB20*/
     443        struct
     444        {
     445            /** The PE image size. */
     446            uint32_t    cbImage;
     447            /** The timestamp. */
     448            uint32_t    uTimestamp;
     449            /** The PDB age. */
     450            uint32_t    uAge;
     451        } Pdb20;
     452
     453        /** RTLDRDBGINFOTYPE_CODEVIEW_PDB70 */
     454        struct
     455        {
     456            /** The PE image size. */
     457            uint32_t    cbImage;
     458            /** The PDB age. */
     459            uint32_t    uAge;
     460            /** The UUID. */
     461            RTUUID      Uuid;
     462        } Pdb70;
     463    } u;
     464} RTLDRDBGINFO;
     465/** Pointer to debug info details. */
     466typedef RTLDRDBGINFO *PRTLDRDBGINFO;
     467/** Pointer to read only debug info details. */
     468typedef RTLDRDBGINFO const *PCRTLDRDBGINFO;
     469
     470
    373471/**
    374472 * Debug info enumerator callback.
     
    378476 *
    379477 * @param   hLdrMod         The module handle.
    380  * @param   iDbgInfo        The debug info ordinal number / id.
    381  * @param   enmType         The debug info type.
    382  * @param   iMajorVer       The major version number of the debug info format.
    383  *                          -1 if unknow - implies invalid iMinorVer.
    384  * @param   iMinorVer       The minor version number of the debug info format.
    385  *                          -1 when iMajorVer is -1.
    386  * @param   pszPartNm       The name of the debug info part, NULL if not
    387  *                          applicable.
    388  * @param   offFile         The file offset *if* this type has one specific
    389  *                          location in the executable image file. This is -1
    390  *                          if there isn't any specific file location.
    391  * @param   LinkAddress     The link address of the debug info if it's
    392  *                          loadable. NIL_RTLDRADDR if not loadable.
    393  * @param   cb              The size of the debug information. -1 is used if
    394  *                          this isn't applicable.
    395  * @param   pszExtFile      This points to the name of an external file
    396  *                          containing the debug info.  This is NULL if there
    397  *                          isn't any external file.
     478 * @param   pDbgInfo        Pointer to a read only structure with the details.
    398479 * @param   pvUser          The user parameter specified to RTLdrEnumDbgInfo.
    399480 */
    400 typedef DECLCALLBACK(int) FNRTLDRENUMDBG(RTLDRMOD hLdrMod, uint32_t iDbgInfo, RTLDRDBGINFOTYPE enmType,
    401                                          uint16_t iMajorVer, uint16_t iMinorVer, const char *pszPartNm,
    402                                          RTFOFF offFile, RTLDRADDR LinkAddress, RTLDRADDR cb,
    403                                          const char *pszExtFile, void *pvUser);
     481typedef DECLCALLBACK(int) FNRTLDRENUMDBG(RTLDRMOD hLdrMod, PCRTLDRDBGINFO pDbgInfo, void *pvUser);
    404482/** Pointer to a debug info enumerator callback. */
    405483typedef FNRTLDRENUMDBG *PFNRTLDRENUMDBG;
  • trunk/include/iprt/mangling.h

    r45990 r45994  
    369369# define RTDbgAsSymbolByName                            RT_MANGLER(RTDbgAsSymbolByName)
    370370# define RTDbgAsSymbolByNameA                           RT_MANGLER(RTDbgAsSymbolByNameA)
     371# define RTDbgCfgCreate                                 RT_MANGLER(RTDbgCfgCreate)
     372# define RTDbgCfgRetain                                 RT_MANGLER(RTDbgCfgRetain)
     373# define RTDbgCfgRelease                                RT_MANGLER(RTDbgCfgRelease)
     374# define RTDbgCfgChangeString                           RT_MANGLER(RTDbgCfgChangeString)
     375# define RTDbgCfgChangeUInt                             RT_MANGLER(RTDbgCfgChangeUInt)
     376# define RTDbgCfgQueryString                            RT_MANGLER(RTDbgCfgQueryString)
     377# define RTDbgCfgQueryUInt                              RT_MANGLER(RTDbgCfgQueryUInt)
     378# define RTDbgCfgOpenDbg                                RT_MANGLER(RTDbgCfgOpenDbg)
     379# define RTDbgCfgOpenDwo                                RT_MANGLER(RTDbgCfgOpenDwo)
     380# define RTDbgCfgOpenPdb70                              RT_MANGLER(RTDbgCfgOpenPdb70)
     381# define RTDbgCfgOpenPdb20                              RT_MANGLER(RTDbgCfgOpenPdb20)
     382# define RTDbgCfgOpenPeImage                            RT_MANGLER(RTDbgCfgOpenPeImage)
    371383# define RTDbgLineAlloc                                 RT_MANGLER(RTDbgLineAlloc)
    372384# define RTDbgLineDup                                   RT_MANGLER(RTDbgLineDup)
    373385# define RTDbgLineFree                                  RT_MANGLER(RTDbgLineFree)
    374386# define RTDbgModCreate                                 RT_MANGLER(RTDbgModCreate)
     387# define RTDbgModCreateFromDbg                          RT_MANGLER(RTDbgModCreateFromDbg)
     388# define RTDbgModCreateFromDwo                          RT_MANGLER(RTDbgModCreateFromDwo)
    375389# define RTDbgModCreateFromImage                        RT_MANGLER(RTDbgModCreateFromImage)
    376390# define RTDbgModCreateFromMap                          RT_MANGLER(RTDbgModCreateFromMap)
     391# define RTDbgModCreateFromPdb                          RT_MANGLER(RTDbgModCreateFromPdb)
     392# define RTDbgModCreateFromPeImage                      RT_MANGLER(RTDbgModCreateFromPeImage)
    377393# define RTDbgModGetTag                                 RT_MANGLER(RTDbgModGetTag)
    378394# define RTDbgModImageSize                              RT_MANGLER(RTDbgModImageSize)
     
    404420# define RTDbgSymbolDup                                 RT_MANGLER(RTDbgSymbolDup)
    405421# define RTDbgSymbolFree                                RT_MANGLER(RTDbgSymbolFree)
    406 # define RTDbgCfgCreate                                 RT_MANGLER(RTDbgCfgCreate)
    407 # define RTDbgCfgRetain                                 RT_MANGLER(RTDbgCfgRetain)
    408 # define RTDbgCfgRelease                                RT_MANGLER(RTDbgCfgRelease)
    409 # define RTDbgCfgChangeString                           RT_MANGLER(RTDbgCfgChangeString)
    410 # define RTDbgCfgChangeUInt                             RT_MANGLER(RTDbgCfgChangeUInt)
    411 # define RTDbgCfgQueryString                            RT_MANGLER(RTDbgCfgQueryString)
    412 # define RTDbgCfgQueryUInt                              RT_MANGLER(RTDbgCfgQueryUInt)
    413422# define RTDirClose                                     RT_MANGLER(RTDirClose)
    414423# define RTDirCreate                                    RT_MANGLER(RTDirCreate)
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