VirtualBox

Changeset 48694 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Sep 26, 2013 12:19:41 AM (11 years ago)
Author:
vboxsync
Message:

DBGF: Added DBGFR3AsUnlinkModuleByName and extended DBGFR3AsLoadImage with a enmArch parameter for mac os x debugging.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMR3/DBGFAddrSpace.cpp

    r47825 r48694  
    940940 * @param   pszModName      The module name. If NULL, then then the file name
    941941 *                          base is used (no extension or nothing).
     942 * @param   enmArch         The desired architecture, use RTLDRARCH_WHATEVER if
     943 *                          it's not relevant or known.
    942944 * @param   pModAddress     The load address of the module.
    943945 * @param   iModSeg         The segment to load, pass NIL_RTDBGSEGIDX to load
     
    945947 * @param   fFlags          Flags reserved for future extensions, must be 0.
    946948 */
    947 VMMR3DECL(int) DBGFR3AsLoadImage(PUVM pUVM, RTDBGAS hDbgAs, const char *pszFilename, const char *pszModName, PCDBGFADDRESS pModAddress, RTDBGSEGIDX iModSeg, uint32_t fFlags)
     949VMMR3DECL(int) DBGFR3AsLoadImage(PUVM pUVM, RTDBGAS hDbgAs, const char *pszFilename, const char *pszModName, RTLDRARCH enmArch,
     950                                 PCDBGFADDRESS pModAddress, RTDBGSEGIDX iModSeg, uint32_t fFlags)
    948951{
    949952    /*
     
    960963
    961964    RTDBGMOD hDbgMod;
    962     int rc = RTDbgModCreateFromImage(&hDbgMod, pszFilename, pszModName, RTLDRARCH_WHATEVER, pUVM->dbgf.s.hDbgCfg);
     965    int rc = RTDbgModCreateFromImage(&hDbgMod, pszFilename, pszModName, enmArch, pUVM->dbgf.s.hDbgCfg);
    963966    if (RT_SUCCESS(rc))
    964967    {
     
    10611064
    10621065/**
     1066 * Wrapper around RTDbgAsModuleByName and RTDbgAsModuleUnlink.
     1067 *
     1068 * Unlinks all mappings matching the given module name.
     1069 *
     1070 * @returns VBox status code.
     1071 * @param   pUVM            The user mode VM handle.
     1072 * @param   hDbgAs          The address space handle.
     1073 * @param   pszModName      The name of the module to unlink.
     1074 */
     1075VMMR3DECL(int) DBGFR3AsUnlinkModuleByName(PUVM pUVM, RTDBGAS hDbgAs, const char *pszModName)
     1076{
     1077    /*
     1078     * Input validation.
     1079     */
     1080    UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE);
     1081    RTDBGAS hRealAS = DBGFR3AsResolveAndRetain(pUVM, hDbgAs);
     1082    if (hRealAS == NIL_RTDBGAS)
     1083        return VERR_INVALID_HANDLE;
     1084
     1085    /*
     1086     * Do the job.
     1087     */
     1088    RTDBGMOD hMod;
     1089    int rc = RTDbgAsModuleByName(hRealAS, pszModName, 0, &hMod);
     1090    if (RT_SUCCESS(rc))
     1091    {
     1092        for (;;)
     1093        {
     1094            rc = RTDbgAsModuleUnlink(hRealAS, hMod);
     1095            RTDbgModRelease(hMod);
     1096            if (RT_FAILURE(rc))
     1097                break;
     1098            rc = RTDbgAsModuleByName(hRealAS, pszModName, 0, &hMod);
     1099            if (RT_FAILURE_NP(rc))
     1100            {
     1101                if (rc == VERR_NOT_FOUND)
     1102                    rc = VINF_SUCCESS;
     1103                break;
     1104            }
     1105        }
     1106    }
     1107
     1108    RTDbgAsRelease(hRealAS);
     1109    return rc;
     1110}
     1111
     1112
     1113/**
    10631114 * Adds the module name to the symbol name.
    10641115 *
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