Changeset 2859 for trunk/kLdr/kLdr.h


Ignore:
Timestamp:
Nov 6, 2006, 5:48:53 AM (19 years ago)
Author:
bird
Message:

More debugging.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/kLdr/kLdr.h

    r2858 r2859  
    6464#define NIL_KLDRADDR    (~(uint64_t)0)
    6565
     66/** @def PRI_KLDRADDR
     67 * printf format type. */
     68#ifdef _MSC_VER
     69# define PRI_KLDRADDR    "I64x"
     70#else
     71# define PRI_KLDRADDR    "llx"
     72#endif
     73
     74
    6675/** The kLdr size type. */
    6776typedef uint64_t KLDRSIZE;
     
    7079/** Pointer to a const kLdr size. */
    7180typedef const KLDRSIZE *PCKLDRSIZE;
     81
     82/** @def PRI_KLDRSIZE
     83 * printf format type. */
     84#ifdef _MSC_VER
     85# define PRI_KLDRSIZE    "I64x"
     86#else
     87# define PRI_KLDRSIZE    "llx"
     88#endif
    7289
    7390
     
    404421     * Set to -1 if no file backing (like BSS). */
    405422    off_t           cbFile;
     423    /** The relative virtual address when mapped.
     424     * Set to NIL_KLDRADDR if the segment isn't supposed to be mapped. */
     425    KLDRADDR        RVA;
     426    /** The size of the segment including the alignment gap up to the next segment when mapped. */
     427    size_t          cbMapped;
    406428    /** The address the segment was mapped at by kLdrModMap().
    407429     * Set to 0 if not mapped. */
    408430    uintptr_t       MapAddress;
    409     /** The size of the segment including the alignment gap up to the next segment when mapped. */
    410     size_t          cbMapped;
    411431} KLDRSEG;
    412432/** Pointer to a loader segment. */
     
    551571/** Special import module ordinal value used to indicate that there is no
    552572 * specific module associated with the requested symbol. */
    553 #define NIL_KLDRMOD_IMPORT                 (~(uint32_t)0)
     573#define NIL_KLDRMOD_IMPORT                  (~(uint32_t)0)
    554574
    555575/** Special symbol ordinal value used to indicate that the symbol
    556576 * only has a string name. */
    557 #define NIL_KLDRMOD_SYM_ORDINAL            (~(uint32_t)0)
     577#define NIL_KLDRMOD_SYM_ORDINAL             (~(uint32_t)0)
    558578
    559579
     
    601621 * @param   pMod        The module which fixups are begin applied.
    602622 * @param   iImport     The import module ordinal number or NIL_KLDRMOD_IMPORT.
    603  * @param   uSymbol     The symbol ordinal number or NIL_KLDRMOD_SYM_ORDINAL.
    604  * @param   pszSymbol   The symbol name. Can be NULL if uSymbol isn't nil.
     623 * @param   iSymbol     The symbol ordinal number or NIL_KLDRMOD_SYM_ORDINAL.
     624 * @param   pszSymbol   The symbol name. Can be NULL if iSymbol isn't nil.
    605625 * @param   puValue     Where to store the symbol value.
    606626 * @param   pfKind      Where to store the symbol kind flags.
    607627 * @param   pvUser      The user parameter specified to the relocation function.
    608628 */
    609 typedef int FNKLDRMODGETIMPORT(PKLDRMOD pMod, uint32_t iImport, uint32_t uSymbol, const char *pszSymbol,
     629typedef int FNKLDRMODGETIMPORT(PKLDRMOD pMod, uint32_t iImport, uint32_t iSymbol, const char *pszSymbol,
    610630                               PKLDRADDR puValue, uint32_t *pfKind, void *pvUser);
    611631/** Pointer to a import callback. */
     
    619639 *
    620640 * @param   pMod        The module which symbols are being enumerated.s
    621  * @param   uSymbol     The symbol ordinal number or NIL_KLDRMOD_SYM_ORDINAL.
     641 * @param   iSymbol     The symbol ordinal number or NIL_KLDRMOD_SYM_ORDINAL.
    622642 * @param   pszSymbol   The symbol name. This can be NULL if there is a symbol ordinal.
    623643 *                      This can also be an empty string if the symbol doesn't have a name
     
    627647 * @param   pvUser      The user parameter specified to kLdrModEnumSymbols().
    628648 */
    629 typedef int FNKLDRMODENUMSYMS(PKLDRMOD pMod, uint32_t uSymbol, const char *pszSymbol,
     649typedef int FNKLDRMODENUMSYMS(PKLDRMOD pMod, uint32_t iSymbol, const char *pszSymbol,
    630650                              KLDRADDR uValue, uint32_t fKind, void *pvUser);
    631651/** Pointer to a symbol enumerator callback. */
     
    652672 */
    653673typedef int FNKLDRENUMDBG(PKLDRMOD pMod, uint32_t iDbgInfo, KLDRDBGINFOTYPE enmType, int16_t iMajorVer, int16_t iMinorVer,
    654                           off_t offFile, KLDRADDR LinkAddress, off_t cb, const char *pszExtFile, void *pvUser);
     674                          off_t offFile, KLDRADDR LinkAddress, KLDRSIZE cb, const char *pszExtFile, void *pvUser);
    655675/** Pointer to a debug info enumberator callback. */
    656676typedef FNKLDRENUMDBG *PFNKLDRENUMDBG;
     
    661681int     kLdrModClose(PKLDRMOD pMod);
    662682
    663 int     kLdrModQuerySymbol(PKLDRMOD pMod, const void *pvBits, KLDRADDR BaseAddress, uint32_t uSymbol,
     683int     kLdrModQuerySymbol(PKLDRMOD pMod, const void *pvBits, KLDRADDR BaseAddress, uint32_t iSymbol,
    664684                           const char *pszSymbol, PFNKLDRMODGETIMPORT pfnGetForwarder, void *pvUser,
    665685                           PKLDRADDR puValue, uint32_t *pfKind);
     
    730750
    731751    /** @copydoc kLdrModQuerySymbol */
    732     int (* pfnQuerySymbol)(PKLDRMOD pMod, const void *pvBits, KLDRADDR BaseAddress, uint32_t uSymbol,
     752    int (* pfnQuerySymbol)(PKLDRMOD pMod, const void *pvBits, KLDRADDR BaseAddress, uint32_t iSymbol,
    733753                           const char *pszSymbol, PFNKLDRMODGETIMPORT pfnGetForwarder, void *pvUser,
    734754                           PKLDRADDR puValue, uint32_t *pfKind);
Note: See TracChangeset for help on using the changeset viewer.