Changeset 444 in vbox for trunk/src/VBox
- Timestamp:
- Jan 30, 2007 9:56:19 PM (18 years ago)
- svn:sync-xref-src-repo-rev:
- 18023
- Location:
- trunk/src/VBox/Main
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/MachineDebuggerImpl.cpp
r1 r444 28 28 #include <VBox/csam.h> 29 29 #include <VBox/vm.h> 30 #include <VBox/tm.h> 30 31 #include <VBox/err.h> 31 32 #include <VBox/hwaccm.h> … … 83 84 csamEnabledQueued = ~0; 84 85 mLogEnabledQueued = ~0; 86 mVirtualTimeRateQueued = ~0; 85 87 fFlushMode = false; 86 88 setReady(true); … … 481 483 482 484 /** 485 * Returns the current virtual time rate. 486 * 487 * @returns COM status code. 488 * @param pct Where to store the rate. 489 */ 490 STDMETHODIMP MachineDebugger::COMGETTER(VirtualTimeRate)(ULONG *pct) 491 { 492 if (!pct) 493 return E_POINTER; 494 495 AutoLock lock(this); 496 CHECK_READY(); 497 498 Console::SafeVMPtrQuiet pVM (mParent); 499 if (pVM.isOk()) 500 *pct = TMVirtualGetWarpDrive(pVM); 501 else 502 *pct = 100; 503 return S_OK; 504 } 505 506 /** 507 * Returns the current virtual time rate. 508 * 509 * @returns COM status code. 510 * @param pct Where to store the rate. 511 */ 512 STDMETHODIMP MachineDebugger::COMSETTER(VirtualTimeRate)(ULONG pct) 513 { 514 if (pct < 2 || pct > 20000) 515 return E_INVALIDARG; 516 517 AutoLock lock(this); 518 CHECK_READY(); 519 520 if (!fFlushMode) 521 { 522 // check if the machine is running 523 MachineState_T machineState; 524 mParent->COMGETTER(State)(&machineState); 525 if (machineState != MachineState_Running) 526 { 527 // queue the request 528 mVirtualTimeRateQueued = pct; 529 return S_OK; 530 } 531 } 532 533 Console::SafeVMPtr pVM (mParent); 534 CheckComRCReturnRC (pVM.rc()); 535 536 int vrc = TMVirtualSetWarpDrive(pVM, pct); 537 if (VBOX_FAILURE(vrc)) 538 { 539 /** @todo handle error code. */ 540 } 541 return S_OK; 542 } 543 544 /** 483 545 * Hack for getting the VM handle. 484 546 * This is only temporary (promise) while prototyping the debugger. … … 546 608 mLogEnabledQueued = ~0; 547 609 } 610 if (mVirtualTimeRateQueued != ~0) 611 { 612 COMSETTER(VirtualTimeRate)(mVirtualTimeRateQueued); 613 mVirtualTimeRateQueued = ~0; 614 } 548 615 fFlushMode = false; 549 616 } -
trunk/src/VBox/Main/idl/VirtualBox.xidl
r436 r444 5888 5888 <interface 5889 5889 name="IMachineDebugger" extends="$unknown" 5890 uuid=" 837c19ca-c4a4-479b-81e4-362d441f8f94"5890 uuid="288da658-74fa-4877-ab5c-dafdad19a1cd" 5891 5891 > 5892 5892 <method name="resetStats"> … … 5930 5930 Flag indicating whether the VM is currently making use of CPU hardware 5931 5931 virtualization extensions 5932 </desc> 5933 </attribute> 5934 5935 <attribute name="VirtualTimeRate" type="unsigned long"> 5936 <desc> 5937 The rate at which the virtual time runs expressed as a percentage. 5938 The accepted range is 2% to 20000%. 5932 5939 </desc> 5933 5940 </attribute> -
trunk/src/VBox/Main/include/MachineDebuggerImpl.h
r1 r444 67 67 STDMETHOD(COMSETTER(LogEnabled))(BOOL enable); 68 68 STDMETHOD(COMGETTER(HWVirtExEnabled))(BOOL *enabled); 69 STDMETHOD(COMGETTER(VirtualTimeRate))(ULONG *pct); 70 STDMETHOD(COMSETTER(VirtualTimeRate))(ULONG pct); 69 71 STDMETHOD(COMGETTER(VM))(ULONG64 *vm); 70 72 … … 89 91 int csamEnabledQueued; 90 92 int mLogEnabledQueued; 93 uint32_t mVirtualTimeRateQueued; 91 94 bool fFlushMode; 92 95 };
Note:
See TracChangeset
for help on using the changeset viewer.