Ignore:
Timestamp:
Aug 26, 2007, 3:13:35 AM (18 years ago)
Author:
bird
Message:

made kDbg compile again (not linking yet though).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/kStuff/kDbg/kDbgModWinDbgHelp.cpp

    r3541 r3550  
    3232#define _IMAGEHLP64
    3333#include <DbgHelp.h>
    34 #include <malloc.h> /* alloca */
    3534
    3635#include "kDbgInternal.h"
     36#include <k/kHlpAlloc.h>
     37#include <k/kHlpString.h>
    3738
    3839
     
    7273    HANDLE      hSymInst;
    7374    /** The image size. */
    74     uint32_t    cbImage;
     75    KU32        cbImage;
    7576    /** The number of sections. (We've added the implicit header section.) */
    76     int32_t     cSections;
     77    KI32        cSections;
    7778    /** The section headers (variable size). The first section is the
    7879     * implicit header section.*/
     
    107108 * @param   puRVA       Where to store the RVA on success.
    108109 */
    109 static int kdbgModDHSegOffToRVA(PKDBGMODDBGHELP pModDH, int32_t iSegment, KDBGADDR off, uint32_t *puRVA)
     110static int kdbgModDHSegOffToRVA(PKDBGMODDBGHELP pModDH, KI32 iSegment, KDBGADDR off, KU32 *puRVA)
    110111{
    111112    if (iSegment >= 0)
     
    116117                            ("off=" PRI_KDBGADDR " VirtualSize=%x\n", off, pModDH->aSections[iSegment].Misc.VirtualSize),
    117118                            KDBG_ERR_INVALID_ADDRESS);
    118         *puRVA = pModDH->aSections[iSegment].VirtualAddress + (uint32_t)off;
     119        *puRVA = pModDH->aSections[iSegment].VirtualAddress + (KU32)off;
    119120        return 0;
    120121    }
     
    124125        kDbgAssertMsgReturn(off < pModDH->cbImage, ("off=" PRI_KDBGADDR ", cbImage=%x\n", off, pModDH->cbImage),
    125126                            KDBG_ERR_INVALID_ADDRESS);
    126         *puRVA = (uint32_t)off;
     127        *puRVA = (KU32)off;
    127128        return 0;
    128129    }
     
    141142 * @param   poff        Where to store the segment offset.
    142143 */
    143 static int kdbgModDHRVAToSegOff(PKDBGMODDBGHELP pModDH, uint32_t uRVA, int32_t *piSegment, KDBGADDR *poff)
     144static int kdbgModDHRVAToSegOff(PKDBGMODDBGHELP pModDH, KU32 uRVA, KI32 *piSegment, KDBGADDR *poff)
    144145{
    145146    kDbgAssertMsgReturn(uRVA < pModDH->cbImage, ("uRVA=%x, cbImage=%x\n", uRVA, pModDH->cbImage),
    146147                        KDBG_ERR_INVALID_ADDRESS);
    147     for (int32_t iSegment = 0; iSegment < pModDH->cSections; iSegment++)
     148    for (KI32 iSegment = 0; iSegment < pModDH->cSections; iSegment++)
    148149    {
    149150        /** @todo should probably be less strict about address in the alignment gaps. */
    150         uint32_t off = uRVA - pModDH->aSections[iSegment].VirtualAddress;
     151        KU32 off = uRVA - pModDH->aSections[iSegment].VirtualAddress;
    151152        if (off < pModDH->aSections[iSegment].Misc.VirtualSize)
    152153        {
     
    163164 * @copydoc KDBGMODOPS::pfnQueryLine
    164165 */
    165 static int kdbgModDHQueryLine(PKDBGMOD pMod, int32_t iSegment, KDBGADDR off, PKDBGLINE pLine)
     166static int kdbgModDHQueryLine(PKDBGMOD pMod, KI32 iSegment, KDBGADDR off, PKDBGLINE pLine)
    166167{
    167168    PKDBGMODDBGHELP pModDH = (PKDBGMODDBGHELP)pMod;
     
    170171     * Translate the address to an RVA.
    171172     */
    172     uint32_t uRVA;
     173    KU32 uRVA;
    173174    int rc = kdbgModDHSegOffToRVA(pModDH, iSegment, off, &uRVA);
    174175    if (!rc)
     
    180181        {
    181182            pLine->RVA = (KDBGADDR)(Line.Address - pModDH->ImageBase);
    182             rc = kdbgModDHRVAToSegOff(pModDH, (uint32_t)pLine->RVA, &pLine->iSegment, &pLine->offSegment);
     183            rc = kdbgModDHRVAToSegOff(pModDH, (KU32)pLine->RVA, &pLine->iSegment, &pLine->offSegment);
    183184            pLine->iLine = Line.LineNumber;
    184             size_t cchFile = strlen(Line.FileName);
     185            KSIZE cchFile = kHlpStrLen(Line.FileName);
    185186            pLine->cchFile = cchFile < sizeof(pLine->szFile)
    186                            ? (uint16_t)cchFile
    187                            : (uint16_t)sizeof(pLine->szFile) - 1;
    188             memcpy(pLine->szFile, Line.FileName, pLine->cchFile);
     187                           ? (KU16)cchFile
     188                           : (KU16)sizeof(pLine->szFile) - 1;
     189            kHlpMemCopy(pLine->szFile, Line.FileName, pLine->cchFile);
    189190            pLine->szFile[pLine->cchFile] = '\0';
    190191        }
     
    202203 * @copydoc KDBGMODOPS::pfnQuerySymbol
    203204 */
    204 static int kdbgModDHQuerySymbol(PKDBGMOD pMod, int32_t iSegment, KDBGADDR off, PKDBGSYMBOL pSym)
     205static int kdbgModDHQuerySymbol(PKDBGMOD pMod, KI32 iSegment, KDBGADDR off, PKDBGSYMBOL pSym)
    205206{
    206207    PKDBGMODDBGHELP pModDH = (PKDBGMODDBGHELP)pMod;
     
    209210     * Translate the address to an RVA.
    210211     */
    211     uint32_t uRVA;
     212    KU32 uRVA;
    212213    int rc = kdbgModDHSegOffToRVA(pModDH, iSegment, off, &uRVA);
    213214    if (!rc)
     
    242243            {
    243244                pSym->RVA        = (KDBGADDR)(Buf.Sym.Address - pModDH->ImageBase);
    244                 rc = kdbgModDHRVAToSegOff(pModDH, (uint32_t)pSym->RVA, &pSym->iSegment, &pSym->offSegment);
     245                rc = kdbgModDHRVAToSegOff(pModDH, (KU32)pSym->RVA, &pSym->iSegment, &pSym->offSegment);
    245246            }
    246             pSym->cchName = (uint16_t)Buf.Sym.NameLen;
     247            pSym->cchName = (KU16)Buf.Sym.NameLen;
    247248            if (pSym->cchName >= sizeof(pSym->szName))
    248249                pSym->cchName = sizeof(pSym->szName) - 1;
    249             memcpy(pSym->szName, Buf.Sym.Name, Buf.Sym.NameLen);
     250            kHlpMemCopy(pSym->szName, Buf.Sym.Name, Buf.Sym.NameLen);
    250251            pSym->szName[Buf.Sym.NameLen] = '\0';
    251252        }
     
    272273    DWORD Err = GetLastError();
    273274    int rc = kdbgModDHConvWinError(Err);
    274     kDbgAssertMsgFailed(("SymInitialize failed: Err=%d rc=%Rrc\n", Err, rc));
     275    kDbgAssertMsgFailed(("SymInitialize failed: Err=%d rc=%d\n", Err, rc));
    275276    return rc;
    276277}
     
    278279
    279280/**
    280  * Methods for a PE module.
    281  */
    282 static const KDBGMODOPS g_kdbgModDHOps =
    283 {
    284     "PE (dbghelp)",
    285     kdbgModDHClose,
    286     kdbgModDHQuerySymbol,
    287     kdbgModDHQueryLine
    288 };
    289 
    290 
    291 /**
    292281 * Checks if the specified dbghelp.dll is usable.
    293282 *
     
    296285 * @param   pszPath     the path to the dbghelp.dll.
    297286 */
    298 static int kdbgModDHTryDbgHelp(const char *pszPath, uint32_t *pu32FileVersionMS, uint32_t *pu32FileVersionLS)
     287static int kdbgModDHTryDbgHelp(const char *pszPath, KU32 *pu32FileVersionMS, KU32 *pu32FileVersionLS)
    299288{
    300289    int rc;
     
    337326 * Find the dbghelp.dll
    338327 */
    339 static int kdbgModDHFindDbgHelp(char *pszPath, size_t cchPath)
     328static int kdbgModDHFindDbgHelp(char *pszPath, KSIZE cchPath)
    340329{
    341330    /*
    342331     * Try the current directory.
    343332     */
    344     uint32_t FileVersionMS = 0;
    345     uint32_t FileVersionLS = 0;
     333    KU32 FileVersionMS = 0;
     334    KU32 FileVersionLS = 0;
    346335    int rc = KERR_GENERAL_FAILURE;
    347336    static char s_szDbgHelp[] = "\\dbghelp.dll";
     
    361350    if (GetModuleFileName(NULL, pszPath, (DWORD)(cchPath - sizeof(s_szDbgHelp) + 1)))
    362351    {
    363         strcat(strrchr(pszPath, '\\'), s_szDbgHelp);
     352        kHlpStrCat(kHlpStrRChr(pszPath, '\\'), s_szDbgHelp);
    364353        int rc2 = kdbgModDHTryDbgHelp(pszPath, &FileVersionMS, &FileVersionLS);
    365354        if (!rc)
     
    374363    if (GetSystemDirectory(pszPath, (DWORD)(cchPath - sizeof(s_szDbgHelp) + 1)))
    375364    {
    376         strcat(pszPath, s_szDbgHelp);
     365        kHlpStrCat(pszPath, s_szDbgHelp);
    377366        int rc2 = kdbgModDHTryDbgHelp(pszPath, &FileVersionMS, &FileVersionLS);
    378367        if (!rc2)
     
    387376    if (GetWindowsDirectory(pszPath, (DWORD)(cchPath - sizeof(s_szDbgHelp) + 1)))
    388377    {
    389         strcat(pszPath, s_szDbgHelp);
     378        kHlpStrCat(pszPath, s_szDbgHelp);
    390379        int rc2 = kdbgModDHTryDbgHelp(pszPath, &FileVersionMS, &FileVersionLS);
    391380        if (!rc2)
     
    407396        {
    408397            /* find the end of the path. */
    409             char *pszEnd = strchr(psz, ';');
     398            char *pszEnd = kHlpStrChr(psz, ';');
    410399            if (!pszEnd)
    411                 pszEnd = strchr(psz, '\0');
     400                pszEnd = kHlpStrChr(psz, '\0');
    412401            if (pszEnd != psz)
    413402            {
    414403                /* construct filename and try it out */
    415                 memcpy(pszPath, psz, pszEnd - psz);
    416                 memcpy(&pszPath[pszEnd - psz], s_szDbgHelp, sizeof(s_szDbgHelp));
     404                kHlpMemCopy(pszPath, psz, pszEnd - psz);
     405                kHlpMemCopy(&pszPath[pszEnd - psz], s_szDbgHelp, sizeof(s_szDbgHelp));
    417406                int rc2 = kdbgModDHTryDbgHelp(pszPath, &FileVersionMS, &FileVersionLS);
    418407                if (!rc2)
     
    453442
    454443    /* primitive locking - make some useful API for this kind of spinning! */
    455     static volatile uint32_t s_u32Lock = 0;
    456     while (!InterlockedCompareExchange((long volatile *)&s_u32Lock, 1, 0))
    457         while (s_u32Lock)
     444    static volatile long s_lLock = 0;
     445    while (!InterlockedCompareExchange(&s_lLock, 1, 0))
     446        while (s_lLock)
    458447            Sleep(1);
    459448    if (g_hDbgHelp)
    460449    {
    461         InterlockedExchange((long volatile *)&s_u32Lock, 0);
     450        InterlockedExchange(&s_lLock, 0);
    462451        return 0;
    463452    }
     
    470459    if (rc)
    471460    {
    472         InterlockedExchange((volatile long *)&s_u32Lock, 0);
     461        InterlockedExchange(&s_lLock, 0);
    473462        return rc;
    474463    }
     
    479468        DWORD Err = GetLastError();
    480469        int rc = kdbgModDHConvWinError(Err);
    481         kDbgAssertMsgFailedReturn(("Failed to load '%s', Err=%d rc=%Rrc\n", szPath, Err, rc), rc);
     470        kDbgAssertMsgFailedReturn(("Failed to load '%s', Err=%d rc=%d\n", szPath, Err, rc), rc);
    482471    }
    483472
     
    515504                { "SymGetLineFromAddr64", (FARPROC *)&g_pfnSymGetLineFromAddr64 },
    516505            };
    517             for (unsigned i = 0; i < KDBG_ELEMENTS(s_aFunctions); i++)
     506            for (unsigned i = 0; i < K_ELEMENTS(s_aFunctions); i++)
    518507            {
    519508                FARPROC pfn = GetProcAddress(hmod, s_aFunctions[i].pszName);
     
    522511                    DWORD Err = GetLastError();
    523512                    rc = kdbgModDHConvWinError(Err);
    524                     kDbgAssertMsgFailed(("Failed to resolve %s in dbghelp, Err=%d rc=%Rrc\n",
    525                                      s_aFunctions[i].pszName, Err, rc));
     513                    kDbgAssertMsgFailed(("Failed to resolve %s in dbghelp, Err=%d rc=%d\n",
     514                                         s_aFunctions[i].pszName, Err, rc));
    526515                    break;
    527516                }
     
    533522                g_hDbgHelp = hmod;
    534523                Sleep(1);
    535                 InterlockedExchange((volatile long *)&s_u32Lock, 0);
     524                InterlockedExchange(&s_lLock, 0);
    536525                return 0;
    537526            }
     
    547536        DWORD Err = GetLastError();
    548537        rc = kdbgModDHConvWinError(Err);
    549         kDbgAssertMsgFailed(("Failed to resolve ImagehlpApiVersionEx in dbghelp, Err=%d rc=%Rrc\n", Err, rc));
     538        kDbgAssertMsgFailed(("Failed to resolve ImagehlpApiVersionEx in dbghelp, Err=%d rc=%d\n", Err, rc));
    550539    }
    551540    FreeLibrary(hmod);
    552     InterlockedExchange((long volatile *)&s_u32Lock, 0);
     541    InterlockedExchange(&s_lLock, 0);
    553542    return rc;
    554543}
     
    556545
    557546/**
    558  * Opens the debug info for a PE image using the windows dbghelp library.
    559  *
    560  * @returns IPRT status code.
    561  *
    562  * @param   pFile               The handle to the module.
    563  * @param   offHdr              The offset of the PE header.
    564  * @param   pszModulePath       The path to the module.
    565  * @param   ppDbgMod            Where to store the module handle.
    566  *
    567  */
    568 int kdbgModWinDbgHelpOpen(PKDBGHLPFILE pFile, PKDBGMOD *ppDbgMod)
    569 {
     547 * @copydoc KDBGMODOPS::pfnOpen
     548 */
     549static int kdbgModDHOpen(PKDBGMOD *ppMod, PKRDR pRdr, KBOOL fCloseRdr, KFOFF off, KFOFF cb, struct KLDRMOD *pLdrMod)
     550{
     551    /*
     552     * This reader doesn't support partial files.
     553     * Also weed out small files early on as they cannot be
     554     * PE images and will only cause read errors
     555     */
     556    if (    off != 0
     557        ||  cb != KFOFF_MAX)
     558        return KDBG_ERR_UNKOWN_FORMAT;
     559    if (kRdrSize(pRdr) < sizeof(IMAGE_NT_HEADERS32) + sizeof(IMAGE_SECTION_HEADER))
     560        return KDBG_ERR_UNKOWN_FORMAT;
     561
    570562    /*
    571563     * We need to read the section headers and get the image size.
    572564     */
     565    /* Find the PE header magic. */
     566    KU32 offHdr = 0;
     567    KU32 u32Magic;
     568    int rc = kRdrRead(pRdr, &u32Magic, sizeof(u32Magic), 0);
     569    kDbgAssertRCReturn(rc, rc);
     570    if ((KU16)u32Magic == IMAGE_DOS_SIGNATURE)
     571    {
     572        rc = kRdrRead(pRdr, &offHdr, sizeof(offHdr), K_OFFSETOF(IMAGE_DOS_HEADER, e_lfanew));
     573        kDbgAssertRCReturn(rc, rc);
     574        if (!offHdr)
     575            return KDBG_ERR_FORMAT_NOT_SUPPORTED;
     576        if (    offHdr < sizeof(IMAGE_DOS_SIGNATURE)
     577            ||  offHdr >= kRdrSize(pRdr) - 4)
     578            return KDBG_ERR_BAD_EXE_FORMAT;
     579
     580        rc = kRdrRead(pRdr, &u32Magic, sizeof(u32Magic), offHdr);
     581        kDbgAssertRCReturn(rc, rc);
     582    }
     583    if (u32Magic != IMAGE_NT_SIGNATURE)
     584        return KDBG_ERR_FORMAT_NOT_SUPPORTED;
     585
     586    /* read the file header and the image size in the optional header.. */
    573587    IMAGE_FILE_HEADER FHdr;
    574     int rc = kDbgHlpReadAt(pFile, offHdr + KDBG_OFFSETOF(IMAGE_NT_HEADERS32, FileHeader), &FHdr, sizeof(FHdr));
     588    rc = kRdrRead(pRdr, &FHdr, sizeof(FHdr), K_OFFSETOF(IMAGE_NT_HEADERS32, FileHeader));
    575589    kDbgAssertRCReturn(rc, rc);
    576590
    577     uint32_t cbImage;
     591    KU32 cbImage;
    578592    if (FHdr.SizeOfOptionalHeader == sizeof(IMAGE_OPTIONAL_HEADER32))
    579         rc = kDbgHlpReadAt(pFile, offHdr + KDBG_OFFSETOF(IMAGE_NT_HEADERS32, OptionalHeader.SizeOfImage),
    580                            &cbImage, sizeof(cbImage));
     593        rc = kRdrRead(pRdr, &cbImage, sizeof(cbImage),
     594                      offHdr + K_OFFSETOF(IMAGE_NT_HEADERS32, OptionalHeader.SizeOfImage));
    581595    else if (FHdr.SizeOfOptionalHeader == sizeof(IMAGE_OPTIONAL_HEADER64))
    582         rc = kDbgHlpReadAt(pFile, offHdr + KDBG_OFFSETOF(IMAGE_NT_HEADERS64, OptionalHeader.SizeOfImage),
    583                            &cbImage, sizeof(cbImage));
     596        rc = kRdrRead(pRdr, &cbImage, sizeof(cbImage),
     597                      offHdr + K_OFFSETOF(IMAGE_NT_HEADERS64, OptionalHeader.SizeOfImage));
    584598    else
    585599        kDbgAssertFailedReturn(KDBG_ERR_BAD_EXE_FORMAT);
     
    596610     * Allocate the module and read/construct the section headers.
    597611     */
    598     PKDBGMODDBGHELP pModDH = (PKDBGMODDBGHELP)kDbgHlpAlloc(KDBG_OFFSETOF(KDBGMODDBGHELP, aSections[FHdr.NumberOfSections + 2]));
     612    PKDBGMODDBGHELP pModDH = (PKDBGMODDBGHELP)kHlpAlloc(K_OFFSETOF(KDBGMODDBGHELP, aSections[FHdr.NumberOfSections + 2]));
    599613    kDbgAssertReturn(pModDH, KERR_NO_MEMORY);
    600614    pModDH->Core.u32Magic   = KDBGMOD_MAGIC;
    601     pModDH->Core.pOps       = &g_kdbgModDHOps;
    602     pModDH->Core.pFile      = pFile;
     615    pModDH->Core.pOps       = &g_kDbgModWinDbgHelpOpen;
     616    pModDH->Core.pRdr       = pRdr;
     617    pModDH->Core.fCloseRdr  = fCloseRdr;
     618    pModDH->Core.pLdrMod    = pLdrMod;
    603619    pModDH->cbImage         = cbImage;
    604620    pModDH->cSections       = 1 + FHdr.NumberOfSections;
    605     rc = kDbgHlpReadAt(pFile, offHdr + KDBG_OFFSETOF(IMAGE_NT_HEADERS32, OptionalHeader) + FHdr.SizeOfOptionalHeader,
    606                        &pModDH->aSections[1], sizeof(pModDH->aSections[0]) * FHdr.NumberOfSections);
     621
     622    rc = kRdrRead(pRdr, &pModDH->aSections[1], sizeof(pModDH->aSections[0]) * FHdr.NumberOfSections,
     623                  offHdr + K_OFFSETOF(IMAGE_NT_HEADERS32, OptionalHeader) + FHdr.SizeOfOptionalHeader);
    607624    if (!rc)
    608625    {
    609626        PIMAGE_SECTION_HEADER pSH = &pModDH->aSections[0];
    610         memcpy(pSH->Name, "headers", sizeof(pSH->Name));
     627        kHlpMemCopy(pSH->Name, "headers", sizeof(pSH->Name));
    611628        pSH->Misc.VirtualSize       = pModDH->aSections[1].VirtualAddress;
    612629        pSH->VirtualAddress         = 0;
     
    619636        pSH->Characteristics        = IMAGE_SCN_CNT_INITIALIZED_DATA | IMAGE_SCN_ALIGN_4BYTES | IMAGE_SCN_MEM_READ;
    620637
    621         uint32_t uTheEnd = pModDH->aSections[FHdr.NumberOfSections].VirtualAddress
    622                          + pModDH->aSections[FHdr.NumberOfSections].Misc.VirtualSize;
     638        KU32 uTheEnd = pModDH->aSections[FHdr.NumberOfSections].VirtualAddress
     639                     + pModDH->aSections[FHdr.NumberOfSections].Misc.VirtualSize;
    623640        if (uTheEnd < cbImage)
    624641        {
    625642            pSH = &pModDH->aSections[pModDH->cSections++];
    626             memcpy(pSH->Name, "tail\0\0\0", sizeof(pSH->Name));
     643            kHlpMemCopy(pSH->Name, "tail\0\0\0", sizeof(pSH->Name));
    627644            pSH->Misc.VirtualSize       = cbImage - uTheEnd;
    628645            pSH->VirtualAddress         = uTheEnd;
     
    642659         * when we start reusing handles they are no longer in use. :-)
    643660         */
    644         static volatile uint32_t s_u32LastHandle = 1;
    645         HANDLE hSymInst = (HANDLE)InterlockedIncrement((long *)&s_u32LastHandle);
     661        static volatile long s_u32LastHandle = 1;
     662        HANDLE hSymInst = (HANDLE)InterlockedIncrement(&s_u32LastHandle);
    646663        while (     hSymInst == INVALID_HANDLE_VALUE
    647664               ||   hSymInst == (HANDLE)0
    648665               ||   hSymInst == GetCurrentProcess())
    649             hSymInst = (HANDLE)InterlockedIncrement((long *)&s_u32LastHandle);
     666            hSymInst = (HANDLE)InterlockedIncrement(&s_u32LastHandle);
    650667
    651668        /*
     
    656673            g_pfnSymSetOptions(SYMOPT_LOAD_LINES | SYMOPT_AUTO_PUBLICS | SYMOPT_ALLOW_ABSOLUTE_SYMBOLS);
    657674
    658             kDbgHlpSeek(pFile, 0); /* don't know if this is required or not... */
    659             DWORD64 ImageBase = g_pfnSymLoadModule64(hSymInst, (HANDLE)kDbgHlpNativeFileHandle(pFile),
    660                                                      pszModulePath, NULL, 0x00400000, 0);
     675            KIPTR NativeFH = kRdrNativeFH(pRdr);
     676            DWORD64 ImageBase = g_pfnSymLoadModule64(hSymInst, NativeFH == -1 ? NULL : (HANDLE)NativeFH,
     677                                                     kRdrName(pRdr), NULL, 0x00400000, 0);
    661678            if (ImageBase)
    662679            {
    663                 pModDH->hSymInst    = hSymInst;
    664                 pModDH->ImageBase   = ImageBase;
    665                 *ppDbgMod = &pModDH->Core;
     680                pModDH->hSymInst        = hSymInst;
     681                pModDH->ImageBase       = ImageBase;
     682                *ppMod = &pModDH->Core;
    666683                return rc;
    667684            }
     
    669686            DWORD Err = GetLastError();
    670687            rc = kdbgModDHConvWinError(Err);
    671             kDbgAssertMsgFailed(("SymLoadModule64 failed: Err=%d rc=%Rrc\n", Err, rc));
     688            kDbgAssertMsgFailed(("SymLoadModule64 failed: Err=%d rc=%d\n", Err, rc));
    672689            g_pfnSymCleanup(hSymInst);
    673690        }
     
    676693            DWORD Err = GetLastError();
    677694            rc = kdbgModDHConvWinError(Err);
    678             kDbgAssertMsgFailed(("SymInitialize failed: Err=%d rc=%Rrc\n", Err, rc));
     695            kDbgAssertMsgFailed(("SymInitialize failed: Err=%d rc=%d\n", Err, rc));
    679696        }
    680697    }
     
    682699        kDbgAssertRC(rc);
    683700
    684     kDbgHlpFree(pModDH);
     701    kHlpFree(pModDH);
    685702    return rc;
    686703}
    687704
     705
     706/**
     707 * Methods for a PE module.
     708 */
     709const KDBGMODOPS g_kDbgModWinDbgHelpOpen =
     710{
     711    "Windows DbgHelp",
     712    NULL,
     713    kdbgModDHOpen,
     714    kdbgModDHClose,
     715    kdbgModDHQuerySymbol,
     716    kdbgModDHQueryLine,
     717    "Windows DbgHelp"
     718};
     719
Note: See TracChangeset for help on using the changeset viewer.