VirtualBox

Changeset 86147 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Sep 17, 2020 11:21:16 AM (4 years ago)
Author:
vboxsync
Message:

VMM/DBGFReg: A lazy implementation of DBGFR3RegNmSetBatch() which needs to be improved

Location:
trunk/src/VBox/VMM/VMMR3
Files:
2 edited

Legend:

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

    r84054 r86147  
    22422242
    22432243/**
     2244 * Set a given set of registers.
     2245 *
     2246 * @returns VBox status code.
     2247 * @retval  VINF_SUCCESS
     2248 * @retval  VERR_INVALID_VM_HANDLE
     2249 * @retval  VERR_INVALID_CPU_ID
     2250 * @retval  VERR_DBGF_REGISTER_NOT_FOUND
     2251 * @retval  VERR_DBGF_UNSUPPORTED_CAST
     2252 * @retval  VINF_DBGF_TRUNCATED_REGISTER
     2253 * @retval  VINF_DBGF_ZERO_EXTENDED_REGISTER
     2254 *
     2255 * @param   pUVM                The user mode VM handle.
     2256 * @param   idDefCpu            The virtual CPU ID for the default CPU register
     2257 *                              set.  Can be OR'ed with DBGFREG_HYPER_VMCPUID.
     2258 * @param   pszReg              The register to query.
     2259 * @param   pValue              The value to set
     2260 * @param   enmType             How to interpret the value in @a pValue.
     2261 *
     2262 * @todo This is a _very_ lazy implementation by a lazy developer, some semantics
     2263  *      need to be figured out before the real implementation especially how and
     2264  *      when errors and informational status codes like VINF_DBGF_TRUNCATED_REGISTER
     2265  *      should be returned (think of an error right in the middle of the batch, should we
     2266  *      save the state and roll back?).
     2267 */
     2268VMMR3DECL(int) DBGFR3RegNmSetBatch(PUVM pUVM, VMCPUID idDefCpu, PCDBGFREGENTRYNM paRegs, size_t cRegs)
     2269{
     2270    /*
     2271     * Validate input.
     2272     */
     2273    UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE);
     2274    VM_ASSERT_VALID_EXT_RETURN(pUVM->pVM, VERR_INVALID_VM_HANDLE);
     2275    AssertReturn((idDefCpu & ~DBGFREG_HYPER_VMCPUID) < pUVM->cCpus || idDefCpu == VMCPUID_ANY, VERR_INVALID_CPU_ID);
     2276    AssertPtrReturn(paRegs, VERR_INVALID_PARAMETER);
     2277    AssertReturn(cRegs > 0, VERR_INVALID_PARAMETER);
     2278
     2279    for (uint32_t i = 0; i < cRegs; i++)
     2280    {
     2281        int rc = DBGFR3RegNmSet(pUVM, idDefCpu, paRegs[i].pszName, &paRegs[i].Val, paRegs[i].enmType);
     2282        if (RT_FAILURE(rc))
     2283            return rc;
     2284    }
     2285
     2286    return VINF_SUCCESS;
     2287}
     2288
     2289
     2290/**
    22442291 * Internal worker for DBGFR3RegFormatValue, cbBuf is sufficent.
    22452292 *
  • trunk/src/VBox/VMM/VMMR3/VMMR3.def

    r86104 r86147  
    122122    DBGFR3RegNmQueryAll
    123123    DBGFR3RegNmQueryAllCount
     124    DBGFR3RegNmSetBatch
    124125    DBGFR3OSDeregister
    125126    DBGFR3OSRegister
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