VirtualBox

Changeset 22114 in vbox for trunk/src/VBox/Runtime/common


Ignore:
Timestamp:
Aug 9, 2009 11:07:56 PM (15 years ago)
Author:
vboxsync
Message:

RTDbgMod: Added module tagging so the diggers can tell which modules are theirs when refreshing.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/common/dbg/dbgmod.cpp

    r21337 r22114  
    552552
    553553/**
     554 * Gets the module tag value if any.
     555 *
     556 * @returns The tag. 0 if hDbgMod is invalid.
     557 *
     558 * @param   hDbgMod         The module handle.
     559 */
     560RTDECL(uint64_t) RTDbgModGetTag(RTDBGMOD hDbgMod)
     561{
     562    PRTDBGMODINT pDbgMod = hDbgMod;
     563    RTDBGMOD_VALID_RETURN_RC(pDbgMod, 0);
     564    return pDbgMod->uTag;
     565}
     566RT_EXPORT_SYMBOL(RTDbgModGetTag);
     567
     568
     569/**
     570 * Tags or untags the module.
     571 *
     572 * @returns IPRT status code.
     573 * @retval  VERR_INVALID_HANDLE if hDbgMod is invalid.
     574 *
     575 * @param   hDbgMod         The module handle.
     576 * @param   uTag            The tag value.  The convention is that 0 is no tag
     577 *                          and any other value means it's tagged.  It's adviced
     578 *                          to use some kind of unique number like an address
     579 *                          (global or string cache for instance) to avoid
     580 *                          collisions with other users
     581 */
     582RTDECL(int) RTDbgModSetTag(RTDBGMOD hDbgMod, uint64_t uTag)
     583{
     584    PRTDBGMODINT pDbgMod = hDbgMod;
     585    RTDBGMOD_VALID_RETURN_RC(pDbgMod, VERR_INVALID_HANDLE);
     586    RTDBGMOD_LOCK(pDbgMod);
     587
     588    pDbgMod->uTag = uTag;
     589
     590    RTDBGMOD_UNLOCK(pDbgMod);
     591    return VINF_SUCCESS;
     592}
     593RT_EXPORT_SYMBOL(RTDbgModSetTag);
     594
     595
     596/**
    554597 * Adds a segment to the module. Optional feature.
    555598 *
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