Changeset 3529 for trunk/kDbg/kDbgModPE-generic.cpp
- Timestamp:
- Aug 20, 2007, 5:25:44 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kDbg/kDbgModPE-generic.cpp
r3528 r3529 63 63 * @param puRVA Where to store the RVA on success. 64 64 */ 65 static int rtDbgModPeSegOffToRVA(PKDBGMODPE pModPe, int32_t iSegment, KDBGADDR off, uint32_t *puRVA)65 static int kDbgModPeSegOffToRVA(PKDBGMODPE pModPe, int32_t iSegment, KDBGADDR off, uint32_t *puRVA) 66 66 { 67 67 if (iSegment >= 0) … … 83 83 return 0; 84 84 } 85 AssertMsgFailedReturn(("iSegment=%RI32\n", iSegment), KDBG_ERR_INVALID_ADDRESS);85 kDbgAssertMsgFailedReturn(("iSegment=%d\n", iSegment), KDBG_ERR_INVALID_ADDRESS); 86 86 } 87 87 … … 97 97 * @param poff Where to store the segment offset. 98 98 */ 99 static int rtDbgModPeRVAToSegOff(PKDBGMODPE pModPe, uint32_t uRVA, int32_t *piSegment, KDBGADDR *poff)99 static int kDbgModPeRVAToSegOff(PKDBGMODPE pModPe, uint32_t uRVA, int32_t *piSegment, KDBGADDR *poff) 100 100 { 101 101 kDbgAssertMsgReturn(uRVA < pModPe->cbImage, ("uRVA=%x, cbImage=%x\n", uRVA, pModPe->cbImage), … … 112 112 } 113 113 } 114 AssertMsgFailedReturn(("uRVA=%x\n", uRVA), KDBG_ERR_INVALID_ADDRESS);114 kDbgAssertMsgFailedReturn(("uRVA=%x\n", uRVA), KDBG_ERR_INVALID_ADDRESS); 115 115 } 116 116 … … 119 119 * @copydoc KDBGMODOPS::pfnQueryLine 120 120 */ 121 static DECLCALLBACK(int)rtDbgModPEQueryLine(PKDBGMOD pMod, int32_t iSegment, KDBGADDR off, PKDBGLINE pLine)121 static int rtDbgModPEQueryLine(PKDBGMOD pMod, int32_t iSegment, KDBGADDR off, PKDBGLINE pLine) 122 122 { 123 123 PKDBGMODPE pModPe = (PKDBGMODPE)pMod; … … 127 127 */ 128 128 uint32_t uRVA; 129 int rc = rtDbgModPeSegOffToRVA(pModPe, iSegment, off, &uRVA);129 int rc = kDbgModPeSegOffToRVA(pModPe, iSegment, off, &uRVA); 130 130 if (!rc) 131 131 { … … 137 137 { 138 138 pLine->RVA = (KDBGADDR)(Line.Address - pModPe->ImageBase); 139 rc = rtDbgModPeRVAToSegOff(pModPe, pLine->RVA, &pLine->iSegment, &pLine->offSegment);139 rc = kDbgModPeRVAToSegOff(pModPe, pLine->RVA, &pLine->iSegment, &pLine->offSegment); 140 140 pLine->iLine = Line.LineNumber; 141 141 pLine->cchFile = strlen(Line.FileName); … … 147 147 { 148 148 DWORD Err = GetLastError(); 149 rc = RTErrConvertFromWin32(Err);149 rc = kDbgModPeConvWinError(Err); 150 150 } 151 151 #endif … … 159 159 * @copydoc KDBGMODOPS::pfnQuerySymbol 160 160 */ 161 static DECLCALLBACK(int)rtDbgModPEQuerySymbol(PKDBGMOD pMod, int32_t iSegment, KDBGADDR off, PKDBGSYMBOL pSym)161 static int rtDbgModPEQuerySymbol(PKDBGMOD pMod, int32_t iSegment, KDBGADDR off, PKDBGSYMBOL pSym) 162 162 { 163 163 PKDBGMODPE pModPe = (PKDBGMODPE)pMod; … … 167 167 */ 168 168 uint32_t uRVA; 169 int rc = rtDbgModPeSegOffToRVA(pModPe, iSegment, off, &uRVA);169 int rc = kDbgModPeSegOffToRVA(pModPe, iSegment, off, &uRVA); 170 170 if (!rc) 171 171 { … … 200 200 { 201 201 pSym->RVA = (KDBGADDR)(Buf.Sym.Address - pModPe->ImageBase); 202 rc = rtDbgModPeRVAToSegOff(pModPe, pSym->RVA, &pSym->iSegment, &pSym->offSegment);202 rc = kDbgModPeRVAToSegOff(pModPe, pSym->RVA, &pSym->iSegment, &pSym->offSegment); 203 203 } 204 204 pSym->cchName = (uint16_t)Buf.Sym.NameLen; … … 211 211 { 212 212 DWORD Err = GetLastError(); 213 rc = RTErrConvertFromWin32(Err);213 rc = kDbgModPeConvWinError(Err); 214 214 } 215 215 #endif … … 223 223 * @copydoc KDBGMODOPS::pfnClose 224 224 */ 225 static DECLCALLBACK(int)rtDbgModPEClose(PKDBGMOD pMod)225 static int rtDbgModPEClose(PKDBGMOD pMod) 226 226 { 227 227 PKDBGMODPE pModPe = (PKDBGMODPE)pMod; … … 231 231 // 232 232 //DWORD Err = GetLastError(); 233 //int rc = RTErrConvertFromWin32(Err);234 // AssertMsgFailed(("SymInitialize failed: Err=%d rc=%Rrc\n", Err, rc));233 //int rc = kDbgModPeConvWinError(Err); 234 //kDbgAssertMsgFailed(("SymInitialize failed: Err=%d rc=%Rrc\n", Err, rc)); 235 235 //return rc; 236 236 return VERR_NOT_IMPLEMENTED; … … 255 255 * @returns IPRT status code. 256 256 * 257 * @param FileThe handle to the module.257 * @param pFile The handle to the module. 258 258 * @param offHdr The offset of the PE header. 259 259 * @param pszModulePath The path to the module. … … 261 261 * 262 262 */ 263 int kdbgModPEOpen( RTFILEFile, int64_t offHdr, const char *pszModulePath, PKDBGMOD *ppDbgMod)263 int kdbgModPEOpen(PKDBGHLPFILE pFile, int64_t offHdr, const char *pszModulePath, PKDBGMOD *ppDbgMod) 264 264 { 265 265 /* … … 356 356 357 357 DWORD Err = GetLastError(); 358 rc = RTErrConvertFromWin32(Err);359 AssertMsgFailed(("SymLoadModule64 failed: Err=%d rc=%Rrc\n", Err, rc));358 rc = kDbgModPeConvWinError(Err); 359 kDbgAssertMsgFailed(("SymLoadModule64 failed: Err=%d rc=%Rrc\n", Err, rc)); 360 360 g_pfnSymCleanup(hSymInst); 361 361 } … … 363 363 { 364 364 DWORD Err = GetLastError(); 365 rc = RTErrConvertFromWin32(Err);366 AssertMsgFailed(("SymInitialize failed: Err=%d rc=%Rrc\n", Err, rc));365 rc = kDbgModPeConvWinError(Err); 366 kDbgAssertMsgFailed(("SymInitialize failed: Err=%d rc=%Rrc\n", Err, rc)); 367 367 } 368 368 #endif
Note:
See TracChangeset
for help on using the changeset viewer.