Changeset 39712 in vbox
- Timestamp:
- Jan 6, 2012 5:59:16 PM (13 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/idl/VirtualBox.xidl
r39668 r39712 13517 13517 </method> 13518 13518 13519 <attribute name="single step" type="boolean">13520 <desc>Switch for enabling single stepping.</desc>13519 <attribute name="singleStep" type="boolean"> 13520 <desc>Switch for enabling single-stepping.</desc> 13521 13521 </attribute> 13522 13522 -
trunk/src/VBox/Main/include/MachineDebuggerImpl.h
r39668 r39712 52 52 53 53 // IMachineDebugger properties 54 STDMETHOD(COMGETTER(Single step)) (BOOL *aEnabled);55 STDMETHOD(COMSETTER(Single step)) (BOOL aEnable);56 STDMETHOD(COMGETTER(RecompileUser)) (BOOL *aEnabled);57 STDMETHOD(COMSETTER(RecompileUser)) (BOOL aEnable);58 STDMETHOD(COMGETTER(RecompileSupervisor)) (BOOL *aEnabled);59 STDMETHOD(COMSETTER(RecompileSupervisor)) (BOOL aEnable);60 STDMETHOD(COMGETTER(PATMEnabled)) (BOOL *aEnabled);61 STDMETHOD(COMSETTER(PATMEnabled)) (BOOL aEnable);62 STDMETHOD(COMGETTER(CSAMEnabled)) (BOOL *aEnabled);63 STDMETHOD(COMSETTER(CSAMEnabled)) (BOOL aEnable);64 STDMETHOD(COMGETTER(LogEnabled)) (BOOL *aEnabled);65 STDMETHOD(COMSETTER(LogEnabled)) (BOOL aEnable);66 STDMETHOD(COMGETTER(LogDbgFlags)) 67 STDMETHOD(COMGETTER(LogDbgGroups)) 68 STDMETHOD(COMGETTER(LogDbgDestinations)) 69 STDMETHOD(COMGETTER(LogRelFlags)) 70 STDMETHOD(COMGETTER(LogRelGroups)) 71 STDMETHOD(COMGETTER(LogRelDestinations)) 72 STDMETHOD(COMGETTER(HWVirtExEnabled)) (BOOL *aEnabled);73 STDMETHOD(COMGETTER(HWVirtExNestedPagingEnabled)) (BOOL *aEnabled);74 STDMETHOD(COMGETTER(HWVirtExVPIDEnabled)) (BOOL *aEnabled);75 STDMETHOD(COMGETTER(PAEEnabled)) (BOOL *aEnabled);54 STDMETHOD(COMGETTER(SingleStep))(BOOL *a_pfEnabled); 55 STDMETHOD(COMSETTER(SingleStep))(BOOL a_fEnable); 56 STDMETHOD(COMGETTER(RecompileUser))(BOOL *a_pfEnabled); 57 STDMETHOD(COMSETTER(RecompileUser))(BOOL a_fEnable); 58 STDMETHOD(COMGETTER(RecompileSupervisor))(BOOL *a_pfEnabled); 59 STDMETHOD(COMSETTER(RecompileSupervisor))(BOOL a_fEnable); 60 STDMETHOD(COMGETTER(PATMEnabled))(BOOL *a_pfEnabled); 61 STDMETHOD(COMSETTER(PATMEnabled))(BOOL a_fEnable); 62 STDMETHOD(COMGETTER(CSAMEnabled))(BOOL *a_pfEnabled); 63 STDMETHOD(COMSETTER(CSAMEnabled))(BOOL a_fEnable); 64 STDMETHOD(COMGETTER(LogEnabled))(BOOL *a_pfEnabled); 65 STDMETHOD(COMSETTER(LogEnabled))(BOOL a_fEnable); 66 STDMETHOD(COMGETTER(LogDbgFlags))(BSTR *a_pbstrSettings); 67 STDMETHOD(COMGETTER(LogDbgGroups))(BSTR *a_pbstrSettings); 68 STDMETHOD(COMGETTER(LogDbgDestinations))(BSTR *a_pbstrSettings); 69 STDMETHOD(COMGETTER(LogRelFlags))(BSTR *a_pbstrSettings); 70 STDMETHOD(COMGETTER(LogRelGroups))(BSTR *a_pbstrSettings); 71 STDMETHOD(COMGETTER(LogRelDestinations))(BSTR *a_pbstrSettings); 72 STDMETHOD(COMGETTER(HWVirtExEnabled))(BOOL *a_pfEnabled); 73 STDMETHOD(COMGETTER(HWVirtExNestedPagingEnabled))(BOOL *a_pfEnabled); 74 STDMETHOD(COMGETTER(HWVirtExVPIDEnabled))(BOOL *a_pfEnabled); 75 STDMETHOD(COMGETTER(PAEEnabled))(BOOL *a_pfEnabled); 76 76 STDMETHOD(COMGETTER(OSName))(BSTR *a_pbstrName); 77 77 STDMETHOD(COMGETTER(OSVersion))(BSTR *a_pbstrVersion); 78 STDMETHOD(COMGETTER(VirtualTimeRate)) (ULONG *aPct);79 STDMETHOD(COMSETTER(VirtualTimeRate)) (ULONG aPct);80 STDMETHOD(COMGETTER(VM)) (LONG64 *aVm);78 STDMETHOD(COMGETTER(VirtualTimeRate))(ULONG *a_puPct); 79 STDMETHOD(COMSETTER(VirtualTimeRate))(ULONG a_uPct); 80 STDMETHOD(COMGETTER(VM))(LONG64 *a_u64Vm); 81 81 82 82 // IMachineDebugger methods … … 117 117 118 118 Console * const mParent; 119 // flags whether settings have been queued because 120 // they could not be sent to the VM (not up yet, etc.) 121 int mSinglestepQueued; 119 /** @name Flags whether settings have been queued because they could not be sent 120 * to the VM (not up yet, etc.) 121 * @{ */ 122 int mSingleStepQueued; 122 123 int mRecompileUserQueued; 123 124 int mRecompileSupervisorQueued; … … 127 128 uint32_t mVirtualTimeRateQueued; 128 129 bool mFlushMode; 130 /** @} */ 129 131 }; 130 132 -
trunk/src/VBox/Main/src-client/MachineDebuggerImpl.cpp
r39676 r39712 86 86 unconst(mParent) = aParent; 87 87 88 mSingle stepQueued = ~0;88 mSingleStepQueued = ~0; 89 89 mRecompileUserQueued = ~0; 90 90 mRecompileSupervisorQueued = ~0; … … 125 125 * 126 126 * @returns COM status code 127 * @param aEnabled address of result variable 128 */ 129 STDMETHODIMP MachineDebugger::COMGETTER(Singlestep) (BOOL *aEnabled) 130 { 131 CheckComArgOutPointerValid(aEnabled); 132 133 AutoCaller autoCaller(this); 134 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 135 136 /** @todo */ 137 ReturnComNotImplemented(); 127 * @param a_fEnabled Where to store the result. 128 */ 129 STDMETHODIMP MachineDebugger::COMGETTER(SingleStep)(BOOL *a_fEnabled) 130 { 131 CheckComArgOutPointerValid(a_fEnabled); 132 133 AutoCaller autoCaller(this); 134 HRESULT hrc = autoCaller.rc(); 135 if (SUCCEEDED(hrc)) 136 { 137 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 138 Console::SafeVMPtr ptrVM(mParent); 139 hrc = ptrVM.rc(); 140 if (SUCCEEDED(hrc)) 141 { 142 /** @todo */ 143 ReturnComNotImplemented(); 144 } 145 } 146 return hrc; 138 147 } 139 148 … … 142 151 * 143 152 * @returns COM status code 144 * @param aEnable new singlestepping flag 145 */ 146 STDMETHODIMP MachineDebugger::COMSETTER(Singlestep) (BOOL aEnable) 147 { 148 AutoCaller autoCaller(this); 149 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 150 151 /** @todo */ 152 ReturnComNotImplemented(); 153 * @param a_fEnable The new state. 154 */ 155 STDMETHODIMP MachineDebugger::COMSETTER(SingleStep)(BOOL a_fEnable) 156 { 157 AutoCaller autoCaller(this); 158 HRESULT hrc = autoCaller.rc(); 159 if (SUCCEEDED(hrc)) 160 { 161 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 162 Console::SafeVMPtr ptrVM(mParent); 163 hrc = ptrVM.rc(); 164 if (SUCCEEDED(hrc)) 165 { 166 /** @todo */ 167 ReturnComNotImplemented(); 168 } 169 } 170 return hrc; 153 171 } 154 172 … … 157 175 * 158 176 * @returns COM status code 159 * @param a Enabled address of result variable177 * @param a_fEnabled address of result variable 160 178 */ 161 179 STDMETHODIMP MachineDebugger::COMGETTER(RecompileUser) (BOOL *aEnabled) … … 752 770 * 753 771 * @returns COM status code. 754 * @param a PctWhere to store the rate.755 */ 756 STDMETHODIMP MachineDebugger::COMGETTER(VirtualTimeRate) (ULONG *aPct)757 { 758 CheckComArgOutPointerValid(a Pct);759 760 AutoCaller autoCaller(this); 761 if (FAILED(autoCaller.rc())) returnautoCaller.rc();762 763 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);764 765 Console::SafeVMPtrQuiet pVM (mParent); 766 767 if (pVM.isOk())768 *aPct = TMGetWarpDrive (pVM);769 else770 *aPct = 100;771 772 return S_OK;772 * @param a_puPct Where to store the rate. 773 */ 774 STDMETHODIMP MachineDebugger::COMGETTER(VirtualTimeRate)(ULONG *a_puPct) 775 { 776 CheckComArgOutPointerValid(a_puPct); 777 778 AutoCaller autoCaller(this); 779 HRESULT hrc = autoCaller.rc(); 780 if (SUCCEEDED(hrc)) 781 { 782 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 783 784 Console::SafeVMPtr ptrVM(mParent); 785 hrc = ptrVM.rc(); 786 if (SUCCEEDED(hrc)) 787 *a_puPct = TMGetWarpDrive(ptrVM.raw()); 788 } 789 790 return hrc; 773 791 } 774 792 … … 779 797 * @param aPct Where to store the rate. 780 798 */ 781 STDMETHODIMP MachineDebugger::COMSETTER(VirtualTimeRate) (ULONG aPct) 782 { 783 if (aPct < 2 || aPct > 20000) 784 return E_INVALIDARG; 785 786 AutoCaller autoCaller(this); 787 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 788 789 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 790 791 if (queueSettings()) 792 { 793 // queue the request 794 mVirtualTimeRateQueued = aPct; 795 return S_OK; 796 } 797 798 Console::SafeVMPtr pVM(mParent); 799 if (FAILED(pVM.rc())) return pVM.rc(); 800 801 int vrc = TMR3SetWarpDrive (pVM, aPct); 802 if (RT_FAILURE(vrc)) 803 { 804 /** @todo handle error code. */ 805 } 806 807 return S_OK; 799 STDMETHODIMP MachineDebugger::COMSETTER(VirtualTimeRate)(ULONG a_uPct) 800 { 801 if (a_uPct < 2 || a_uPct > 20000) 802 return setError(E_INVALIDARG, tr("%u is out of range [2..20000]"), a_uPct); 803 804 AutoCaller autoCaller(this); 805 HRESULT hrc = autoCaller.rc(); 806 if (SUCCEEDED(hrc)) 807 { 808 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 809 if (queueSettings()) 810 mVirtualTimeRateQueued = a_uPct; 811 else 812 { 813 Console::SafeVMPtr ptrVM(mParent); 814 hrc = ptrVM.rc(); 815 if (SUCCEEDED(hrc)) 816 { 817 int vrc = TMR3SetWarpDrive(ptrVM.raw(), a_uPct); 818 if (RT_FAILURE(vrc)) 819 hrc = setError(VBOX_E_VM_ERROR, tr("TMR3SetWarpDrive(, %u) failed with rc=%Rrc"), a_uPct, vrc); 820 } 821 } 822 } 823 824 return hrc; 808 825 } 809 826 810 827 /** 811 828 * Hack for getting the VM handle. 829 * 812 830 * This is only temporary (promise) while prototyping the debugger. 813 831 * 814 832 * @returns COM status code 815 * @param aVm Where to store the vm handle. 816 * Since there is no uintptr_t in COM, we're using the max integer. 817 * (No, ULONG is not pointer sized!) 818 */ 819 STDMETHODIMP MachineDebugger::COMGETTER(VM) (LONG64 *aVm) 820 { 821 CheckComArgOutPointerValid(aVm); 822 823 AutoCaller autoCaller(this); 824 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 825 826 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 827 828 Console::SafeVMPtr pVM(mParent); 829 if (FAILED(pVM.rc())) return pVM.rc(); 830 831 *aVm = (intptr_t)pVM.raw(); 832 833 /* 834 * Note: pVM protection provided by SafeVMPtr is no more effective 835 * after we return from this method. 836 */ 837 838 return S_OK; 833 * @param a_u64Vm Where to store the vm handle. Since there is no 834 * uintptr_t in COM, we're using the max integer. 835 * (No, ULONG is not pointer sized!) 836 */ 837 STDMETHODIMP MachineDebugger::COMGETTER(VM)(LONG64 *a_u64Vm) 838 { 839 CheckComArgOutPointerValid(a_u64Vm); 840 841 AutoCaller autoCaller(this); 842 HRESULT hrc = autoCaller.rc(); 843 if (SUCCEEDED(hrc)) 844 { 845 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 846 847 Console::SafeVMPtr ptrVM(mParent); 848 hrc = ptrVM.rc(); 849 if (SUCCEEDED(hrc)) 850 *a_u64Vm = (intptr_t)ptrVM.raw(); 851 852 /* 853 * Note! pVM protection provided by SafeVMPtr is no long effective 854 * after we return from this method. 855 */ 856 } 857 858 return hrc; 839 859 } 840 860 … … 1448 1468 { 1449 1469 mFlushMode = true; 1450 if (mSingle stepQueued != ~0)1451 { 1452 COMSETTER(Single step) (mSinglestepQueued);1453 mSingle stepQueued = ~0;1470 if (mSingleStepQueued != ~0) 1471 { 1472 COMSETTER(SingleStep)(mSingleStepQueued); 1473 mSingleStepQueued = ~0; 1454 1474 } 1455 1475 if (mRecompileUserQueued != ~0) 1456 1476 { 1457 COMSETTER(RecompileUser) 1477 COMSETTER(RecompileUser)(mRecompileUserQueued); 1458 1478 mRecompileUserQueued = ~0; 1459 1479 } 1460 1480 if (mRecompileSupervisorQueued != ~0) 1461 1481 { 1462 COMSETTER(RecompileSupervisor) 1482 COMSETTER(RecompileSupervisor)(mRecompileSupervisorQueued); 1463 1483 mRecompileSupervisorQueued = ~0; 1464 1484 } 1465 1485 if (mPatmEnabledQueued != ~0) 1466 1486 { 1467 COMSETTER(PATMEnabled) 1487 COMSETTER(PATMEnabled)(mPatmEnabledQueued); 1468 1488 mPatmEnabledQueued = ~0; 1469 1489 } 1470 1490 if (mCsamEnabledQueued != ~0) 1471 1491 { 1472 COMSETTER(CSAMEnabled) 1492 COMSETTER(CSAMEnabled)(mCsamEnabledQueued); 1473 1493 mCsamEnabledQueued = ~0; 1474 1494 } 1475 1495 if (mLogEnabledQueued != ~0) 1476 1496 { 1477 COMSETTER(LogEnabled) 1497 COMSETTER(LogEnabled)(mLogEnabledQueued); 1478 1498 mLogEnabledQueued = ~0; 1479 1499 } 1480 1500 if (mVirtualTimeRateQueued != ~(uint32_t)0) 1481 1501 { 1482 COMSETTER(VirtualTimeRate) 1502 COMSETTER(VirtualTimeRate)(mVirtualTimeRateQueued); 1483 1503 mVirtualTimeRateQueued = ~0; 1484 1504 } … … 1495 1515 // check if the machine is running 1496 1516 MachineState_T machineState; 1497 mParent->COMGETTER(State) 1517 mParent->COMGETTER(State)(&machineState); 1498 1518 switch (machineState) 1499 1519 {
Note:
See TracChangeset
for help on using the changeset viewer.