Changeset 100954 in vbox
- Timestamp:
- Aug 23, 2023 11:13:42 AM (15 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/common/dbg/dbgmod.cpp
r100948 r100954 583 583 rtDbgModOpenDebugInfoExternalToImageCallback(RTLDRMOD hLdrMod, PCRTLDRDBGINFO pDbgInfo, void *pvUser) 584 584 { 585 RTDBGMODOPENDIETI *pArgs = (RTDBGMODOPENDIETI *)pvUser; 585 RTDBGMODOPENDIETI * const pArgs = (RTDBGMODOPENDIETI *)pvUser; 586 PRTDBGMODINT const pDbgMod = pArgs->pDbgMod; 586 587 RT_NOREF_PV(hLdrMod); 587 588 … … 591 592 { 592 593 /* 593 * If a external debug type comes without a file name, calculate a 594 * likely debug filename for it. (Hack for NT4 drivers.) 594 * If a external debug type comes without a file name, calculate a likely 595 * debug filename for it. (Hack for NT4 drivers and the 'nt' module for 596 * NT and W2K.) Prefer the image name rather than the module name, since 597 * the latter can be normalized or using a different name (e.g. 'nt'). 595 598 */ 596 599 const char *pszExt = NULL; … … 600 603 || pDbgInfo->enmType == RTLDRDBGINFOTYPE_CODEVIEW_PDB70) 601 604 pszExt = ".pdb"; 602 if (pszExt && pArgs->pDbgMod->pszName) 603 { 604 size_t cchName = strlen(pArgs->pDbgMod->pszName); 605 char *psz = (char *)alloca(cchName + strlen(pszExt) + 1); 606 if (psz) 605 if (pszExt) 606 { 607 const char * const pszName = pDbgMod->pszImgFile 608 ? RTPathFilenameEx(pDbgMod->pszImgFile, RTPATH_STR_F_STYLE_DOS) 609 : pDbgMod->pszName; 610 if (pszName) 607 611 { 608 memcpy(psz, pArgs->pDbgMod->pszName, cchName + 1); 609 RTPathStripSuffix(psz); 610 pszExtFile = strcat(psz, pszExt); 612 size_t cchName = strlen(pszName); 613 char *pszExtFileBuf = (char *)alloca(cchName + strlen(pszExt) + 1); 614 if (pszExtFileBuf) 615 { 616 memcpy(pszExtFileBuf, pszName, cchName + 1); 617 RTPathStripSuffix(pszExtFileBuf); 618 pszExtFile = strcat(pszExtFileBuf, pszExt); 619 } 611 620 } 612 621 } 613 614 622 if (!pszExtFile) 615 623 { … … 629 637 &pDbgInfo->u.Pdb70.Uuid, 630 638 pDbgInfo->u.Pdb70.uAge, 631 rtDbgModExtDbgInfoOpenCallback, p Args->pDbgMod, (void *)pDbgInfo);639 rtDbgModExtDbgInfoOpenCallback, pDbgMod, (void *)pDbgInfo); 632 640 break; 633 641 … … 637 645 pDbgInfo->u.Pdb20.uTimestamp, 638 646 pDbgInfo->u.Pdb20.uAge, 639 rtDbgModExtDbgInfoOpenCallback, p Args->pDbgMod, (void *)pDbgInfo);647 rtDbgModExtDbgInfoOpenCallback, pDbgMod, (void *)pDbgInfo); 640 648 break; 641 649 … … 644 652 pDbgInfo->u.Dbg.cbImage, 645 653 pDbgInfo->u.Dbg.uTimestamp, 646 rtDbgModExtDbgInfoOpenCallback, p Args->pDbgMod, (void *)pDbgInfo);654 rtDbgModExtDbgInfoOpenCallback, pDbgMod, (void *)pDbgInfo); 647 655 break; 648 656 … … 650 658 rc = RTDbgCfgOpenDwo(pArgs->hDbgCfg, pszExtFile, 651 659 pDbgInfo->u.Dwo.uCrc32, 652 rtDbgModExtDbgInfoOpenCallback, p Args->pDbgMod, (void *)pDbgInfo);660 rtDbgModExtDbgInfoOpenCallback, pDbgMod, (void *)pDbgInfo); 653 661 break; 654 662 … … 661 669 { 662 670 LogFlow(("RTDbgMod: Successfully opened external debug info '%s' for '%s'\n", 663 p Args->pDbgMod->pszDbgFile, pArgs->pDbgMod->pszImgFile));671 pDbgMod->pszDbgFile, pDbgMod->pszImgFile)); 664 672 return VINF_CALLBACK_RETURN; 665 673 } 666 674 Log(("rtDbgModOpenDebugInfoExternalToImageCallback: '%s' (enmType=%d) for '%s' -> %Rrc\n", 667 pszExtFile, pDbgInfo->enmType, p Args->pDbgMod->pszImgFile, rc));675 pszExtFile, pDbgInfo->enmType, pDbgMod->pszImgFile, rc)); 668 676 return rc; 669 677 }
Note:
See TracChangeset
for help on using the changeset viewer.