VirtualBox

儲存庫 vbox 的更動 41493


忽略:
時間撮記:
2012-5-30 下午01:47:41 (12 年 以前)
作者:
vboxsync
訊息:

RTDbg*SymbolByAddr*: Added a flag parameter.

位置:
trunk
檔案:
修改 9 筆資料

圖例:

未更動
新增
刪除
  • trunk/include/iprt/dbg.h

    r40855 r41493  
    6060/** The last valid special segment index. */
    6161#define RTDBGSEGIDX_SPECIAL_FIRST   (RTDBGSEGIDX_LAST + 1U)
     62
     63
     64/** @name RTDBGSYMADDR_FLAGS_XXX
     65 * Flags used when looking up a symbol by address.
     66 * @{ */
     67/** Less or equal address. (default) */
     68#define RTDBGSYMADDR_FLAGS_LESS_OR_EQUAL    UINT32_C(0)
     69/** Greater or equal address.  */
     70#define RTDBGSYMADDR_FLAGS_GREATER_OR_EQUAL UINT32_C(1)
     71/** Mask of valid flags. */
     72#define RTDBGSYMADDR_FLAGS_VALID_MASK       UINT32_C(1)
     73/** @} */
    6274
    6375
     
    505517 * @retval  VERR_INVALID_HANDLE if hDbgAs is invalid.
    506518 * @retval  VERR_NOT_FOUND if the address couldn't be mapped to a module.
     519 * @retval  VERR_INVALID_PARAMETER if incorrect flags.
    507520 *
    508521 * @param   hDbgAs          The address space handle.
    509522 * @param   Addr            The address which closest symbol is requested.
     523 * @param   fFlags              Symbol search flags, see RTDBGSYMADDR_FLAGS_XXX.
    510524 * @param   poffDisp        Where to return the distance between the symbol
    511525 *                          and address. Optional.
     
    513527 * @param   phMod           Where to return the module handle. Optional.
    514528 */
    515 RTDECL(int) RTDbgAsSymbolByAddr(RTDBGAS hDbgAs, RTUINTPTR Addr, PRTINTPTR poffDisp, PRTDBGSYMBOL pSymbol, PRTDBGMOD phMod);
     529RTDECL(int) RTDbgAsSymbolByAddr(RTDBGAS hDbgAs, RTUINTPTR Addr, uint32_t fFlags,
     530                                PRTINTPTR poffDisp, PRTDBGSYMBOL pSymbol, PRTDBGMOD phMod);
    516531
    517532/**
     
    521536 * @retval  VERR_INVALID_HANDLE if hDbgAs is invalid.
    522537 * @retval  VERR_NOT_FOUND if the address couldn't be mapped to a module.
     538 * @retval  VERR_INVALID_PARAMETER if incorrect flags.
    523539 *
    524540 * @param   hDbgAs          The address space handle.
    525541 * @param   Addr            The address which closest symbol is requested.
     542 * @param   fFlags              Symbol search flags, see RTDBGSYMADDR_FLAGS_XXX.
    526543 * @param   poffDisp        Where to return the distance between the symbol
    527544 *                          and address. Optional.
     
    530547 * @param   phMod           Where to return the module handle. Optional.
    531548 */
    532 RTDECL(int) RTDbgAsSymbolByAddrA(RTDBGAS hDbgAs, RTUINTPTR Addr, PRTINTPTR poffDisp, PRTDBGSYMBOL *ppSymInfo, PRTDBGMOD phMod);
     549RTDECL(int) RTDbgAsSymbolByAddrA(RTDBGAS hDbgAs, RTUINTPTR Addr, uint32_t fFlags,
     550                                 PRTINTPTR poffDisp, PRTDBGSYMBOL *ppSymInfo, PRTDBGMOD phMod);
    533551
    534552/**
     
    936954 * @retval  VERR_DBG_INVALID_SEGMENT_OFFSET if the segment offset is beyond the
    937955 *          end of the segment.
     956 * @retval  VERR_INVALID_PARAMETER if incorrect flags.
    938957 *
    939958 * @param   hDbgMod             The module handle.
    940959 * @param   iSeg                The segment number.
    941960 * @param   off                 The offset into the segment.
     961 * @param   fFlags              Symbol search flags, see RTDBGSYMADDR_FLAGS_XXX.
    942962 * @param   poffDisp            Where to store the distance between the
    943963 *                              specified address and the returned symbol.
     
    945965 * @param   pSymInfo            Where to store the symbol information.
    946966 */
    947 RTDECL(int)         RTDbgModSymbolByAddr(RTDBGMOD hDbgMod, RTDBGSEGIDX iSeg, RTUINTPTR off, PRTINTPTR poffDisp, PRTDBGSYMBOL pSymInfo);
     967RTDECL(int)         RTDbgModSymbolByAddr(RTDBGMOD hDbgMod, RTDBGSEGIDX iSeg, RTUINTPTR off, uint32_t fFlags,
     968                                         PRTINTPTR poffDisp, PRTDBGSYMBOL pSymInfo);
    948969
    949970/**
     
    964985 *          end of the segment.
    965986 * @retval  VERR_NO_MEMORY if RTDbgSymbolAlloc fails.
     987 * @retval  VERR_INVALID_PARAMETER if incorrect flags.
    966988 *
    967989 * @param   hDbgMod             The module handle.
    968990 * @param   iSeg                The segment index.
    969991 * @param   off                 The offset into the segment.
     992 * @param   fFlags              Symbol search flags, see RTDBGSYMADDR_FLAGS_XXX.
    970993 * @param   poffDisp            Where to store the distance between the
    971994 *                              specified address and the returned symbol. Optional.
     
    974997 *                              RTDbgSymbolFree.
    975998 */
    976 RTDECL(int)         RTDbgModSymbolByAddrA(RTDBGMOD hDbgMod, RTDBGSEGIDX iSeg, RTUINTPTR off, PRTINTPTR poffDisp, PRTDBGSYMBOL *ppSymInfo);
     999RTDECL(int)         RTDbgModSymbolByAddrA(RTDBGMOD hDbgMod, RTDBGSEGIDX iSeg, RTUINTPTR off, uint32_t fFlags,
     1000                                          PRTINTPTR poffDisp, PRTDBGSYMBOL *ppSymInfo);
    9771001
    9781002/**
  • trunk/src/VBox/Runtime/common/dbg/dbgas.cpp

    r39032 r41493  
    12891289 * @retval  VERR_INVALID_HANDLE if hDbgAs is invalid.
    12901290 * @retval  VERR_NOT_FOUND if the address couldn't be mapped to a module.
     1291 * @retval  VERR_INVALID_PARAMETER if incorrect flags.
    12911292 *
    12921293 * @param   hDbgAs          The address space handle.
    12931294 * @param   Addr            The address which closest symbol is requested.
    1294  * @param   poffDisp        Where to return the distance between the symbol
    1295  *                          and address. Optional.
     1295 * @param   fFlags          Symbol search flags, see RTDBGSYMADDR_FLAGS_XXX.
     1296 * @param   poffDisp        Where to return the distance between the symbol and
     1297 *                          address. Optional.
    12961298 * @param   pSymbol         Where to return the symbol info.
    12971299 * @param   phMod           Where to return the module handle. Optional.
    12981300 */
    1299 RTDECL(int) RTDbgAsSymbolByAddr(RTDBGAS hDbgAs, RTUINTPTR Addr, PRTINTPTR poffDisp, PRTDBGSYMBOL pSymbol, PRTDBGMOD phMod)
     1301RTDECL(int) RTDbgAsSymbolByAddr(RTDBGAS hDbgAs, RTUINTPTR Addr, uint32_t fFlags,
     1302                                PRTINTPTR poffDisp, PRTDBGSYMBOL pSymbol, PRTDBGMOD phMod)
    13001303{
    13011304    /*
     
    13191322     * Forward the call.
    13201323     */
    1321     int rc = RTDbgModSymbolByAddr(hMod, iSeg, offSeg, poffDisp, pSymbol);
     1324    int rc = RTDbgModSymbolByAddr(hMod, iSeg, offSeg, fFlags, poffDisp, pSymbol);
    13221325    if (RT_SUCCESS(rc))
    13231326        rtDbgAsAdjustSymbolValue(pSymbol, hMod, MapAddr, iSeg);
     
    13371340 * @retval  VERR_INVALID_HANDLE if hDbgAs is invalid.
    13381341 * @retval  VERR_NOT_FOUND if the address couldn't be mapped to a module.
     1342 * @retval  VERR_INVALID_PARAMETER if incorrect flags.
    13391343 *
    13401344 * @param   hDbgAs          The address space handle.
    13411345 * @param   Addr            The address which closest symbol is requested.
     1346 * @param   fFlags              Symbol search flags, see RTDBGSYMADDR_FLAGS_XXX.
    13421347 * @param   poffDisp        Where to return the distance between the symbol
    13431348 *                          and address. Optional.
     
    13461351 * @param   phMod           Where to return the module handle. Optional.
    13471352 */
    1348 RTDECL(int) RTDbgAsSymbolByAddrA(RTDBGAS hDbgAs, RTUINTPTR Addr, PRTINTPTR poffDisp, PRTDBGSYMBOL *ppSymInfo, PRTDBGMOD phMod)
     1353RTDECL(int) RTDbgAsSymbolByAddrA(RTDBGAS hDbgAs, RTUINTPTR Addr, uint32_t fFlags,
     1354                                 PRTINTPTR poffDisp, PRTDBGSYMBOL *ppSymInfo, PRTDBGMOD phMod)
    13491355{
    13501356    /*
     
    13681374     * Forward the call.
    13691375     */
    1370     int rc = RTDbgModSymbolByAddrA(hMod, iSeg, offSeg, poffDisp, ppSymInfo);
     1376    int rc = RTDbgModSymbolByAddrA(hMod, iSeg, offSeg, fFlags, poffDisp, ppSymInfo);
    13711377    if (RT_SUCCESS(rc))
    13721378        rtDbgAsAdjustSymbolValue(*ppSymInfo, hMod, MapAddr, iSeg);
  • trunk/src/VBox/Runtime/common/dbg/dbgmod.cpp

    r39083 r41493  
    11211121 * @retval  VERR_DBG_INVALID_SEGMENT_OFFSET if the segment offset is beyond the
    11221122 *          end of the segment.
     1123 * @retval  VERR_INVALID_PARAMETER if incorrect flags.
    11231124 *
    11241125 * @param   hDbgMod             The module handle.
    11251126 * @param   iSeg                The segment number.
    11261127 * @param   off                 The offset into the segment.
     1128 * @param   fFlags              Symbol search flags, see RTDBGSYMADDR_FLAGS_XXX.
    11271129 * @param   poffDisp            Where to store the distance between the
    11281130 *                              specified address and the returned symbol.
     
    11301132 * @param   pSymInfo            Where to store the symbol information.
    11311133 */
    1132 RTDECL(int) RTDbgModSymbolByAddr(RTDBGMOD hDbgMod, RTDBGSEGIDX iSeg, RTUINTPTR off, PRTINTPTR poffDisp, PRTDBGSYMBOL pSymInfo)
     1134RTDECL(int) RTDbgModSymbolByAddr(RTDBGMOD hDbgMod, RTDBGSEGIDX iSeg, RTUINTPTR off, uint32_t fFlags,
     1135                                 PRTINTPTR poffDisp, PRTDBGSYMBOL pSymInfo)
    11331136{
    11341137    /*
     
    11391142    AssertPtrNull(poffDisp);
    11401143    AssertPtr(pSymInfo);
     1144    AssertReturn(!(fFlags & ~RTDBGSYMADDR_FLAGS_VALID_MASK), VERR_INVALID_PARAMETER);
    11411145
    11421146    RTDBGMOD_LOCK(pDbgMod);
     
    11581162     * Get down to business.
    11591163     */
    1160     int rc = pDbgMod->pDbgVt->pfnSymbolByAddr(pDbgMod, iSeg, off, poffDisp, pSymInfo);
     1164    int rc = pDbgMod->pDbgVt->pfnSymbolByAddr(pDbgMod, iSeg, off, fFlags, poffDisp, pSymInfo);
    11611165
    11621166    RTDBGMOD_UNLOCK(pDbgMod);
     
    11831187 *          end of the segment.
    11841188 * @retval  VERR_NO_MEMORY if RTDbgSymbolAlloc fails.
     1189 * @retval  VERR_INVALID_PARAMETER if incorrect flags.
    11851190 *
    11861191 * @param   hDbgMod             The module handle.
    11871192 * @param   iSeg                The segment index.
    11881193 * @param   off                 The offset into the segment.
     1194 * @param   fFlags              Symbol search flags, see RTDBGSYMADDR_FLAGS_XXX.
    11891195 * @param   poffDisp            Where to store the distance between the
    11901196 *                              specified address and the returned symbol. Optional.
     
    11931199 *                              RTDbgSymbolFree.
    11941200 */
    1195 RTDECL(int) RTDbgModSymbolByAddrA(RTDBGMOD hDbgMod, RTDBGSEGIDX iSeg, RTUINTPTR off, PRTINTPTR poffDisp, PRTDBGSYMBOL *ppSymInfo)
     1201RTDECL(int) RTDbgModSymbolByAddrA(RTDBGMOD hDbgMod, RTDBGSEGIDX iSeg, RTUINTPTR off, uint32_t fFlags,
     1202                                  PRTINTPTR poffDisp, PRTDBGSYMBOL *ppSymInfo)
    11961203{
    11971204    AssertPtr(ppSymInfo);
     
    12021209        return VERR_NO_MEMORY;
    12031210
    1204     int rc = RTDbgModSymbolByAddr(hDbgMod, iSeg, off, poffDisp, pSymInfo);
     1211    int rc = RTDbgModSymbolByAddr(hDbgMod, iSeg, off, fFlags, poffDisp, pSymInfo);
    12051212
    12061213    if (RT_SUCCESS(rc))
  • trunk/src/VBox/Runtime/common/dbg/dbgmodcontainer.cpp

    r39083 r41493  
    288288
    289289/** @copydoc RTDBGMODVTDBG::pfnSymbolByAddr */
    290 static DECLCALLBACK(int) rtDbgModContainer_SymbolByAddr(PRTDBGMODINT pMod, RTDBGSEGIDX iSeg, RTUINTPTR off,
     290static DECLCALLBACK(int) rtDbgModContainer_SymbolByAddr(PRTDBGMODINT pMod, RTDBGSEGIDX iSeg, RTUINTPTR off, uint32_t fFlags,
    291291                                                        PRTINTPTR poffDisp, PRTDBGSYMBOL pSymInfo)
    292292{
     
    312312                                                            : &pThis->paSegs[iSeg].SymAddrTree,
    313313                                                            off,
    314                                                             false /*fAbove*/);
     314                                                            fFlags == RTDBGSYMADDR_FLAGS_GREATER_OR_EQUAL /*fAbove*/);
    315315    if (!pAvlCore)
    316316        return VERR_SYMBOL_NOT_FOUND;
  • trunk/src/VBox/Runtime/common/dbg/dbgmoddwarf.cpp

    r39515 r41493  
    33013301
    33023302/** @interface_method_impl{RTDBGMODVTDBG,pfnSymbolByAddr} */
    3303 static DECLCALLBACK(int) rtDbgModDwarf_SymbolByAddr(PRTDBGMODINT pMod, RTDBGSEGIDX iSeg, RTUINTPTR off,
     3303static DECLCALLBACK(int) rtDbgModDwarf_SymbolByAddr(PRTDBGMODINT pMod, RTDBGSEGIDX iSeg, RTUINTPTR off, uint32_t fFlags,
    33043304                                                    PRTINTPTR poffDisp, PRTDBGSYMBOL pSymInfo)
    33053305{
    33063306    PRTDBGMODDWARF pThis = (PRTDBGMODDWARF)pMod->pvDbgPriv;
    3307     return RTDbgModSymbolByAddr(pThis->hCnt, iSeg, off, poffDisp, pSymInfo);
     3307    return RTDbgModSymbolByAddr(pThis->hCnt, iSeg, off, fFlags, poffDisp, pSymInfo);
    33083308}
    33093309
  • trunk/src/VBox/Runtime/common/dbg/dbgmodnm.cpp

    r39389 r41493  
    9292
    9393/** @interface_method_impl{RTDBGMODVTDBG,pfnSymbolByAddr} */
    94 static DECLCALLBACK(int) rtDbgModNm_SymbolByAddr(PRTDBGMODINT pMod, RTDBGSEGIDX iSeg, RTUINTPTR off,
     94static DECLCALLBACK(int) rtDbgModNm_SymbolByAddr(PRTDBGMODINT pMod, RTDBGSEGIDX iSeg, RTUINTPTR off, uint32_t fFlags,
    9595                                                 PRTINTPTR poffDisp, PRTDBGSYMBOL pSymInfo)
    9696{
    9797    PRTDBGMODNM pThis = (PRTDBGMODNM)pMod->pvDbgPriv;
    98     return RTDbgModSymbolByAddr(pThis->hCnt, iSeg, off, poffDisp, pSymInfo);
     98    return RTDbgModSymbolByAddr(pThis->hCnt, iSeg, off, fFlags, poffDisp, pSymInfo);
    9999}
    100100
  • trunk/src/VBox/Runtime/include/internal/dbgmod.h

    r38581 r41493  
    364364     * @param   iSeg        The segment number (0-based) or RTDBGSEGIDX_ABS.
    365365     * @param   off         The offset into the segment.
     366     * @param   fFlags      Symbol search flags, see RTDBGSYMADDR_FLAGS_XXX.
    366367     * @param   poffDisp    Where to store the distance between the specified address
    367368     *                      and the returned symbol. Optional.
    368369     * @param   pSymInfo    Where to store the symbol information.
    369370     */
    370     DECLCALLBACKMEMBER(int, pfnSymbolByAddr)(PRTDBGMODINT pMod, uint32_t iSeg, RTUINTPTR off, PRTINTPTR poffDisp, PRTDBGSYMBOL pSymInfo);
     371    DECLCALLBACKMEMBER(int, pfnSymbolByAddr)(PRTDBGMODINT pMod, uint32_t iSeg, RTUINTPTR off, uint32_t fFlags,
     372                                             PRTINTPTR poffDisp, PRTDBGSYMBOL pSymInfo);
    371373
    372374
  • trunk/src/VBox/Runtime/tools/RTLdrFlt.cpp

    r38636 r41493  
    322322                    RTDBGSYMBOL Symbol;
    323323                    RTINTPTR    offSym;
    324                     rc = RTDbgAsSymbolByAddr(hDbgAs, u64Address, &offSym, &Symbol, NULL);
     324                    rc = RTDbgAsSymbolByAddr(hDbgAs, u64Address, RTDBGSYMADDR_FLAGS_LESS_OR_EQUAL, &offSym, &Symbol, NULL);
    325325                    if (RT_SUCCESS(rc))
    326326                    {
  • trunk/src/VBox/VMM/VMMR3/DBGFAddrSpace.cpp

    r39477 r41493  
    10111011     */
    10121012    RTDBGMOD hMod;
    1013     int rc = RTDbgAsSymbolByAddr(hRealAS, pAddress->FlatPtr, poffDisp, pSymbol, &hMod);
     1013    int rc = RTDbgAsSymbolByAddr(hRealAS, pAddress->FlatPtr, poffDisp, RTDBGSYMADDR_FLAGS_LESS_OR_EQUAL, pSymbol, &hMod);
    10141014    if (RT_SUCCESS(rc))
    10151015    {
注意: 瀏覽 TracChangeset 來幫助您使用更動檢視器

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