Changeset 83167 in vbox for trunk/src/VBox/Runtime/tools
- Timestamp:
- Feb 26, 2020 11:17:47 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/tools/RTDbgSymCache.cpp
r83078 r83167 151 151 152 152 153 /********************************************************************************************************************************* 154 * Global Variables * 155 *********************************************************************************************************************************/ 156 /** Verbositity level. */ 157 static uint32_t g_iLogLevel = 99; 158 153 159 154 160 /** … … 184 190 " Overwrite existing cache entry.\n" 185 191 , RTPathFilename(pszArg0)); 192 193 194 if (!pszCommand || !strcmp(pszCommand, "get")) 195 RTPrintf("Usage: %s get <query-options> <cache-options> [--output|-o <path>]\n" 196 "\n" 197 "Query Options:\n" 198 " --for-exe[cutable] <path>\n" 199 " Get debug file for the given executable.\n" 200 " --dwo, --dwarf, --dwarf-external\n" 201 " Get external DWARF debug file. Needs --name and --dwo-crc32.\n" 202 " --dsym\n" 203 " Get DWARF debug file from .dSYM bundle. Needs --uuid or --name.\n" 204 " --dbg\n" 205 " Get NT DBG debug file. Needs --name, --timestamp and --size.\n" 206 " --pdb20\n" 207 " Get PDB 2.0 debug file. Needs --name, --timestamp, --size\n" 208 " and --pdb-age (if non-zero).\n" 209 " --pdb70\n" 210 " Get PDB 7.0 debug file. Needs --name, --uuid, and --pdb-age\n" 211 " (if non-zero).\n" 212 " --macho\n" 213 " Get Mach-O image file. Needs --uuid or --name.\n" 214 " --pe\n" 215 " Get PE image file. Needs --name, --timestamp and --size.\n" 216 " --timestamp, --ts, -t <timestamp>\n" 217 " The timestamp (32-bit) for the file to get. Used with --dbg, --pdb20\n" 218 " and --pe.\n" 219 " --uuid, -u, <uuid>\n" 220 " The UUID for the file to get. Used with --dsym, --pdb70 and --macho\n" 221 " --image-size, --size, -z <size>\n" 222 " The image size (32-bit) for the file to get. Used with --dbg,\n" 223 " --pdb20, --pdb70 and --pe.\n" 224 " --pdb-age, -a <age>\n" 225 " The PDB age (32-bit) for the file to get. Used with --pdb20 and --pdb70.\n" 226 " --dwo-crc32, -c <crc32>\n" 227 " The CRC32 for the file to get. Used with --dwo.\n" 228 " --name, -n <name>\n" 229 " The name (in the cache) of the file to get.\n" 230 "\n" 231 "Debug Cache Options:\n" 232 " --sym-path, -s <path>\n" 233 " Adds the path to the debug configuration, NT style with 'srv*' and\n" 234 " 'cache*' prefixes as well as our own 'rec*' and 'norec*' recursion\n" 235 " prefixes.\n" 236 " --env-prefix, -p <prefix>\n" 237 " The enviornment variable prefix, default is 'IPRT_' making the\n" 238 " symbol path variable 'IPRT_PATH'.\n" 239 " --use-native-paths (default), --no-native-paths\n" 240 " Pick up native symbol paths from the environment.\n" 241 "\n" 242 "Output Options:\n" 243 " --output, -o <path>\n" 244 " The output filename or directory. Directories must end with a\n" 245 " path separator. The default filename that in the cache.\n" 246 "\n" 247 "This is handy for triggering downloading of symbol files from a server. Say\n" 248 "you have the executable but want the corrsponding PDB or .dSYM file:\n" 249 " %s get --for-executable VBoxRT.dll\n" 250 " %s get --for-executable VBoxRT.dylib\n" 251 " " 252 , RTPathFilename(pszArg0), RTPathFilename(pszArg0), RTPathFilename(pszArg0)); 253 186 254 return RTEXITCODE_SUCCESS; 255 } 256 257 258 /** 259 * @callback_method_impl{FNRTDBGCFGLOG} 260 */ 261 static DECLCALLBACK(void) rtDbgSymCacheLogCallback(RTDBGCFG hDbgCfg, uint32_t iLevel, const char *pszMsg, void *pvUser) 262 { 263 RT_NOREF(hDbgCfg, pvUser); 264 if (iLevel <= g_iLogLevel) 265 { 266 size_t cchMsg = strlen(pszMsg); 267 if (cchMsg > 0 && pszMsg[cchMsg - 1] == '\n') 268 RTMsgInfo("[%u] %s", iLevel, pszMsg); 269 else if (cchMsg > 0) 270 RTMsgInfo("[%u] %s\n", iLevel, pszMsg); 271 } 187 272 } 188 273 … … 1317 1402 1318 1403 1404 /** 1405 * Debug info + external path for the 'get' command. 1406 */ 1407 typedef struct MYDBGINFO 1408 { 1409 /** The kind of debug info. */ 1410 RTLDRDBGINFOTYPE enmType; 1411 /** The CRC32 of the external file (RTLDRDBGINFOTYPE_DWARF_DWO). */ 1412 uint32_t uDwoCrc32; 1413 /** The PE image size (RTLDRDBGINFOTYPE_CODEVIEW_DBG, 1414 * RTLDRDBGINFOTYPE_CODEVIEW_PDB20, RTLDRDBGINFOTYPE_CODEVIEW_PDB70 (, 1415 * RTLDRDBGINFOTYPE_CODEVIEW, RTLDRDBGINFOTYPE_COFF)). */ 1416 uint32_t cbImage; 1417 /** Timestamp in seconds since unix epoch (RTLDRDBGINFOTYPE_CODEVIEW_DBG, 1418 * RTLDRDBGINFOTYPE_CODEVIEW_PDB20 (, RTLDRDBGINFOTYPE_CODEVIEW, 1419 * RTLDRDBGINFOTYPE_COFF)). */ 1420 uint32_t uTimestamp; 1421 /** The PDB age (RTLDRDBGINFOTYPE_CODEVIEW_PDB20, RTLDRDBGINFOTYPE_CODEVIEW_PDB70). */ 1422 uint32_t uPdbAge; 1423 /** The UUID of the PDB or mach-o image (RTLDRDBGINFOTYPE_CODEVIEW_PDB70, +). */ 1424 RTUUID Uuid; 1425 /** External path (can be empty). */ 1426 char szExtFile[RTPATH_MAX]; 1427 } MYDBGINFO; 1428 1429 /** 1430 * @callback_method_impl{FNRTLDRENUMDBG, For the 'get' command.} 1431 */ 1432 static DECLCALLBACK(int) rtDbgSymCacheCmdGetForExeDbgInfoCallback(RTLDRMOD hLdrMod, PCRTLDRDBGINFO pDbgInfo, void *pvUser) 1433 { 1434 RT_NOREF(hLdrMod); 1435 if (!pDbgInfo->pszExtFile) 1436 switch (pDbgInfo->enmType) 1437 { 1438 case RTLDRDBGINFOTYPE_CODEVIEW_PDB20: 1439 case RTLDRDBGINFOTYPE_CODEVIEW_PDB70: 1440 case RTLDRDBGINFOTYPE_CODEVIEW_DBG: 1441 break; 1442 default: 1443 return VINF_SUCCESS; 1444 } 1445 1446 /* Copy the info: */ 1447 MYDBGINFO *pMyInfo = (MYDBGINFO *)pvUser; 1448 RT_ZERO(*pMyInfo); 1449 pMyInfo->enmType = pDbgInfo->enmType; 1450 int rc = VINF_SUCCESS; 1451 if (pDbgInfo->pszExtFile) 1452 rc = RTStrCopy(pMyInfo->szExtFile, sizeof(pMyInfo->szExtFile), pDbgInfo->pszExtFile); 1453 1454 switch (pDbgInfo->enmType) 1455 { 1456 case RTLDRDBGINFOTYPE_DWARF_DWO: 1457 pMyInfo->uDwoCrc32 = pDbgInfo->u.Dwo.uCrc32; 1458 break; 1459 1460 case RTLDRDBGINFOTYPE_CODEVIEW: 1461 case RTLDRDBGINFOTYPE_COFF: 1462 pMyInfo->cbImage = pDbgInfo->u.Cv.cbImage; 1463 pMyInfo->uTimestamp = pDbgInfo->u.Cv.uTimestamp; 1464 break; 1465 1466 case RTLDRDBGINFOTYPE_CODEVIEW_DBG: 1467 pMyInfo->cbImage = pDbgInfo->u.Dbg.cbImage; 1468 pMyInfo->uTimestamp = pDbgInfo->u.Dbg.uTimestamp; 1469 break; 1470 1471 case RTLDRDBGINFOTYPE_CODEVIEW_PDB20: 1472 pMyInfo->cbImage = pDbgInfo->u.Pdb20.cbImage; 1473 pMyInfo->uTimestamp = pDbgInfo->u.Pdb20.uTimestamp; 1474 pMyInfo->uPdbAge = pDbgInfo->u.Pdb20.uAge; 1475 break; 1476 1477 case RTLDRDBGINFOTYPE_CODEVIEW_PDB70: 1478 pMyInfo->cbImage = pDbgInfo->u.Pdb70.cbImage; 1479 pMyInfo->Uuid = pDbgInfo->u.Pdb70.Uuid; 1480 pMyInfo->uPdbAge = pDbgInfo->u.Pdb70.uAge; 1481 break; 1482 1483 default: 1484 return VINF_SUCCESS; 1485 } 1486 1487 return rc; 1488 } 1489 1490 1491 /** 1492 * @callback_method_impl{FNRTDBGCFGOPEN} 1493 */ 1494 static DECLCALLBACK(int) rtDbgSymCacheCmdGetCallback(RTDBGCFG hDbgCfg, const char *pszFilename, void *pvUser1, void *pvUser2) 1495 { 1496 RT_NOREF(hDbgCfg, pvUser2); 1497 1498 char *pszJoined = NULL; 1499 const char *pszOutput = (const char *)pvUser1; 1500 if (!pszOutput || *pszOutput == '\0') 1501 pszOutput = RTPathFilename(pszFilename); 1502 else if (RTPathFilename(pszOutput) == NULL) 1503 pszOutput = pszJoined = RTPathJoinA(pszOutput, RTPathFilename(pszFilename)); 1504 1505 if (g_iLogLevel > 0) // --pe --name wintypes.dll --image-size 1388544 --timestamp 0x57F8D9F0 1506 RTMsgInfo("Copying '%s' to '%s...", pszFilename, pszOutput); 1507 int rc = RTFileCopy(pszFilename, pszOutput); 1508 if (RT_FAILURE(rc)) 1509 { 1510 if (rc == VERR_ALREADY_EXISTS) 1511 { 1512 rc = RTFileCompare(pszFilename, pszOutput); 1513 if (RT_SUCCESS(rc)) 1514 RTMsgInfo("Output '%s' exists and matches '%s'.", pszOutput, pszFilename); 1515 else 1516 RTMsgError("Output '%s' already exists (does not match '%s')", pszOutput, pszFilename); 1517 } 1518 else 1519 RTMsgError("Copying '%s' to '%s failed: %Rrc", pszFilename, pszOutput, rc); 1520 } 1521 RTStrFree(pszJoined); 1522 if (RT_SUCCESS(rc)) 1523 return VINF_CALLBACK_RETURN; 1524 return rc; 1525 } 1526 1527 1528 /** 1529 * Handles the 'get' command. 1530 * 1531 * @returns Program exit code. 1532 * @param pszArg0 The program name. 1533 * @param cArgs The number of arguments to the 'add' command. 1534 * @param papszArgs The argument vector, starting after 'add'. 1535 */ 1536 static RTEXITCODE rtDbgSymCacheCmdGet(const char *pszArg0, int cArgs, char **papszArgs) 1537 { 1538 RTERRINFOSTATIC ErrInfo; 1539 1540 /* 1541 * Parse the command line. 1542 */ 1543 static RTGETOPTDEF const s_aOptions[] = 1544 { 1545 { "--output", 'o', RTGETOPT_REQ_STRING }, 1546 1547 /* Query: */ 1548 { "--for-exe", 'e', RTGETOPT_REQ_STRING }, 1549 { "--for-executable", 'e', RTGETOPT_REQ_STRING }, 1550 { "--uuid", 'u', RTGETOPT_REQ_UUID }, 1551 { "--ts", 't', RTGETOPT_REQ_UINT32 }, 1552 { "--timestamp", 't', RTGETOPT_REQ_UINT32 }, 1553 { "--size", 'z', RTGETOPT_REQ_UINT32 }, 1554 { "--image-size", 'z', RTGETOPT_REQ_UINT32 }, 1555 { "--pdb-age", 'a', RTGETOPT_REQ_UINT32 }, 1556 { "--dwo-crc32", 'c', RTGETOPT_REQ_UINT32 }, 1557 { "--name", 'n', RTGETOPT_REQ_STRING }, 1558 1559 { "--dwo", 'd', RTGETOPT_REQ_NOTHING }, 1560 { "--dwarf", 'd', RTGETOPT_REQ_NOTHING }, 1561 { "--dwarf-external", 'd', RTGETOPT_REQ_NOTHING }, 1562 { "--dsym", 'D', RTGETOPT_REQ_NOTHING }, 1563 { "--dbg", '0', RTGETOPT_REQ_NOTHING }, 1564 { "--pdb20", '2', RTGETOPT_REQ_NOTHING }, 1565 { "--pdb70", '7', RTGETOPT_REQ_NOTHING }, 1566 1567 { "--pe", 'P', RTGETOPT_REQ_NOTHING }, 1568 { "--macho", 'M', RTGETOPT_REQ_NOTHING }, 1569 { "--elf", 'E', RTGETOPT_REQ_NOTHING }, 1570 1571 /* RTDbgCfg: */ 1572 { "--env-prefix", 'p', RTGETOPT_REQ_STRING }, 1573 { "--sym-path", 's', RTGETOPT_REQ_STRING }, 1574 { "--use-native-paths", 1000, RTGETOPT_REQ_NOTHING }, 1575 { "--no-native-paths", 1001, RTGETOPT_REQ_NOTHING }, 1576 }; 1577 1578 RTGETOPTSTATE State; 1579 int rc = RTGetOptInit(&State, cArgs, papszArgs, &s_aOptions[0], RT_ELEMENTS(s_aOptions), 0, RTGETOPTINIT_FLAGS_OPTS_FIRST); 1580 if (RT_FAILURE(rc)) 1581 return RTMsgErrorExit(RTEXITCODE_FAILURE, "RTGetOptInit failed: %Rrc", rc); 1582 1583 const char *pszOutput = NULL; 1584 1585 bool fGetExeImage = true; 1586 const char *pszForExec = NULL; 1587 const char *pszName = NULL; 1588 RTLDRARCH enmImageArch = RTLDRARCH_WHATEVER; 1589 RTLDRFMT enmImageFmt = RTLDRFMT_INVALID; 1590 MYDBGINFO DbgInfo; 1591 RT_ZERO(DbgInfo); 1592 1593 const char *pszEnvPrefix = "IPRT_"; 1594 bool fNativePaths = true; 1595 const char *apszSymPaths[12] = { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }; 1596 unsigned cSymPaths = 0; 1597 1598 RTGETOPTUNION ValueUnion; 1599 int chOpt; 1600 while ((chOpt = RTGetOpt(&State, &ValueUnion)) != 0) 1601 { 1602 switch (chOpt) 1603 { 1604 case 'o': 1605 pszOutput = ValueUnion.psz; 1606 break; 1607 1608 /* 1609 * Query elements: 1610 */ 1611 case 'z': 1612 DbgInfo.cbImage = ValueUnion.u32; 1613 break; 1614 1615 case 't': 1616 DbgInfo.uTimestamp = ValueUnion.u32; 1617 enmImageFmt = RTLDRFMT_PE; 1618 break; 1619 1620 case 'u': 1621 DbgInfo.Uuid = ValueUnion.Uuid; 1622 enmImageFmt = RTLDRFMT_MACHO; 1623 break; 1624 1625 case 'a': 1626 DbgInfo.uPdbAge = ValueUnion.u32; 1627 if (DbgInfo.enmType != RTLDRDBGINFOTYPE_CODEVIEW_PDB20) 1628 DbgInfo.enmType = RTLDRDBGINFOTYPE_CODEVIEW_PDB70; 1629 break; 1630 1631 case 'c': 1632 DbgInfo.uDwoCrc32 = ValueUnion.u32; 1633 DbgInfo.enmType = RTLDRDBGINFOTYPE_DWARF_DWO; 1634 break; 1635 1636 case 'n': 1637 pszName = ValueUnion.psz; 1638 DbgInfo.szExtFile[0] = '\0'; 1639 break; 1640 1641 case 'd': 1642 fGetExeImage = false; 1643 DbgInfo.enmType = RTLDRDBGINFOTYPE_DWARF_DWO; 1644 break; 1645 1646 case 'D': 1647 fGetExeImage = false; 1648 DbgInfo.enmType = RTLDRDBGINFOTYPE_DWARF; /* == dSYM */ 1649 break; 1650 1651 case '0': 1652 fGetExeImage = false; 1653 DbgInfo.enmType = RTLDRDBGINFOTYPE_CODEVIEW_DBG; 1654 break; 1655 1656 case '2': 1657 fGetExeImage = false; 1658 DbgInfo.enmType = RTLDRDBGINFOTYPE_CODEVIEW_PDB20; 1659 break; 1660 1661 case '7': 1662 fGetExeImage = false; 1663 DbgInfo.enmType = RTLDRDBGINFOTYPE_CODEVIEW_PDB70; 1664 break; 1665 1666 case 'E': 1667 fGetExeImage = true; 1668 enmImageFmt = RTLDRFMT_ELF; 1669 break; 1670 1671 case 'M': 1672 fGetExeImage = true; 1673 enmImageFmt = RTLDRFMT_MACHO; 1674 break; 1675 1676 case 'P': 1677 fGetExeImage = true; 1678 enmImageFmt = RTLDRFMT_PE; 1679 break; 1680 1681 case 'e': 1682 { 1683 /* Open the executable and retrieve the query parameters from it: */ 1684 fGetExeImage = false; 1685 pszForExec = ValueUnion.psz; 1686 if (!pszName) 1687 pszName = RTPathFilename(pszForExec); 1688 1689 RTLDRMOD hLdrMod; 1690 rc = RTLdrOpenEx(pszForExec, RTLDR_O_FOR_DEBUG, enmImageArch, &hLdrMod, RTErrInfoInitStatic(&ErrInfo)); 1691 if (RT_FAILURE(rc)) 1692 return RTMsgErrorExitFailure("Failed to open image '%s': %Rrc%#RTeim", pszForExec, rc, &ErrInfo); 1693 1694 DbgInfo.cbImage = (uint32_t)RTLdrSize(hLdrMod); 1695 enmImageFmt = RTLdrGetFormat(hLdrMod); 1696 if (enmImageFmt == RTLDRFMT_MACHO) 1697 { 1698 DbgInfo.enmType = RTLDRDBGINFOTYPE_DWARF; /* .dSYM */ 1699 rc = RTLdrQueryProp(hLdrMod, RTLDRPROP_UUID, &DbgInfo.Uuid, sizeof(DbgInfo.Uuid)); 1700 if (RT_FAILURE(rc)) 1701 RTMsgError("Failed to query image UUID from '%s': %Rrc", pszForExec, rc); 1702 } 1703 else 1704 { 1705 rc = RTLdrQueryProp(hLdrMod, RTLDRPROP_TIMESTAMP_SECONDS, &DbgInfo.uTimestamp, sizeof(DbgInfo.uTimestamp)); 1706 if (RT_SUCCESS(rc) || (rc == VERR_NOT_FOUND && enmImageFmt != RTLDRFMT_PE)) 1707 { 1708 RT_ZERO(DbgInfo); 1709 rc = RTLdrEnumDbgInfo(hLdrMod, NULL, rtDbgSymCacheCmdGetForExeDbgInfoCallback, &DbgInfo); 1710 if (RT_FAILURE(rc)) 1711 RTMsgError("RTLdrEnumDbgInfo failed on '%s': %Rrc", pszForExec, rc); 1712 } 1713 else if (RT_FAILURE(rc)) 1714 RTMsgError("Failed to query image timestamp from '%s': %Rrc", pszForExec, rc); 1715 } 1716 1717 RTLdrClose(hLdrMod); 1718 if (RT_FAILURE(rc)) 1719 return RTEXITCODE_FAILURE; 1720 break; 1721 } 1722 1723 /* 1724 * RTDbgCfg setup: 1725 */ 1726 case 'p': 1727 pszEnvPrefix = ValueUnion.psz; 1728 break; 1729 1730 case 's': 1731 if (cSymPaths < RT_ELEMENTS(apszSymPaths)) 1732 apszSymPaths[cSymPaths++] = ValueUnion.psz; 1733 else 1734 return RTMsgErrorExit(RTEXITCODE_SYNTAX, "Too many --sym-paths arguments: max %u", RT_ELEMENTS(apszSymPaths)); 1735 break; 1736 1737 case 1000: 1738 fNativePaths = true; 1739 break; 1740 1741 case 1001: 1742 fNativePaths = false; 1743 break; 1744 1745 case 'h': 1746 return rtDbgSymCacheUsage(pszArg0, "get"); 1747 case 'V': 1748 return rtDbgSymCacheVersion(); 1749 default: 1750 return RTGetOptPrintError(chOpt, &ValueUnion); 1751 } 1752 } 1753 1754 /* 1755 * Instantiate the debug config we'll be querying. 1756 */ 1757 RTDBGCFG hDbgCfg; 1758 rc = RTDbgCfgCreate(&hDbgCfg, pszEnvPrefix, fNativePaths); 1759 if (RT_FAILURE(rc)) 1760 return RTMsgErrorExit(RTEXITCODE_FAILURE, "RTDbgCfgCreate failed: %Rrc", rc); 1761 1762 rc = RTDbgCfgSetLogCallback(hDbgCfg, rtDbgSymCacheLogCallback, NULL); 1763 AssertRCStmt(rc, RTMsgError("RTDbgCfgSetLogCallback failed: %Rrc", rc)); 1764 1765 for (unsigned i = 0; i < cSymPaths && RT_SUCCESS(rc); i++) 1766 { 1767 rc = RTDbgCfgChangeString(hDbgCfg, RTDBGCFGPROP_PATH, RTDBGCFGOP_APPEND, apszSymPaths[i]); 1768 if (RT_FAILURE(rc)) 1769 RTMsgError("Failed to append symbol path '%s': %Rrc", apszSymPaths[i], rc); 1770 } 1771 if (RT_SUCCESS(rc)) 1772 { 1773 /* 1774 * Do the getting. 1775 */ 1776 if (fGetExeImage) 1777 { 1778 if (enmImageFmt == RTLDRFMT_INVALID) 1779 { 1780 if (!RTUuidIsNull(&DbgInfo.Uuid)) 1781 enmImageFmt = RTLDRFMT_MACHO; 1782 else if (DbgInfo.cbImage && DbgInfo.uTimestamp) 1783 enmImageFmt = RTLDRFMT_PE; 1784 else 1785 rc = RTMsgErrorRc(VERR_NOT_IMPLEMENTED, "Not enough to go on to find executable"); 1786 } 1787 if (enmImageFmt == RTLDRFMT_PE) 1788 rc = RTDbgCfgOpenPeImage(hDbgCfg, pszName, DbgInfo.cbImage, DbgInfo.uTimestamp, 1789 rtDbgSymCacheCmdGetCallback, (void *)pszOutput, NULL); 1790 else if (enmImageFmt == RTLDRFMT_MACHO) 1791 rc = RTDbgCfgOpenMachOImage(hDbgCfg, pszName, &DbgInfo.Uuid, 1792 rtDbgSymCacheCmdGetCallback, (void *)pszOutput, NULL); 1793 else if (enmImageFmt != RTLDRFMT_INVALID) 1794 rc = RTMsgErrorRc(VERR_NOT_IMPLEMENTED, "Format not implemented: %s", RTLdrGetFormat); 1795 } 1796 else if (DbgInfo.enmType == RTLDRDBGINFOTYPE_CODEVIEW_PDB70) 1797 rc = RTDbgCfgOpenPdb70(hDbgCfg, DbgInfo.szExtFile[0] ? DbgInfo.szExtFile : pszName, &DbgInfo.Uuid, DbgInfo.uPdbAge, 1798 rtDbgSymCacheCmdGetCallback, (void *)pszOutput, NULL); 1799 else if (DbgInfo.enmType == RTLDRDBGINFOTYPE_CODEVIEW_PDB20) 1800 rc = RTDbgCfgOpenPdb20(hDbgCfg, DbgInfo.szExtFile[0] ? DbgInfo.szExtFile : pszName, DbgInfo.cbImage, 1801 DbgInfo.uTimestamp, DbgInfo.uPdbAge, rtDbgSymCacheCmdGetCallback, (void *)pszOutput, NULL); 1802 else if (DbgInfo.enmType == RTLDRDBGINFOTYPE_CODEVIEW_DBG) 1803 rc = RTDbgCfgOpenDbg(hDbgCfg, DbgInfo.szExtFile[0] ? DbgInfo.szExtFile : pszName, DbgInfo.cbImage, 1804 DbgInfo.uTimestamp, rtDbgSymCacheCmdGetCallback, (void *)pszOutput, NULL); 1805 else if (DbgInfo.enmType == RTLDRDBGINFOTYPE_DWARF_DWO) 1806 rc = RTDbgCfgOpenDwo(hDbgCfg, DbgInfo.szExtFile[0] ? DbgInfo.szExtFile : pszName, DbgInfo.uDwoCrc32, 1807 rtDbgSymCacheCmdGetCallback, (void *)pszOutput, NULL); 1808 else if (DbgInfo.enmType == RTLDRDBGINFOTYPE_DWARF) 1809 rc = RTDbgCfgOpenDsymBundle(hDbgCfg, DbgInfo.szExtFile[0] ? DbgInfo.szExtFile : pszName, &DbgInfo.Uuid, 1810 rtDbgSymCacheCmdGetCallback, (void *)pszOutput, NULL); 1811 else 1812 rc = RTMsgErrorRc(VERR_NOT_IMPLEMENTED, "Format not implemented"); 1813 } 1814 1815 RTDbgCfgRelease(hDbgCfg); 1816 return RT_SUCCESS(rc) ? RTEXITCODE_SUCCESS : RTEXITCODE_FAILURE; 1817 } 1818 1819 1319 1820 int main(int argc, char **argv) 1320 1821 { … … 1331 1832 else if (!strcmp(argv[1], "add")) 1332 1833 rcExit = rtDbgSymCacheCmdAdd(argv[0], argc - 2, argv + 2); 1834 else if (!strcmp(argv[1], "get")) 1835 rcExit = rtDbgSymCacheCmdGet(argv[0], argc - 2, argv + 2); 1333 1836 else if ( !strcmp(argv[1], "-h") 1334 1837 || !strcmp(argv[1], "-?")
Note:
See TracChangeset
for help on using the changeset viewer.