Changeset 103438 in vbox
- Timestamp:
- Feb 19, 2024 1:41:38 PM (9 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/common/dbg/dbgmod.cpp
r103285 r103438 597 597 * the latter can be normalized or using a different name (e.g. 'nt'). 598 598 */ 599 const char *pszExt = NULL; 599 const char *pszExtSuff = NULL; 600 size_t cchExtSuff = 0; 600 601 if (pDbgInfo->enmType == RTLDRDBGINFOTYPE_CODEVIEW_DBG) 601 pszExt = ".dbg";602 pszExtSuff = ".dbg", cchExtSuff = sizeof(".dbg") - 1; 602 603 else if ( pDbgInfo->enmType == RTLDRDBGINFOTYPE_CODEVIEW_PDB20 603 604 || pDbgInfo->enmType == RTLDRDBGINFOTYPE_CODEVIEW_PDB70) 604 pszExt = ".pdb";605 if (pszExt )605 pszExtSuff = ".pdb", cchExtSuff = sizeof(".pdb") - 1; 606 if (pszExtSuff) 606 607 { 607 608 const char * const pszName = pDbgMod->pszImgFile … … 610 611 if (pszName) 611 612 { 612 size_t const cchName = strlen(pszName); 613 size_t const cchExtFileBuf = cchName + strlen(pszExt) + 1; 614 615 char *pszExtFileBuf = (char *)alloca(cchExtFileBuf); 616 AssertPtrReturn(pszExtFileBuf, VERR_NO_MEMORY); 617 618 memcpy(pszExtFileBuf, pszName, cchName + 1); 619 RTPathStripSuffix(pszExtFileBuf); 620 int rc2 = RTStrCat(pszExtFileBuf, cchExtFileBuf, pszExt); 621 AssertRCReturn(rc2, rc2); 622 623 pszExtFile = pszExtFileBuf; 613 const char * const pszOldSuff = RTPathSuffix(pszName); 614 size_t const cchName = pszOldSuff ? (size_t)(pszOldSuff - pszName) : strlen(pszName); 615 char * const pszExtFileBuf = (char *)alloca(cchName + cchExtSuff + 1); 616 if (pszExtFileBuf) 617 { 618 memcpy(mempcpy(pszExtFileBuf, pszName, cchName), pszExtSuff, cchExtSuff + 1); 619 pszExtFile = pszExtFileBuf; 620 } 624 621 } 625 622 }
Note:
See TracChangeset
for help on using the changeset viewer.