VirtualBox

Changeset 75239 in vbox


Ignore:
Timestamp:
Nov 3, 2018 2:54:26 AM (6 years ago)
Author:
vboxsync
Message:

IPRT/dbg: Added RTDbgCfgOpenEx.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/dbg.h

    r74980 r75239  
    674674 *          list.  These status codes will not necessarily be propagated to the
    675675 *          caller in any consistent manner.
    676  * @retval  VINF_CALLBACK_RETURN if successuflly opened the file and it's time
     676 * @retval  VINF_CALLBACK_RETURN if successfully opened the file and it's time
    677677 *          to return
    678  * @retval  VERR_CALLBACK_RETURN if we shouldn't stop searching.
     678 * @retval  VERR_CALLBACK_RETURN if we should stop searching immediately.
    679679 *
    680680 * @param   hDbgCfg             The debugging configuration handle.
     
    688688
    689689
     690RTDECL(int) RTDbgCfgOpenEx(RTDBGCFG hDbgCfg, const char *pszFilename, const char *pszCacheSubDir,
     691                           const char *pszUuidMappingSubDir, uint32_t fFlags,
     692                           PFNRTDBGCFGOPEN pfnCallback, void *pvUser1, void *pvUser2);
    690693RTDECL(int) RTDbgCfgOpenPeImage(RTDBGCFG hDbgCfg, const char *pszFilename, uint32_t cbImage, uint32_t uTimestamp,
    691694                                PFNRTDBGCFGOPEN pfnCallback, void *pvUser1, void *pvUser2);
     
    702705RTDECL(int) RTDbgCfgOpenMachOImage(RTDBGCFG hDbgCfg, const char *pszFilename, PCRTUUID pUuid,
    703706                                   PFNRTDBGCFGOPEN pfnCallback, void *pvUser1, void *pvUser2);
     707
     708/** @name RTDBGCFG_O_XXX - Open flags for RTDbgCfgOpen.
     709 * @{ */
     710/** The operative system mask.  The values are RT_OPSYS_XXX. */
     711#define RTDBGCFG_O_OPSYS_MASK           UINT32_C(0x000000ff)
     712/** Same as RTDBGCFG_FLAGS_NO_SYSTEM_PATHS. */
     713#define RTDBGCFG_O_NO_SYSTEM_PATHS      RT_BIT_32(25)
     714/** The files may be compressed MS styled. */
     715#define RTDBGCFG_O_MAYBE_COMPRESSED_MS  RT_BIT_32(26)
     716/** Whether to make a recursive search. */
     717#define RTDBGCFG_O_RECURSIVE            RT_BIT_32(27)
     718/** We're looking for a separate debug file. */
     719#define RTDBGCFG_O_EXT_DEBUG_FILE       RT_BIT_32(28)
     720/** We're looking for an executable image. */
     721#define RTDBGCFG_O_EXECUTABLE_IMAGE     RT_BIT_32(29)
     722/** The file search should be done in an case insensitive fashion. */
     723#define RTDBGCFG_O_CASE_INSENSITIVE     RT_BIT_32(30)
     724/** Use Windbg style symbol servers when encountered in the path. */
     725#define RTDBGCFG_O_SYMSRV               RT_BIT_32(31)
     726/** Mask of valid flags. */
     727#define RTDBGCFG_O_VALID_MASK           UINT32_C(0xfe0000ff)
     728/** @} */
    704729
    705730
     
    15241549 * @retval  VERR_DBG_ADDRESS_WRAP if off+cb wraps around.
    15251550 * @retval  VERR_INVALID_PARAMETER if the symbol flags sets undefined bits.
     1551 * @retval  VERR_DBG_DUPLICATE_SYMBOL
     1552 * @retval  VERR_DBG_ADDRESS_CONFLICT
    15261553 *
    15271554 * @param   hDbgMod         The module handle.
  • trunk/src/VBox/Runtime/common/dbg/dbgcfg.cpp

    r73334 r75239  
    131131/** Pointer to a read only mnemonic map entry for a uint64_t property. */
    132132typedef RTDBGCFGU64MNEMONIC const *PCRTDBGCFGU64MNEMONIC;
    133 
    134 
    135 /** @name Open flags.
    136  * @{ */
    137 /** The operative system mask.  The values are RT_OPSYS_XXX. */
    138 #define RTDBGCFG_O_OPSYS_MASK           UINT32_C(0x000000ff)
    139 /** The files may be compressed MS styled. */
    140 #define RTDBGCFG_O_MAYBE_COMPRESSED_MS  RT_BIT_32(26)
    141 /** Whether to make a recursive search. */
    142 #define RTDBGCFG_O_RECURSIVE            RT_BIT_32(27)
    143 /** We're looking for a separate debug file. */
    144 #define RTDBGCFG_O_EXT_DEBUG_FILE       RT_BIT_32(28)
    145 /** We're looking for an executable image. */
    146 #define RTDBGCFG_O_EXECUTABLE_IMAGE     RT_BIT_32(29)
    147 /** The file search should be done in an case insensitive fashion. */
    148 #define RTDBGCFG_O_CASE_INSENSITIVE     RT_BIT_32(30)
    149 /** Use Windbg style symbol servers when encountered in the path. */
    150 #define RTDBGCFG_O_SYMSRV               RT_BIT_32(31)
    151 /** @} */
    152133
    153134
     
    631612     */
    632613    if (   (fFlags & RTDBGCFG_O_RECURSIVE)
     614        && pThis
    633615        && !(pThis->fFlags & RTDBGCFG_FLAGS_NO_RECURSIV_SEARCH) )
    634616    {
     
    746728        return VWRN_NOT_FOUND;
    747729    if (!pszCacheSubDir || !*pszCacheSubDir)
     730        return VWRN_NOT_FOUND;
     731    if (!(fFlags & RTDBGCFG_O_SYMSRV))
    748732        return VWRN_NOT_FOUND;
    749733
     
    12071191    AssertPtrReturn(pszCacheSubDir, VERR_INVALID_POINTER);
    12081192    AssertPtrReturn(pfnCallback, VERR_INVALID_POINTER);
     1193    AssertReturn(!(fFlags & ~RTDBGCFG_O_VALID_MASK), VERR_INVALID_FLAGS);
    12091194
    12101195    /*
     
    12121197     * it's case exact or not.
    12131198     */
    1214     bool fDosPath = strchr(pszFilename, ':')  != NULL
    1215                  || strchr(pszFilename, '\\') != NULL
    1216                  || RT_OPSYS_USES_DOS_PATHS(fFlags & RTDBGCFG_O_OPSYS_MASK)
    1217                  || (fFlags & RTDBGCFG_O_CASE_INSENSITIVE);
     1199    bool fDosPath = RT_OPSYS_USES_DOS_PATHS(fFlags & RTDBGCFG_O_OPSYS_MASK)
     1200                 || (fFlags & RTDBGCFG_O_CASE_INSENSITIVE)
     1201                 || strchr(pszFilename, ':')  != NULL
     1202                 || strchr(pszFilename, '\\') != NULL;
    12181203    if (fDosPath)
    12191204        fFlags |= RTDBGCFG_O_CASE_INSENSITIVE;
     
    12821267                    && rc2 != VERR_CALLBACK_RETURN
    12831268                    && (fFlags & RTDBGCFG_O_EXECUTABLE_IMAGE)
     1269                    && !(fFlags & RTDBGCFG_O_NO_SYSTEM_PATHS)
    12841270                    && !(pThis->fFlags & RTDBGCFG_FLAGS_NO_SYSTEM_PATHS) )
    12851271                {
     
    12921278                if (   rc2 != VINF_CALLBACK_RETURN
    12931279                    && rc2 != VERR_CALLBACK_RETURN
     1280                    && !(fFlags & RTDBGCFG_O_NO_SYSTEM_PATHS)
    12941281                    && !(pThis->fFlags & RTDBGCFG_FLAGS_NO_SYSTEM_PATHS) )
    12951282                {
     
    13151302    return rcRet;
    13161303}
     1304
     1305
     1306RTDECL(int) RTDbgCfgOpenEx(RTDBGCFG hDbgCfg, const char *pszFilename, const char *pszCacheSubDir,
     1307                           const char *pszUuidMappingSubDir, uint32_t fFlags,
     1308                           PFNRTDBGCFGOPEN pfnCallback, void *pvUser1, void *pvUser2)
     1309{
     1310    return rtDbgCfgOpenWithSubDir(hDbgCfg, pszFilename, pszCacheSubDir, pszUuidMappingSubDir, fFlags,
     1311                                  pfnCallback, pvUser1, pvUser2);
     1312}
     1313
     1314
    13171315
    13181316
     
    19171915        rtDbgCfgFreeStrList(pList);
    19181916
     1917    PRTLISTNODE pPrependTo = pList;
    19191918    while (*pszValue)
    19201919    {
     
    19651964
    19661965            if (enmOp == RTDBGCFGOP_PREPEND)
    1967                 RTListPrepend(pList, &pNew->ListEntry);
     1966            {
     1967                RTListNodeInsertAfter(pPrependTo, &pNew->ListEntry);
     1968                pPrependTo = &pNew->ListEntry;
     1969            }
    19681970            else
    19691971                RTListAppend(pList, &pNew->ListEntry);
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette