VirtualBox

Changeset 90311 in vbox for trunk/src


Ignore:
Timestamp:
Jul 23, 2021 3:07:12 PM (4 years ago)
Author:
vboxsync
Message:

VMM/DBGF: Stop all vCPUs when a breakpoint event happens

File:
1 edited

Legend:

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

    r87594 r90311  
    117117static DBGFSTEPINSTRTYPE dbgfStepGetCurInstrType(PVM pVM, PVMCPU pVCpu);
    118118static bool dbgfStepAreWeThereYet(PVM pVM, PVMCPU pVCpu);
     119static int dbgfR3EventHaltAllVCpus(PVM pVM, PVMCPU pVCpuExclude);
    119120
    120121
     
    774775
    775776    /*
     777     * Halt all other vCPUs as well to give the user the ability to inspect other
     778     * vCPU states as well.
     779     */
     780    rc = dbgfR3EventHaltAllVCpus(pVM, pVCpu);
     781    if (RT_FAILURE(rc))
     782        return rc;
     783
     784    /*
    776785     * Send the event and process the reply communication.
    777786     */
     
    858867    VMR3NotifyCpuFFU(pUVCpu, 0 /*fFlags*/);
    859868    return VINF_SUCCESS;
     869}
     870
     871
     872/**
     873 * @callback_method_impl{FNVMMEMTRENDEZVOUS}
     874 */
     875static DECLCALLBACK(VBOXSTRICTRC) dbgfR3EventHaltEmtWorker(PVM pVM, PVMCPU pVCpu, void *pvUser)
     876{
     877    RT_NOREF(pvUser);
     878
     879    VMCPU_ASSERT_EMT(pVCpu);
     880    VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
     881
     882    PUVMCPU pUVCpu = pVCpu->pUVCpu;
     883    if (   pVCpu != (PVMCPU)pvUser
     884        && !dbgfR3CpuIsHalted(pUVCpu))
     885        dbgfR3CpuSetCmdAndNotify(pUVCpu, DBGFCMD_HALT);
     886
     887    return VINF_SUCCESS;
     888}
     889
     890
     891/**
     892 * Halts all vCPUs of the given VM except for the given one.
     893 *
     894 * @returns VBox status code.
     895 * @param   pVM         The cross context VM structure.
     896 * @param   pVCpu       The vCPU cross context structure of the vCPU to exclude.
     897 */
     898static int dbgfR3EventHaltAllVCpus(PVM pVM, PVMCPU pVCpuExclude)
     899{
     900    return VMMR3EmtRendezvous(pVM, VMMEMTRENDEZVOUS_FLAGS_TYPE_ALL_AT_ONCE, dbgfR3EventHaltEmtWorker, pVCpuExclude);
    860901}
    861902
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