Changeset 20744 in vbox for trunk/src/VBox/Runtime/common
- Timestamp:
- Jun 21, 2009 3:43:57 PM (16 years ago)
- svn:sync-xref-src-repo-rev:
- 48860
- Location:
- trunk/src/VBox/Runtime/common/dbg
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/common/dbg/dbgas.cpp
r20740 r20744 1148 1148 * @param fFlags Symbol flags. 1149 1149 */ 1150 RTDECL(int) RTDbgAsSymbolAdd(RTDBGAS hDbgAs, const char *pszSymbol, RTUINTPTR Addr, RTUINTPTR cb, uint32_t fFlags )1150 RTDECL(int) RTDbgAsSymbolAdd(RTDBGAS hDbgAs, const char *pszSymbol, RTUINTPTR Addr, RTUINTPTR cb, uint32_t fFlags, uint32_t *piOrdinal) 1151 1151 { 1152 1152 /* … … 1165 1165 * Forward the call. 1166 1166 */ 1167 int rc = RTDbgModSymbolAdd(hMod, pszSymbol, iSeg, offSeg, cb, fFlags );1167 int rc = RTDbgModSymbolAdd(hMod, pszSymbol, iSeg, offSeg, cb, fFlags, piOrdinal); 1168 1168 RTDbgModRelease(hMod); 1169 1169 return rc; … … 1464 1464 * @param uLineNo The line number. 1465 1465 * @param Addr The address of the symbol. 1466 */ 1467 RTDECL(int) RTDbgAsLineAdd(RTDBGAS hDbgAs, const char *pszFile, uint32_t uLineNo, RTUINTPTR Addr) 1466 * @param piOrdinal Where to return the line number ordinal on success. 1467 * If the interpreter doesn't do ordinals, this will be 1468 * set to UINT32_MAX. Optional. 1469 */ 1470 RTDECL(int) RTDbgAsLineAdd(RTDBGAS hDbgAs, const char *pszFile, uint32_t uLineNo, RTUINTPTR Addr, uint32_t *piOrdinal) 1468 1471 { 1469 1472 /* … … 1482 1485 * Forward the call. 1483 1486 */ 1484 int rc = RTDbgModLineAdd(hMod, pszFile, uLineNo, iSeg, offSeg );1487 int rc = RTDbgModLineAdd(hMod, pszFile, uLineNo, iSeg, offSeg, piOrdinal); 1485 1488 RTDbgModRelease(hMod); 1486 1489 return rc; -
trunk/src/VBox/Runtime/common/dbg/dbgmod.cpp
r20740 r20744 405 405 * @param cb The size of the symbol. 406 406 * @param fFlags Symbol flags. 407 */ 408 RTDECL(int) RTDbgModSymbolAdd(RTDBGMOD hDbgMod, const char *pszSymbol, RTDBGSEGIDX iSeg, RTUINTPTR off, RTUINTPTR cb, uint32_t fFlags) 407 * @param piOrdinal Where to return the symbol ordinal on success. If 408 * the interpreter doesn't do ordinals, this will be set to 409 * UINT32_MAX. Optional 410 */ 411 RTDECL(int) RTDbgModSymbolAdd(RTDBGMOD hDbgMod, const char *pszSymbol, RTDBGSEGIDX iSeg, RTUINTPTR off, RTUINTPTR cb, uint32_t fFlags, uint32_t *piOrdinal) 409 412 { 410 413 /* … … 442 445 * Get down to business. 443 446 */ 444 int rc = pDbgMod->pDbgVt->pfnSymbolAdd(pDbgMod, pszSymbol, cchSymbol, iSeg, off, cb, fFlags );447 int rc = pDbgMod->pDbgVt->pfnSymbolAdd(pDbgMod, pszSymbol, cchSymbol, iSeg, off, cb, fFlags, piOrdinal); 445 448 446 449 RTDBGMOD_UNLOCK(pDbgMod); … … 498 501 * @param iSeg The segment index. 499 502 * @param off The segment offset. 500 */ 501 RTDECL(int) RTDbgModLineAdd(RTDBGMOD hDbgMod, const char *pszFile, uint32_t uLineNo, RTDBGSEGIDX iSeg, RTUINTPTR off) 503 * @param piOrdinal Where to return the line number ordinal on success. 504 * If the interpreter doesn't do ordinals, this will be 505 * set to UINT32_MAX. Optional. 506 */ 507 RTDECL(int) RTDbgModLineAdd(RTDBGMOD hDbgMod, const char *pszFile, uint32_t uLineNo, RTDBGSEGIDX iSeg, RTUINTPTR off, uint32_t *piOrdinal) 502 508 { 503 509 /* … … 534 540 * Get down to business. 535 541 */ 536 int rc = pDbgMod->pDbgVt->pfnLineAdd(pDbgMod, pszFile, cchFile, uLineNo, iSeg, off );542 int rc = pDbgMod->pDbgVt->pfnLineAdd(pDbgMod, pszFile, cchFile, uLineNo, iSeg, off, piOrdinal); 537 543 538 544 RTDBGMOD_UNLOCK(pDbgMod); -
trunk/src/VBox/Runtime/common/dbg/dbgmodcontainer.cpp
r20740 r20744 19 19 * Symbol entry. 20 20 */ 21 typedef struct RTDBGMODC ONTAINERSYMBOL21 typedef struct RTDBGMODCTNSYMBOL 22 22 { 23 23 /** The address core. */ … … 25 25 /** The name space core. */ 26 26 RTSTRSPACECORE NameCore; 27 /** The ordinal number core. */ 28 AVLU32NODECORE OrdinalCore; 27 29 /** The segment index. */ 28 30 RTDBGSEGIDX iSeg; … … 32 34 * This may be zero while the range in AddrCore indicates 0. */ 33 35 RTUINTPTR cb; 34 } RTDBGMODC ONTAINERSYMBOL;36 } RTDBGMODCTNSYMBOL; 35 37 /** Pointer to a symbol entry in the debug info container. */ 36 typedef RTDBGMODC ONTAINERSYMBOL *PRTDBGMODCONTAINERSYMBOL;38 typedef RTDBGMODCTNSYMBOL *PRTDBGMODCTNSYMBOL; 37 39 /** Pointer to a const symbol entry in the debug info container. */ 38 typedef RTDBGMODC ONTAINERSYMBOL const *PCRTDBGMODCONTAINERSYMBOL;40 typedef RTDBGMODCTNSYMBOL const *PCRTDBGMODCTNSYMBOL; 39 41 40 42 /** 41 43 * Line number entry. 42 44 */ 43 typedef struct RTDBGMODC ONTAINERLINE45 typedef struct RTDBGMODCTNLINE 44 46 { 45 47 /** The address core. 46 48 * The Key is the address of the line number. */ 47 AVLUINTPTRNODECORE AddrCore; 49 AVLUINTPTRNODECORE AddrCore; 50 /** The ordinal number core. */ 51 AVLU32NODECORE OrdinalCore; 48 52 /** Pointer to the file name (in string cache). */ 49 const char *pszFile;53 const char *pszFile; 50 54 /** The line number. */ 51 uint32_t uLineNo; 52 } RTDBGMODCONTAINERLINE; 55 uint32_t uLineNo; 56 /** The segment index. */ 57 RTDBGSEGIDX iSeg; 58 } RTDBGMODCTNLINE; 53 59 /** Pointer to a line number entry. */ 54 typedef RTDBGMODC ONTAINERLINE *PRTDBGMODCONTAINERLINE;60 typedef RTDBGMODCTNLINE *PRTDBGMODCTNLINE; 55 61 /** Pointer to const a line number entry. */ 56 typedef RTDBGMODC ONTAINERLINE const *PCRTDBGMODCONTAINERLINE;62 typedef RTDBGMODCTNLINE const *PCRTDBGMODCTNLINE; 57 63 58 64 /** 59 65 * Segment entry. 60 66 */ 61 typedef struct RTDBGMODC ONTAINERSEGMENT67 typedef struct RTDBGMODCTNSEGMENT 62 68 { 63 69 /** The symbol address space tree. */ … … 71 77 /** The segment name. */ 72 78 const char *pszName; 73 } RTDBGMODC ONTAINERSEGMENT;79 } RTDBGMODCTNSEGMENT; 74 80 /** Pointer to a segment entry in the debug info container. */ 75 typedef RTDBGMODC ONTAINERSEGMENT *PRTDBGMODCONTAINERSEGMENT;81 typedef RTDBGMODCTNSEGMENT *PRTDBGMODCTNSEGMENT; 76 82 /** Pointer to a const segment entry in the debug info container. */ 77 typedef RTDBGMODC ONTAINERSEGMENT const *PCRTDBGMODCONTAINERSEGMENT;83 typedef RTDBGMODCTNSEGMENT const *PCRTDBGMODCTNSEGMENT; 78 84 79 85 /** 80 86 * Instance data. 81 87 */ 82 typedef struct RTDBGMODC ONTAINER88 typedef struct RTDBGMODCTN 83 89 { 84 90 /** The name space. */ … … 86 92 /** Tree containing any absolute addresses. */ 87 93 AVLRUINTPTRTREE AbsAddrTree; 94 /** Tree organizing the symbols by ordinal number. */ 95 AVLU32TREE SymbolOrdinalTree; 96 /** Tree organizing the line numbers by ordinal number. */ 97 AVLU32TREE LineOrdinalTree; 88 98 /** Segment table. */ 89 PRTDBGMODC ONTAINERSEGMENTpaSegs;99 PRTDBGMODCTNSEGMENT paSegs; 90 100 /** The number of segments in the segment table. */ 91 101 RTDBGSEGIDX cSegs; 92 102 /** The image size. 0 means unlimited. */ 93 103 RTUINTPTR cb; 94 } RTDBGMODCONTAINER; 104 /** The next symbol ordinal. */ 105 uint32_t iNextSymbolOrdinal; 106 /** The next line number ordinal. */ 107 uint32_t iNextLineOrdinal; 108 } RTDBGMODCTN; 95 109 /** Pointer to instance data for the debug info container. */ 96 typedef RTDBGMODC ONTAINER *PRTDBGMODCONTAINER;110 typedef RTDBGMODCTN *PRTDBGMODCTN; 97 111 98 112 … … 104 118 * @param pExtSym The external symbol representation. 105 119 */ 106 DECLINLINE(int) rtDbgModContainerReturnSymbol(PCRTDBGMODCONTAINERSYMBOL pMySym, PRTDBGSYMBOL pExtSym) 107 { 108 pExtSym->Value = pMySym->AddrCore.Key; 109 pExtSym->offSeg = pMySym->AddrCore.Key; 110 pExtSym->iSeg = pMySym->iSeg; 111 pExtSym->fFlags = pMySym->fFlags; 112 pExtSym->cb = pMySym->cb; 120 DECLINLINE(int) rtDbgModContainerReturnSymbol(PCRTDBGMODCTNSYMBOL pMySym, PRTDBGSYMBOL pExtSym) 121 { 122 pExtSym->Value = pMySym->AddrCore.Key; 123 pExtSym->offSeg = pMySym->AddrCore.Key; 124 pExtSym->iSeg = pMySym->iSeg; 125 pExtSym->fFlags = pMySym->fFlags; 126 pExtSym->cb = pMySym->cb; 127 pExtSym->iOrdinal = pMySym->OrdinalCore.Key; 113 128 Assert(pMySym->NameCore.cchString < sizeof(pExtSym->szName)); 114 129 memcpy(pExtSym->szName, pMySym->NameCore.pszString, pMySym->NameCore.cchString + 1); … … 122 137 PRTINTPTR poffDisp, PRTDBGLINE pLine) 123 138 { 124 PRTDBGMODC ONTAINER pThis = (PRTDBGMODCONTAINER)pMod->pvDbgPriv;139 PRTDBGMODCTN pThis = (PRTDBGMODCTN)pMod->pvDbgPriv; 125 140 126 141 /* … … 139 154 PAVLUINTPTRNODECORE pAvlCore = RTAvlUIntPtrGetBestFit(&pThis->paSegs[iSeg].LineAddrTree, off, false /*fAbove*/); 140 155 if (!pAvlCore) 141 return VERR_SYMBOL_NOT_FOUND;142 PCRTDBGMODCONTAINERLINE pMyLine = RT_FROM_MEMBER(pAvlCore, RTDBGMODCONTAINERLINE const, AddrCore);143 if (poffDisp)144 *poffDisp = off - pMyLine->AddrCore.Key;156 return pThis->iNextLineOrdinal 157 ? VERR_DBG_LINE_NOT_FOUND 158 : VERR_DBG_NO_LINE_NUMBERS; 159 PCRTDBGMODCTNLINE pMyLine = RT_FROM_MEMBER(pAvlCore, RTDBGMODCTNLINE const, AddrCore); 145 160 pLine->Address = pMyLine->AddrCore.Key; 146 161 pLine->offSeg = pMyLine->AddrCore.Key; 147 162 pLine->iSeg = iSeg; 148 163 pLine->uLineNo = pMyLine->uLineNo; 164 pLine->iOrdinal = pMyLine->OrdinalCore.Key; 165 strcpy(pLine->szFilename, pMyLine->pszFile); 166 if (poffDisp) 167 *poffDisp = off - pMyLine->AddrCore.Key; 168 return VINF_SUCCESS; 169 } 170 171 172 /** @copydoc RTDBGMODVTDBG::pfnLineByOrdinal */ 173 static DECLCALLBACK(int) rtDbgModContainer_LineByOrdinal(PRTDBGMODINT pMod, uint32_t iOrdinal, PRTDBGLINE pLine) 174 { 175 PRTDBGMODCTN pThis = (PRTDBGMODCTN)pMod->pvDbgPriv; 176 177 /* 178 * Look it up. 179 */ 180 if (iOrdinal >= pThis->iNextLineOrdinal) 181 return pThis->iNextLineOrdinal 182 ? VERR_DBG_LINE_NOT_FOUND 183 : VERR_DBG_NO_LINE_NUMBERS; 184 PAVLU32NODECORE pAvlCore = RTAvlU32Get(&pThis->LineOrdinalTree, iOrdinal); 185 AssertReturn(pAvlCore, VERR_DBG_LINE_NOT_FOUND); 186 PCRTDBGMODCTNLINE pMyLine = RT_FROM_MEMBER(pAvlCore, RTDBGMODCTNLINE const, OrdinalCore); 187 pLine->Address = pMyLine->AddrCore.Key; 188 pLine->offSeg = pMyLine->AddrCore.Key; 189 pLine->iSeg = pMyLine->iSeg; 190 pLine->uLineNo = pMyLine->uLineNo; 191 pLine->iOrdinal = pMyLine->OrdinalCore.Key; 149 192 strcpy(pLine->szFilename, pMyLine->pszFile); 150 193 return VINF_SUCCESS; … … 152 195 153 196 197 /** @copydoc RTDBGMODVTDBG::pfnLineCount */ 198 static DECLCALLBACK(uint32_t) rtDbgModContainer_LineCount(PRTDBGMODINT pMod) 199 { 200 PRTDBGMODCTN pThis = (PRTDBGMODCTN)pMod->pvDbgPriv; 201 202 /* Note! The ordinal numbers are 0-based. */ 203 return pThis->iNextLineOrdinal; 204 } 205 206 154 207 /** @copydoc RTDBGMODVTDBG::pfnLineAdd */ 155 208 static DECLCALLBACK(int) rtDbgModContainer_LineAdd(PRTDBGMODINT pMod, const char *pszFile, size_t cchFile, uint32_t uLineNo, 156 uint32_t iSeg, RTUINTPTR off )157 { 158 PRTDBGMODC ONTAINER pThis = (PRTDBGMODCONTAINER)pMod->pvDbgPriv;209 uint32_t iSeg, RTUINTPTR off, uint32_t *piOrdinal) 210 { 211 PRTDBGMODCTN pThis = (PRTDBGMODCTN)pMod->pvDbgPriv; 159 212 160 213 /* … … 169 222 * Create a new entry. 170 223 */ 171 PRTDBGMODC ONTAINERLINE pLine = (PRTDBGMODCONTAINERLINE)RTMemAllocZ(sizeof(*pLine));224 PRTDBGMODCTNLINE pLine = (PRTDBGMODCTNLINE)RTMemAllocZ(sizeof(*pLine)); 172 225 if (!pLine) 173 226 return VERR_NO_MEMORY; 174 pLine->AddrCore.Key = off; 175 pLine->uLineNo = uLineNo; 176 pLine->pszFile = RTStrCacheEnterN(g_hDbgModStrCache, pszFile, cchFile); 227 pLine->AddrCore.Key = off; 228 pLine->OrdinalCore.Key = pThis->iNextLineOrdinal; 229 pLine->uLineNo = uLineNo; 230 pLine->iSeg = iSeg; 231 pLine->pszFile = RTStrCacheEnterN(g_hDbgModStrCache, pszFile, cchFile); 177 232 int rc; 178 233 if (pLine->pszFile) 179 234 { 180 235 if (RTAvlUIntPtrInsert(&pThis->paSegs[iSeg].LineAddrTree, &pLine->AddrCore)) 181 return VINF_SUCCESS; 236 { 237 if (RTAvlU32Insert(&pThis->LineOrdinalTree, &pLine->OrdinalCore)) 238 { 239 if (piOrdinal) 240 *piOrdinal = pThis->iNextLineOrdinal; 241 pThis->iNextLineOrdinal++; 242 return VINF_SUCCESS; 243 } 244 245 rc = VERR_INTERNAL_ERROR_5; 246 RTAvlUIntPtrRemove(&pThis->paSegs[iSeg].LineAddrTree, pLine->AddrCore.Key); 247 } 182 248 183 249 /* bail out */ … … 196 262 PRTINTPTR poffDisp, PRTDBGSYMBOL pSymbol) 197 263 { 198 PRTDBGMODC ONTAINER pThis = (PRTDBGMODCONTAINER)pMod->pvDbgPriv;264 PRTDBGMODCTN pThis = (PRTDBGMODCTN)pMod->pvDbgPriv; 199 265 200 266 /* … … 220 286 if (!pAvlCore) 221 287 return VERR_SYMBOL_NOT_FOUND; 222 PCRTDBGMODC ONTAINERSYMBOL pMySym = RT_FROM_MEMBER(pAvlCore, RTDBGMODCONTAINERSYMBOL const, AddrCore);288 PCRTDBGMODCTNSYMBOL pMySym = RT_FROM_MEMBER(pAvlCore, RTDBGMODCTNSYMBOL const, AddrCore); 223 289 if (poffDisp) 224 290 *poffDisp = off - pMySym->AddrCore.Key; … … 230 296 static DECLCALLBACK(int) rtDbgModContainer_SymbolByName(PRTDBGMODINT pMod, const char *pszSymbol, PRTDBGSYMBOL pSymbol) 231 297 { 232 PRTDBGMODC ONTAINER pThis = (PRTDBGMODCONTAINER)pMod->pvDbgPriv;298 PRTDBGMODCTN pThis = (PRTDBGMODCTN)pMod->pvDbgPriv; 233 299 234 300 /* … … 238 304 if (!pStrCore) 239 305 return VERR_SYMBOL_NOT_FOUND; 240 PCRTDBGMODC ONTAINERSYMBOL pMySym = RT_FROM_MEMBER(pStrCore, RTDBGMODCONTAINERSYMBOL const, NameCore);306 PCRTDBGMODCTNSYMBOL pMySym = RT_FROM_MEMBER(pStrCore, RTDBGMODCTNSYMBOL const, NameCore); 241 307 return rtDbgModContainerReturnSymbol(pMySym, pSymbol); 308 } 309 310 311 /** @copydoc RTDBGMODVTDBG::pfnSymbolByOrdinal */ 312 static DECLCALLBACK(int) rtDbgModContainer_SymbolByOrdinal(PRTDBGMODINT pMod, uint32_t iOrdinal, PRTDBGSYMBOL pSymbol) 313 { 314 PRTDBGMODCTN pThis = (PRTDBGMODCTN)pMod->pvDbgPriv; 315 316 /* 317 * Look it up in the ordinal tree. 318 */ 319 if (iOrdinal >= pThis->iNextSymbolOrdinal) 320 return pThis->iNextSymbolOrdinal 321 ? VERR_DBG_NO_SYMBOLS 322 : VERR_SYMBOL_NOT_FOUND; 323 PAVLU32NODECORE pAvlCore = RTAvlU32Get(&pThis->SymbolOrdinalTree, iOrdinal); 324 AssertReturn(pAvlCore, VERR_SYMBOL_NOT_FOUND); 325 PCRTDBGMODCTNSYMBOL pMySym = RT_FROM_MEMBER(pAvlCore, RTDBGMODCTNSYMBOL const, OrdinalCore); 326 return rtDbgModContainerReturnSymbol(pMySym, pSymbol); 327 } 328 329 330 /** @copydoc RTDBGMODVTDBG::pfnSymbolCount */ 331 static DECLCALLBACK(uint32_t) rtDbgModContainer_SymbolCount(PRTDBGMODINT pMod) 332 { 333 PRTDBGMODCTN pThis = (PRTDBGMODCTN)pMod->pvDbgPriv; 334 335 /* Note! The ordinal numbers are 0-based. */ 336 return pThis->iNextSymbolOrdinal; 242 337 } 243 338 … … 245 340 /** @copydoc RTDBGMODVTDBG::pfnSymbolAdd */ 246 341 static DECLCALLBACK(int) rtDbgModContainer_SymbolAdd(PRTDBGMODINT pMod, const char *pszSymbol, size_t cchSymbol, 247 RTDBGSEGIDX iSeg, RTUINTPTR off, RTUINTPTR cb, uint32_t fFlags) 248 { 249 PRTDBGMODCONTAINER pThis = (PRTDBGMODCONTAINER)pMod->pvDbgPriv; 342 RTDBGSEGIDX iSeg, RTUINTPTR off, RTUINTPTR cb, uint32_t fFlags, 343 uint32_t *piOrdinal) 344 { 345 PRTDBGMODCTN pThis = (PRTDBGMODCTN)pMod->pvDbgPriv; 250 346 251 347 /* … … 264 360 * Create a new entry. 265 361 */ 266 PRTDBGMODC ONTAINERSYMBOL pSymbol = (PRTDBGMODCONTAINERSYMBOL)RTMemAllocZ(sizeof(*pSymbol));362 PRTDBGMODCTNSYMBOL pSymbol = (PRTDBGMODCTNSYMBOL)RTMemAllocZ(sizeof(*pSymbol)); 267 363 if (!pSymbol) 268 364 return VERR_NO_MEMORY; … … 270 366 pSymbol->AddrCore.Key = off; 271 367 pSymbol->AddrCore.KeyLast = off + RT_MIN(cb, 1); 368 pSymbol->OrdinalCore.Key = pThis->iNextSymbolOrdinal; 272 369 pSymbol->iSeg = iSeg; 273 370 pSymbol->cb = cb; … … 279 376 if (RTStrSpaceInsert(&pThis->Names, &pSymbol->NameCore)) 280 377 { 281 if (RTAvlrUIntPtrInsert( iSeg == RTDBGSEGIDX_ABS 282 ? &pThis->AbsAddrTree 283 : &pThis->paSegs[iSeg].SymAddrTree, 284 &pSymbol->AddrCore)) 285 return VINF_SUCCESS; 286 287 /* bail out */ 288 rc = VERR_DBG_ADDRESS_CONFLICT; 378 PAVLRUINTPTRTREE pAddrTree = iSeg == RTDBGSEGIDX_ABS 379 ? &pThis->AbsAddrTree 380 : &pThis->paSegs[iSeg].SymAddrTree; 381 if (RTAvlrUIntPtrInsert(pAddrTree, &pSymbol->AddrCore)) 382 { 383 if (RTAvlU32Insert(&pThis->LineOrdinalTree, &pSymbol->OrdinalCore)) 384 { 385 if (piOrdinal) 386 *piOrdinal = pThis->iNextSymbolOrdinal; 387 pThis->iNextSymbolOrdinal++; 388 return VINF_SUCCESS; 389 } 390 391 /* bail out */ 392 rc = VERR_INTERNAL_ERROR_5; 393 RTAvlrUIntPtrRemove(pAddrTree, pSymbol->AddrCore.Key); 394 } 395 else 396 rc = VERR_DBG_ADDRESS_CONFLICT; 289 397 RTStrSpaceRemove(&pThis->Names, pSymbol->NameCore.pszString); 290 398 } … … 303 411 static DECLCALLBACK(RTDBGSEGIDX) rtDbgModContainer_RvaToSegOff(PRTDBGMODINT pMod, RTUINTPTR uRva, PRTUINTPTR poffSeg) 304 412 { 305 PRTDBGMODC ONTAINER pThis = (PRTDBGMODCONTAINER)pMod->pvDbgPriv;306 PCRTDBGMODC ONTAINERSEGMENT paSeg = pThis->paSegs;413 PRTDBGMODCTN pThis = (PRTDBGMODCTN)pMod->pvDbgPriv; 414 PCRTDBGMODCTNSEGMENT paSeg = pThis->paSegs; 307 415 uint32_t const cSegs = pThis->cSegs; 308 416 if (cSegs <= 7) … … 366 474 static DECLCALLBACK(int) rtDbgModContainer_DestroyTreeNode(PAVLRUINTPTRNODECORE pNode, void *pvUser) 367 475 { 368 PRTDBGMODC ONTAINERSYMBOL pSym = RT_FROM_MEMBER(pNode, RTDBGMODCONTAINERSYMBOL, AddrCore);476 PRTDBGMODCTNSYMBOL pSym = RT_FROM_MEMBER(pNode, RTDBGMODCTNSYMBOL, AddrCore); 369 477 RTStrCacheRelease(g_hDbgModStrCache, pSym->NameCore.pszString); 370 478 pSym->NameCore.pszString = NULL; … … 377 485 static DECLCALLBACK(int) rtDbgModContainer_Close(PRTDBGMODINT pMod) 378 486 { 379 PRTDBGMODC ONTAINER pThis = (PRTDBGMODCONTAINER)pMod->pvDbgPriv;487 PRTDBGMODCTN pThis = (PRTDBGMODCTN)pMod->pvDbgPriv; 380 488 381 489 /* … … 416 524 /*.pfnClose = */ rtDbgModContainer_Close, 417 525 /*.pfnRvaToSegOff = */ rtDbgModContainer_RvaToSegOff, 526 527 /*.pfnSegmentAdd = */ NULL,//rtDbgModContainer_SegmentAdd, 528 /*.pfnSegmentCount = */ NULL,//rtDbgModContainer_SegmentCount, 529 /*.pfnSegmentByIndex = */ NULL,//rtDbgModContainer_SegmentByIndex, 530 418 531 /*.pfnSymbolAdd = */ rtDbgModContainer_SymbolAdd, 532 /*.pfnSymbolCount = */ rtDbgModContainer_SymbolCount, 533 /*.pfnSymbolByOrdinal = */ rtDbgModContainer_SymbolByOrdinal, 419 534 /*.pfnSymbolByName = */ rtDbgModContainer_SymbolByName, 420 535 /*.pfnSymbolByAddr = */ rtDbgModContainer_SymbolByAddr, 536 421 537 /*.pfnLineAdd = */ rtDbgModContainer_LineAdd, 538 /*.pfnLineCount = */ rtDbgModContainer_LineCount, 539 /*.pfnLineByOrdinal = */ rtDbgModContainer_LineByOrdinal, 422 540 /*.pfnLineByAddr = */ rtDbgModContainer_LineByAddr, 541 423 542 /*.u32EndMagic = */ RTDBGMODVTDBG_MAGIC 424 543 }; … … 435 554 int rtDbgModContainerCreate(PRTDBGMODINT pMod, RTUINTPTR cb) 436 555 { 437 PRTDBGMODC ONTAINER pThis = (PRTDBGMODCONTAINER)RTMemAlloc(sizeof(*pThis));556 PRTDBGMODCTN pThis = (PRTDBGMODCTN)RTMemAlloc(sizeof(*pThis)); 438 557 if (!pThis) 439 558 return VERR_NO_MEMORY; … … 441 560 pThis->Names = NULL; 442 561 pThis->AbsAddrTree = NULL; 562 pThis->SymbolOrdinalTree = NULL; 563 pThis->LineOrdinalTree = NULL; 443 564 pThis->paSegs = NULL; 444 565 pThis->cSegs = 0; 445 pThis->cb = cb; 566 pThis->cb = cb; /** @todo the module size stuff doesn't quite make sense yet. Need to look at segments first, I guess. */ 567 pThis->iNextSymbolOrdinal = 0; 568 pThis->iNextLineOrdinal = 0; 446 569 447 570 pMod->pDbgVt = &g_rtDbgModVtDbgContainer;
Note:
See TracChangeset
for help on using the changeset viewer.