Changeset 2849


Ignore:
Timestamp:
Nov 2, 2006, 3:05:16 AM (19 years ago)
Author:
bird
Message:

Debug info query.

Location:
trunk/kLdr
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/kLdr/kLdr.h

    r2848 r2849  
    281281/** @defgroup grp_kLdrMod   kLdrMod - The executable image intepreter
    282282 * @{ */
     283
     284
     285/**
     286 * Debug info type (from the loader point of view).
     287 */
     288typedef enum KLDRDBGINFOTYPE
     289{
     290    /** The usual invalid enum value. */
     291    KLDRDBGINFOTYPE_INVALID = 0,
     292    /** Stabs. */
     293    KLDRDBGINFOTYPE_STABS,
     294    /** Debug With Arbitrary Record Format (DWARF). */
     295    KLDRDBGINFOTYPE_DWARF,
     296    /** Microsoft Codeview debug info. */
     297    KLDRDBGINFOTYPE_CODEVIEW,
     298    /** Watcom debug info. */
     299    KLDRDBGINFOTYPE_WATCOM,
     300    /** IBM High Level Language debug info.. */
     301    KLDRDBGINFOTYPE_HLL,
     302    /** The end of the valid debug info values (exclusive). */
     303    KLDRDBGINFOTYPE_END,
     304    /** Blow the type up to 32-bit. */
     305    KLDRDBGINFOTYPE_32BIT_HACK = 0x7fffffff
     306} KLDRDBGINFOTYPE;
     307/** Pointer to a kLdr debug info type. */
     308typedef KLDRDBGINFOTYPE *PKLDRDBGINFOTYPE;
     309
    283310
    284311/**
     
    433460} KLDRARCH;
    434461
     462
    435463/**
    436464 * CPU models.
     
    607635 *
    608636 * @returns 0 if enumeration should continue.
    609  * @returns non-zero if the enumeration should stop. This status code is the returned by kLdrModEnumSymbols().
     637 * @returns non-zero if the enumeration should stop. This status code will then be returned by kLdrModEnumSymbols().
    610638 *
    611639 * @param   pMod        The module which symbols are being enumerated.s
     
    622650/** Pointer to a symbol enumerator callback. */
    623651typedef FNKLDRMODENUMSYMS *PFNKLDRMODENUMSYMS;
     652
     653/**
     654 * Debug info enumerator callback.
     655 *
     656 * @returns 0 to continue the enumeration.
     657 * @returns non-zero if the enumeration should stop. This status code will then be returned by kLdrModEnumDbgInfo().
     658 *
     659 * @param   pMod        The module.
     660 * @param   enmType     The debug info type.
     661 * @param   iDbgInfo    The debug info ordinal number / id.
     662 * @param   offFile     The file offset *if* this type has one specific location in the executable image file.
     663 *                      This is -1 if there isn't any specific file location.
     664 * @param   cbFile      The file size.
     665 *                      This is 0 if there isn't any specific file location.
     666 * @param   pszExtFile  This points to the name of an external file containing the debug info.
     667 *                      This is NULL if there isn't any external file.
     668 * @param   pvUser      The user parameter specified to kLdrModEnumDbgInfo.
     669 */
     670typedef int FNKLDRENUMDBG(PKLDRMOD pMod, KLDRDBGINFOTYPE enmType, uint32_t iDbgInfo, off_t offFile, off_t cbFile,
     671                          const char *pszExtFile, void *pvUser);
    624672
    625673int     kLdrModOpen(const char *pszFilename, PPKLDRMOD ppMod);
     
    637685int     kLdrModGetStackInfo(PKLDRMOD pMod, void *pvBits, KLDRADDR BaseAddress, PKLDRSTACKINFO pStackInfo);
    638686int     kLdrModQueryMainEntrypoint(PKLDRMOD pMod, void *pvBits, KLDRADDR BaseAddress, PKLDRADDR pMainEPAddress);
    639 size_t  kLdrModSize(PKLDRMOD pMod);
     687/** Pointer to a debug info enumberator callback. */
     688typedef FNKLDRENUMDBG *PFNKLDRENUMDBG;
     689int     kLdrModEnumDbgInfo(PKLDRMOD pMod, void *pvBits, PFNKLDRENUMDBG pfnCallback, void *pvUser);
     690int     kLdrModHasDbgInfo(PKLDRMOD pMod, void *pvBits);
    640691
    641692/** @name Operations On The Internally Managed Mapping
     
    654705/** @name Operations On The Externally Managed Mappings
    655706 * @{ */
     707size_t  kLdrModSize(PKLDRMOD pMod);
    656708int     kLdrModGetBits(PKLDRMOD pMod, void *pvBits, KLDRADDR BaseAddress, PFNKLDRMODGETIMPORT pfnGetImport, void *pvUser);
    657709int     kLdrModRelocateBits(PKLDRMOD pMod, void *pvBits, KLDRADDR NewBaseAddress, KLDRADDR OldBaseAddress,
    658710                            PFNKLDRMODGETIMPORT pfnGetImport, void *pvUser);
    659711/** @} */
     712
    660713
    661714/** @} */
  • trunk/kLdr/kLdrMod.c

    r2848 r2849  
    308308
    309309/**
    310  * Get the size of the mapped module.
    311  *
    312  * @returns The size of the mapped module (in bytes).
    313  * @param   pMod            The module.
    314  */
    315 size_t  kLdrModSize(PKLDRMOD pMod)
     310 * Enumerate the debug info formats contained in the executable image.
     311 *
     312 * @returns 0 on success, non-zero OS or kLdr status code on failure, or non-zero callback status.
     313 * @param   pMod            The module.
     314 * @param   pvBits          Optional pointer to bits returned by kLdrModGetBits().
     315 *                          This can be used by some module interpreters to reduce memory consumption.
     316 * @param   pfnCallback     The callback function.
     317 * @param   pvUser          The user argument.
     318 * @see pg_kDbg for the debug info reader.
     319 */
     320int     kLdrModEnumDbgInfo(PKLDRMOD pMod, void *pvBits, PFNKLDRENUMDBG pfnCallback, void *pvUser)
    316321{
    317322    return 0;
     323}
     324
     325
     326/**
     327 * Checks if the module has debug info embedded or otherwise associated with it.
     328 *
     329 * @returns 0 if it has debug info, KLDR_ERR_NO_DEBUG_INFO if no debug info,
     330 *          and non-zero OS or kLdr status code on failure.
     331 * @param   pMod            The module.
     332 * @param   pvBits          Optional pointer to bits returned by kLdrModGetBits().
     333 *                          This can be used by some module interpreters to reduce memory consumption.
     334 */
     335int     kLdrModHasDbgInfo(PKLDRMOD pMod, void *pvBits)
     336{
     337    return -1;
    318338}
    319339
     
    445465 */
    446466int     kLdrModCallThread(PKLDRMOD pMod, unsigned fAttachingOrDetaching)
     467{
     468    return 0;
     469}
     470
     471
     472/**
     473 * Get the size of the mapped module.
     474 *
     475 * @returns The size of the mapped module (in bytes).
     476 * @param   pMod            The module.
     477 */
     478size_t  kLdrModSize(PKLDRMOD pMod)
    447479{
    448480    return 0;
     
    488520}
    489521
    490 
    491 
Note: See TracChangeset for help on using the changeset viewer.