diff options
author | Michael Meskes <meskes@debian.org> | 2011-08-24 13:18:05 +0200 |
---|---|---|
committer | Michael Meskes <meskes@debian.org> | 2011-08-24 13:18:05 +0200 |
commit | f8fd93b0b6b13ba94584bb61c1efd1a761f438c9 (patch) | |
tree | 7bf52d89d95d605721fb5515d467036e2dbc7b96 /src/VBox/Main/src-client/MachineDebuggerImpl.cpp | |
parent | cba113ca2826bc4814be2f69a7704c865a37d4ea (diff) | |
download | virtualbox-f8fd93b0b6b13ba94584bb61c1efd1a761f438c9.tar.gz |
Imported Upstream version 4.1.2-dfsgupstream/4.1.2-dfsg
Diffstat (limited to 'src/VBox/Main/src-client/MachineDebuggerImpl.cpp')
-rw-r--r-- | src/VBox/Main/src-client/MachineDebuggerImpl.cpp | 80 |
1 files changed, 37 insertions, 43 deletions
diff --git a/src/VBox/Main/src-client/MachineDebuggerImpl.cpp b/src/VBox/Main/src-client/MachineDebuggerImpl.cpp index 5b5845110..77a38c8e9 100644 --- a/src/VBox/Main/src-client/MachineDebuggerImpl.cpp +++ b/src/VBox/Main/src-client/MachineDebuggerImpl.cpp @@ -1,4 +1,4 @@ -/* $Id: MachineDebuggerImpl.cpp 35638 2011-01-19 19:10:49Z vboxsync $ */ +/* $Id: MachineDebuggerImpl.cpp 38324 2011-08-05 14:02:53Z vboxsync $ */ /** @file * VBox IMachineDebugger COM class implementation. */ @@ -183,33 +183,30 @@ STDMETHODIMP MachineDebugger::COMGETTER(RecompileUser) (BOOL *aEnabled) * @returns COM status * @param aEnable new user mode code recompile flag. */ -STDMETHODIMP MachineDebugger::COMSETTER(RecompileUser) (BOOL aEnable) +STDMETHODIMP MachineDebugger::COMSETTER(RecompileUser)(BOOL aEnable) { LogFlowThisFunc(("enable=%d\n", aEnable)); AutoCaller autoCaller(this); - if (FAILED(autoCaller.rc())) return autoCaller.rc(); - - AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); - - if (queueSettings()) + HRESULT hrc = autoCaller.rc(); + if (SUCCEEDED(hrc)) { - // queue the request - mRecompileUserQueued = aEnable; - return S_OK; + AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); + if (queueSettings()) + mRecompileUserQueued = aEnable; // queue the request + else + { + Console::SafeVMPtr ptrVM(mParent); + hrc = ptrVM.rc(); + if (SUCCEEDED(hrc)) + { + int vrc = EMR3SetExecutionPolicy(ptrVM.raw(), EMEXECPOLICY_RECOMPILE_RING3, RT_BOOL(aEnable)); + if (RT_FAILURE(vrc)) + hrc = setError(VBOX_E_VM_ERROR, tr("EMR3SetExecutionPolicy failed with %Rrc"), vrc); + } + } } - - Console::SafeVMPtr pVM (mParent); - if (FAILED(pVM.rc())) return pVM.rc(); - - EMRAWMODE rawModeFlag = aEnable ? EMRAW_RING3_DISABLE : EMRAW_RING3_ENABLE; - int rcVBox = VMR3ReqCallWait(pVM, VMCPUID_ANY, (PFNRT)EMR3RawSetMode, 2, pVM.raw(), rawModeFlag); - if (RT_SUCCESS(rcVBox)) - return S_OK; - - AssertMsgFailed (("Could not set raw mode flags to %d, rcVBox = %Rrc\n", - rawModeFlag, rcVBox)); - return E_FAIL; + return hrc; } /** @@ -243,33 +240,30 @@ STDMETHODIMP MachineDebugger::COMGETTER(RecompileSupervisor) (BOOL *aEnabled) * @returns COM status code * @param aEnable new recompile supervisor code flag */ -STDMETHODIMP MachineDebugger::COMSETTER(RecompileSupervisor) (BOOL aEnable) +STDMETHODIMP MachineDebugger::COMSETTER(RecompileSupervisor)(BOOL aEnable) { LogFlowThisFunc(("enable=%d\n", aEnable)); AutoCaller autoCaller(this); - if (FAILED(autoCaller.rc())) return autoCaller.rc(); - - AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); - - if (queueSettings()) + HRESULT hrc = autoCaller.rc(); + if (SUCCEEDED(hrc)) { - // queue the request - mRecompileSupervisorQueued = aEnable; - return S_OK; + AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); + if (queueSettings()) + mRecompileSupervisorQueued = aEnable; // queue the request + else + { + Console::SafeVMPtr ptrVM(mParent); + hrc = ptrVM.rc(); + if (SUCCEEDED(hrc)) + { + int vrc = EMR3SetExecutionPolicy(ptrVM.raw(), EMEXECPOLICY_RECOMPILE_RING0, RT_BOOL(aEnable)); + if (RT_FAILURE(vrc)) + hrc = setError(VBOX_E_VM_ERROR, tr("EMR3SetExecutionPolicy failed with %Rrc"), vrc); + } + } } - - Console::SafeVMPtr pVM (mParent); - if (FAILED(pVM.rc())) return pVM.rc(); - - EMRAWMODE rawModeFlag = aEnable ? EMRAW_RING0_DISABLE : EMRAW_RING0_ENABLE; - int rcVBox = VMR3ReqCallWait(pVM, VMCPUID_ANY, (PFNRT)EMR3RawSetMode, 2, pVM.raw(), rawModeFlag); - if (RT_SUCCESS(rcVBox)) - return S_OK; - - AssertMsgFailed (("Could not set raw mode flags to %d, rcVBox = %Rrc\n", - rawModeFlag, rcVBox)); - return E_FAIL; + return hrc; } /** |