Index: trunk/src/VBox/Main/MachineDebuggerImpl.cpp
===================================================================
--- trunk/src/VBox/Main/MachineDebuggerImpl.cpp	(revision 14626)
+++ trunk/src/VBox/Main/MachineDebuggerImpl.cpp	(revision 14627)
@@ -1,2 +1,4 @@
+/* $Id$ */
+
 /** @file
  *
@@ -5,5 +7,5 @@
 
 /*
- * Copyright (C) 2006-2007 Sun Microsystems, Inc.
+ * Copyright (C) 2006-2008 Sun Microsystems, Inc.
  *
  * This file is part of VirtualBox Open Source Edition (OSE), as
@@ -32,21 +34,20 @@
 #include <VBox/hwaccm.h>
 
-//
 // defines
-//
-
-
-//
+/////////////////////////////////////////////////////////////////////////////
+
+
 // globals
-//
-
-
-//
+/////////////////////////////////////////////////////////////////////////////
+
+
 // constructor / destructor
-//
+/////////////////////////////////////////////////////////////////////////////
+
+DEFINE_EMPTY_CTOR_DTOR (MachineDebugger)
 
 HRESULT MachineDebugger::FinalConstruct()
 {
-    mParent = NULL;
+    unconst (mParent) = NULL;
     return S_OK;
 }
@@ -54,11 +55,9 @@
 void MachineDebugger::FinalRelease()
 {
-    if (isReady())
-        uninit();
-}
-
-//
-// public methods
-//
+    uninit();
+}
+
+// public initializer/uninitializer for internal purposes only
+/////////////////////////////////////////////////////////////////////////////
 
 /**
@@ -66,25 +65,30 @@
  *
  * @returns COM result indicator
- * @param parent handle of our parent object
- */
-HRESULT MachineDebugger::init(Console *parent)
-{
-    LogFlow(("MachineDebugger::init(): isReady=%d\n", isReady()));
-
-    ComAssertRet (parent, E_INVALIDARG);
-
-    AutoWriteLock alock (this);
-    ComAssertRet (!isReady(), E_FAIL);
-
-    mParent = parent;
-    singlestepQueued = ~0;
-    recompileUserQueued = ~0;
-    recompileSupervisorQueued = ~0;
-    patmEnabledQueued = ~0;
-    csamEnabledQueued = ~0;
+ * @param aParent handle of our parent object
+ */
+HRESULT MachineDebugger::init (Console *aParent)
+{
+    LogFlowThisFunc (("aParent=%p\n", aParent));
+
+    ComAssertRet (aParent, E_INVALIDARG);
+
+    /* Enclose the state transition NotReady->InInit->Ready */
+    AutoInitSpan autoInitSpan (this);
+    AssertReturn (autoInitSpan.isOk(), E_FAIL);
+
+    unconst (mParent) = aParent;
+
+    mSinglestepQueued = ~0;
+    mRecompileUserQueued = ~0;
+    mRecompileSupervisorQueued = ~0;
+    mPatmEnabledQueued = ~0;
+    mCsamEnabledQueued = ~0;
     mLogEnabledQueued = ~0;
     mVirtualTimeRateQueued = ~0;
-    fFlushMode = false;
-    setReady(true);
+    mFlushMode = false;
+
+    /* Confirm a successful initialization */
+    autoInitSpan.setSucceeded();
+
     return S_OK;
 }
@@ -96,11 +100,17 @@
 void MachineDebugger::uninit()
 {
-    LogFlow(("MachineDebugger::uninit(): isReady=%d\n", isReady()));
-
-    AutoWriteLock alock (this);
-    AssertReturn (isReady(), (void) 0);
-
-    setReady (false);
-}
+    LogFlowThisFunc (("\n"));
+
+    /* Enclose the state transition Ready->InUninit->NotReady */
+    AutoUninitSpan autoUninitSpan (this);
+    if (autoUninitSpan.uninitDone())
+        return;
+
+    unconst (mParent).setNull();
+    mFlushMode = false;
+}
+
+// IMachineDebugger properties
+/////////////////////////////////////////////////////////////////////////////
 
 /**
@@ -108,12 +118,14 @@
  *
  * @returns COM status code
- * @param   enabled address of result variable
- */
-STDMETHODIMP MachineDebugger::COMGETTER(Singlestep)(BOOL *enabled)
-{
-    if (!enabled)
-        return E_POINTER;
-    AutoWriteLock alock (this);
-    CHECK_READY();
+ * @param   aEnabled address of result variable
+ */
+STDMETHODIMP MachineDebugger::COMGETTER(Singlestep) (BOOL *aEnabled)
+{
+    if (!aEnabled)
+        return E_POINTER;
+
+    AutoCaller autoCaller (this);
+    CheckComRCReturnRC (autoCaller.rc());
+
     /** @todo */
     return E_NOTIMPL;
@@ -124,10 +136,11 @@
  *
  * @returns COM status code
- * @param enable new singlestepping flag
- */
-STDMETHODIMP MachineDebugger::COMSETTER(Singlestep)(BOOL enable)
-{
-    AutoWriteLock alock (this);
-    CHECK_READY();
+ * @param aEnable new singlestepping flag
+ */
+STDMETHODIMP MachineDebugger::COMSETTER(Singlestep) (BOOL aEnable)
+{
+    AutoCaller autoCaller (this);
+    CheckComRCReturnRC (autoCaller.rc());
+
     /** @todo */
     return E_NOTIMPL;
@@ -135,4 +148,551 @@
 
 /**
+ * Returns the current recompile user mode code flag.
+ *
+ * @returns COM status code
+ * @param   aEnabled address of result variable
+ */
+STDMETHODIMP MachineDebugger::COMGETTER(RecompileUser) (BOOL *aEnabled)
+{
+    if (!aEnabled)
+        return E_POINTER;
+
+    AutoCaller autoCaller (this);
+    CheckComRCReturnRC (autoCaller.rc());
+
+    AutoReadLock alock (this);
+
+    Console::SafeVMPtrQuiet pVM (mParent);
+
+    if (pVM.isOk())
+        *aEnabled = !EMIsRawRing3Enabled (pVM.raw());
+    else
+        *aEnabled = false;
+
+    return S_OK;
+}
+
+/**
+ * Sets the recompile user mode code flag.
+ *
+ * @returns COM status
+ * @param   aEnable new user mode code recompile flag.
+ */
+STDMETHODIMP MachineDebugger::COMSETTER(RecompileUser) (BOOL aEnable)
+{
+    LogFlowThisFunc (("enable=%d\n", aEnable));
+
+    AutoCaller autoCaller (this);
+    CheckComRCReturnRC (autoCaller.rc());
+
+    AutoWriteLock alock (this);
+
+    if (queueSettings())
+    {
+        // queue the request
+        mRecompileUserQueued = aEnable;
+        return S_OK;
+    }
+
+    Console::SafeVMPtr pVM (mParent);
+    CheckComRCReturnRC (pVM.rc());
+
+    PVMREQ pReq;
+    EMRAWMODE rawModeFlag = aEnable ? EMRAW_RING3_DISABLE : EMRAW_RING3_ENABLE;
+    int rcVBox = VMR3ReqCall (pVM, VMREQDEST_ANY, &pReq, RT_INDEFINITE_WAIT,
+                              (PFNRT)EMR3RawSetMode, 2, pVM.raw(), rawModeFlag);
+    if (RT_SUCCESS (rcVBox))
+    {
+        rcVBox = pReq->iStatus;
+        VMR3ReqFree (pReq);
+    }
+
+    if (RT_SUCCESS (rcVBox))
+        return S_OK;
+
+    AssertMsgFailed (("Could not set raw mode flags to %d, rcVBox = %Rrc\n",
+                      rawModeFlag, rcVBox));
+    return E_FAIL;
+}
+
+/**
+ * Returns the current recompile supervisor code flag.
+ *
+ * @returns COM status code
+ * @param   aEnabled address of result variable
+ */
+STDMETHODIMP MachineDebugger::COMGETTER(RecompileSupervisor) (BOOL *aEnabled)
+{
+    if (!aEnabled)
+        return E_POINTER;
+
+    AutoCaller autoCaller (this);
+    CheckComRCReturnRC (autoCaller.rc());
+
+    AutoReadLock alock (this);
+
+    Console::SafeVMPtrQuiet pVM (mParent);
+
+    if (pVM.isOk())
+        *aEnabled = !EMIsRawRing0Enabled (pVM.raw());
+    else
+        *aEnabled = false;
+
+    return S_OK;
+}
+
+/**
+ * Sets the new recompile supervisor code flag.
+ *
+ * @returns COM status code
+ * @param   aEnable new recompile supervisor code flag
+ */
+STDMETHODIMP MachineDebugger::COMSETTER(RecompileSupervisor) (BOOL aEnable)
+{
+    LogFlowThisFunc (("enable=%d\n", aEnable));
+
+    AutoCaller autoCaller (this);
+    CheckComRCReturnRC (autoCaller.rc());
+
+    AutoWriteLock alock (this);
+
+    if (queueSettings())
+    {
+        // queue the request
+        mRecompileSupervisorQueued = aEnable;
+        return S_OK;
+    }
+
+    Console::SafeVMPtr pVM (mParent);
+    CheckComRCReturnRC (pVM.rc());
+
+    PVMREQ pReq;
+    EMRAWMODE rawModeFlag = aEnable ? EMRAW_RING0_DISABLE : EMRAW_RING0_ENABLE;
+    int rcVBox = VMR3ReqCall (pVM, VMREQDEST_ANY, &pReq, RT_INDEFINITE_WAIT,
+                              (PFNRT)EMR3RawSetMode, 2, pVM.raw(), rawModeFlag);
+    if (RT_SUCCESS (rcVBox))
+    {
+        rcVBox = pReq->iStatus;
+        VMR3ReqFree (pReq);
+    }
+
+    if (RT_SUCCESS (rcVBox))
+        return S_OK;
+
+    AssertMsgFailed (("Could not set raw mode flags to %d, rcVBox = %Rrc\n",
+                      rawModeFlag, rcVBox));
+    return E_FAIL;
+}
+
+/**
+ * Returns the current patch manager enabled flag.
+ *
+ * @returns COM status code
+ * @param   aEnabled address of result variable
+ */
+STDMETHODIMP MachineDebugger::COMGETTER(PATMEnabled) (BOOL *aEnabled)
+{
+    if (!aEnabled)
+        return E_POINTER;
+
+    AutoCaller autoCaller (this);
+    CheckComRCReturnRC (autoCaller.rc());
+
+    AutoReadLock alock (this);
+
+    Console::SafeVMPtrQuiet pVM (mParent);
+
+    if (pVM.isOk())
+        *aEnabled = PATMIsEnabled (pVM.raw());
+    else
+        *aEnabled = false;
+
+    return S_OK;
+}
+
+/**
+ * Set the new patch manager enabled flag.
+ *
+ * @returns COM status code
+ * @param   aEnable new patch manager enabled flag
+ */
+STDMETHODIMP MachineDebugger::COMSETTER(PATMEnabled) (BOOL aEnable)
+{
+    LogFlowThisFunc (("enable=%d\n", aEnable));
+
+    AutoCaller autoCaller (this);
+    CheckComRCReturnRC (autoCaller.rc());
+
+    AutoWriteLock alock (this);
+
+    if (queueSettings())
+    {
+        // queue the request
+        mPatmEnabledQueued = aEnable;
+        return S_OK;
+    }
+
+    Console::SafeVMPtr pVM (mParent);
+    CheckComRCReturnRC (pVM.rc());
+
+    PATMR3AllowPatching (pVM, aEnable);
+
+    return S_OK;
+}
+
+/**
+ * Set the new patch manager enabled flag.
+ *
+ * @returns COM status code
+ * @param   new patch manager enabled flag
+ */
+STDMETHODIMP MachineDebugger::InjectNMI()
+{
+    LogFlowThisFunc ((""));
+
+    AutoCaller autoCaller (this);
+    CheckComRCReturnRC (autoCaller.rc());
+
+    AutoWriteLock alock (this);
+
+    Console::SafeVMPtr pVM (mParent);
+    CheckComRCReturnRC (pVM.rc());
+
+    HWACCMR3InjectNMI(pVM);
+
+    return S_OK;
+}
+
+/**
+ * Returns the current code scanner enabled flag.
+ *
+ * @returns COM status code
+ * @param   aEnabled address of result variable
+ */
+STDMETHODIMP MachineDebugger::COMGETTER(CSAMEnabled) (BOOL *aEnabled)
+{
+    if (!aEnabled)
+        return E_POINTER;
+
+    AutoCaller autoCaller (this);
+    CheckComRCReturnRC (autoCaller.rc());
+
+    AutoReadLock alock (this);
+
+    Console::SafeVMPtrQuiet pVM (mParent);
+
+    if (pVM.isOk())
+        *aEnabled = CSAMIsEnabled (pVM.raw());
+    else
+        *aEnabled = false;
+
+    return S_OK;
+}
+
+/**
+ * Sets the new code scanner enabled flag.
+ *
+ * @returns COM status code
+ * @param   aEnable new code scanner enabled flag
+ */
+STDMETHODIMP MachineDebugger::COMSETTER(CSAMEnabled) (BOOL aEnable)
+{
+    LogFlowThisFunc (("enable=%d\n", aEnable));
+
+    AutoCaller autoCaller (this);
+    CheckComRCReturnRC (autoCaller.rc());
+
+    AutoWriteLock alock (this);
+
+    if (queueSettings())
+    {
+        // queue the request
+        mCsamEnabledQueued = aEnable;
+        return S_OK;
+    }
+
+    Console::SafeVMPtr pVM (mParent);
+    CheckComRCReturnRC (pVM.rc());
+
+    int vrc;
+    if (aEnable)
+        vrc = CSAMEnableScanning (pVM);
+    else
+        vrc = CSAMDisableScanning (pVM);
+
+    if (RT_FAILURE (vrc))
+    {
+        /** @todo handle error case */
+    }
+
+    return S_OK;
+}
+
+/**
+ * Returns the log enabled / disabled status.
+ *
+ * @returns COM status code
+ * @param   aEnabled     address of result variable
+ */
+STDMETHODIMP MachineDebugger::COMGETTER(LogEnabled) (BOOL *aEnabled)
+{
+    if (!aEnabled)
+        return E_POINTER;
+
+    AutoCaller autoCaller (this);
+    CheckComRCReturnRC (autoCaller.rc());
+
+#ifdef LOG_ENABLED
+    AutoReadLock alock (this);
+
+    const PRTLOGGER pLogInstance = RTLogDefaultInstance();
+    *aEnabled = pLogInstance && !(pLogInstance->fFlags & RTLOGFLAGS_DISABLED);
+#else
+    *aEnabled = false;
+#endif
+
+    return S_OK;
+}
+
+/**
+ * Enables or disables logging.
+ *
+ * @returns COM status code
+ * @param   aEnabled    The new code log state.
+ */
+STDMETHODIMP MachineDebugger::COMSETTER(LogEnabled) (BOOL aEnabled)
+{
+    LogFlowThisFunc (("aEnabled=%d\n", aEnabled));
+
+    AutoCaller autoCaller (this);
+    CheckComRCReturnRC (autoCaller.rc());
+
+    AutoWriteLock alock (this);
+
+    if (queueSettings())
+    {
+        // queue the request
+        mLogEnabledQueued = aEnabled;
+        return S_OK;
+    }
+
+    Console::SafeVMPtr pVM (mParent);
+    CheckComRCReturnRC (pVM.rc());
+
+#ifdef LOG_ENABLED
+    int vrc = DBGFR3LogModifyFlags (pVM, aEnabled ? "enabled" : "disabled");
+    if (RT_FAILURE (vrc))
+    {
+        /** @todo handle error code. */
+    }
+#endif
+
+    return S_OK;
+}
+
+/**
+ * Returns the current hardware virtualization flag.
+ *
+ * @returns COM status code
+ * @param   aEnabled address of result variable
+ */
+STDMETHODIMP MachineDebugger::COMGETTER(HWVirtExEnabled) (BOOL *aEnabled)
+{
+    if (!aEnabled)
+        return E_POINTER;
+
+    AutoCaller autoCaller (this);
+    CheckComRCReturnRC (autoCaller.rc());
+
+    AutoReadLock alock (this);
+
+    Console::SafeVMPtrQuiet pVM (mParent);
+
+    if (pVM.isOk())
+        *aEnabled = HWACCMIsEnabled (pVM.raw());
+    else
+        *aEnabled = false;
+
+    return S_OK;
+}
+
+/**
+ * Returns the current nested paging flag.
+ *
+ * @returns COM status code
+ * @param   aEnabled address of result variable
+ */
+STDMETHODIMP MachineDebugger::COMGETTER(HWVirtExNestedPagingEnabled) (BOOL *aEnabled)
+{
+    if (!aEnabled)
+        return E_POINTER;
+
+    AutoCaller autoCaller (this);
+    CheckComRCReturnRC (autoCaller.rc());
+
+    AutoReadLock alock (this);
+
+    Console::SafeVMPtrQuiet pVM (mParent);
+
+    if (pVM.isOk())
+        *aEnabled = HWACCMR3IsNestedPagingActive (pVM.raw());
+    else
+        *aEnabled = false;
+
+    return S_OK;
+}
+
+/**
+ * Returns the current VPID flag.
+ *
+ * @returns COM status code
+ * @param   aEnabled address of result variable
+ */
+STDMETHODIMP MachineDebugger::COMGETTER(HWVirtExVPIDEnabled) (BOOL *aEnabled)
+{
+    if (!aEnabled)
+        return E_POINTER;
+
+    AutoCaller autoCaller (this);
+    CheckComRCReturnRC (autoCaller.rc());
+
+    AutoReadLock alock (this);
+
+    Console::SafeVMPtrQuiet pVM (mParent);
+
+    if (pVM.isOk())
+        *aEnabled = HWACCMR3IsVPIDActive (pVM.raw());
+    else
+        *aEnabled = false;
+
+    return S_OK;
+}
+
+/**
+ * Returns the current PAE flag.
+ *
+ * @returns COM status code
+ * @param   aEnabled address of result variable
+ */
+STDMETHODIMP MachineDebugger::COMGETTER(PAEEnabled) (BOOL *aEnabled)
+{
+    if (!aEnabled)
+        return E_POINTER;
+
+    AutoCaller autoCaller (this);
+    CheckComRCReturnRC (autoCaller.rc());
+
+    AutoReadLock alock (this);
+
+    Console::SafeVMPtrQuiet pVM (mParent);
+
+    if (pVM.isOk())
+    {
+        uint64_t cr4 = CPUMGetGuestCR4 (pVM.raw());
+        *aEnabled = !!(cr4 & X86_CR4_PAE);
+    }
+    else
+        *aEnabled = false;
+
+    return S_OK;
+}
+
+/**
+ * Returns the current virtual time rate.
+ *
+ * @returns COM status code.
+ * @param   aPct     Where to store the rate.
+ */
+STDMETHODIMP MachineDebugger::COMGETTER(VirtualTimeRate) (ULONG *aPct)
+{
+    if (!aPct)
+        return E_POINTER;
+
+    AutoCaller autoCaller (this);
+    CheckComRCReturnRC (autoCaller.rc());
+
+    AutoReadLock alock (this);
+
+    Console::SafeVMPtrQuiet pVM (mParent);
+
+    if (pVM.isOk())
+        *aPct = TMVirtualGetWarpDrive (pVM);
+    else
+        *aPct = 100;
+
+    return S_OK;
+}
+
+/**
+ * Returns the current virtual time rate.
+ *
+ * @returns COM status code.
+ * @param   aPct     Where to store the rate.
+ */
+STDMETHODIMP MachineDebugger::COMSETTER(VirtualTimeRate) (ULONG aPct)
+{
+    if (aPct < 2 || aPct > 20000)
+        return E_INVALIDARG;
+
+    AutoCaller autoCaller (this);
+    CheckComRCReturnRC (autoCaller.rc());
+
+    AutoWriteLock alock (this);
+
+    if (queueSettings())
+    {
+        // queue the request
+        mVirtualTimeRateQueued = aPct;
+        return S_OK;
+    }
+
+    Console::SafeVMPtr pVM (mParent);
+    CheckComRCReturnRC (pVM.rc());
+
+    int vrc = TMVirtualSetWarpDrive (pVM, aPct);
+    if (RT_FAILURE (vrc))
+    {
+        /** @todo handle error code. */
+    }
+
+    return S_OK;
+}
+
+/**
+ * Hack for getting the VM handle.
+ * This is only temporary (promise) while prototyping the debugger.
+ *
+ * @returns COM status code
+ * @param   aVm      Where to store the vm handle.
+ *                  Since there is no uintptr_t in COM, we're using the max integer.
+ *                  (No, ULONG is not pointer sized!)
+ */
+STDMETHODIMP MachineDebugger::COMGETTER(VM) (ULONG64 *aVm)
+{
+    if (!aVm)
+        return E_POINTER;
+
+    AutoCaller autoCaller (this);
+    CheckComRCReturnRC (autoCaller.rc());
+
+    AutoReadLock alock (this);
+
+    Console::SafeVMPtr pVM (mParent);
+    CheckComRCReturnRC (pVM.rc());
+
+    *aVm = (uintptr_t)pVM.raw();
+
+    /*
+     *  Note: pVM protection provided by SafeVMPtr is no more effective
+     *  after we return from this method.
+     */
+
+    return S_OK;
+}
+
+// IMachineDebugger methods
+/////////////////////////////////////////////////////////////////////////////
+
+/**
  * Resets VM statistics.
  *
@@ -140,9 +700,11 @@
  * @param   aPattern            The selection pattern. A bit similar to filename globbing.
  */
-STDMETHODIMP MachineDebugger::ResetStats(INPTR BSTR aPattern)
-{
-    Console::SafeVMPtrQuiet pVM (mParent);
-    if (pVM.isOk())
-        STAMR3Reset(pVM, Utf8Str(aPattern).raw());
+STDMETHODIMP MachineDebugger::ResetStats (INPTR BSTR aPattern)
+{
+    Console::SafeVMPtrQuiet pVM (mParent);
+
+    if (pVM.isOk())
+        STAMR3Reset (pVM, Utf8Str (aPattern).raw());
+
     return S_OK;
 }
@@ -154,9 +716,11 @@
  * @param   aPattern            The selection pattern. A bit similar to filename globbing.
  */
-STDMETHODIMP MachineDebugger::DumpStats(INPTR BSTR aPattern)
-{
-    Console::SafeVMPtrQuiet pVM (mParent);
-    if (pVM.isOk())
-        STAMR3Dump(pVM, Utf8Str(aPattern).raw());
+STDMETHODIMP MachineDebugger::DumpStats (INPTR BSTR aPattern)
+{
+    Console::SafeVMPtrQuiet pVM (mParent);
+
+    if (pVM.isOk())
+        STAMR3Dump (pVM, Utf8Str (aPattern).raw());
+
     return S_OK;
 }
@@ -170,14 +734,15 @@
  * @param   aStats              The XML document containing the statistics.
  */
-STDMETHODIMP MachineDebugger::GetStats(INPTR BSTR aPattern, BOOL aWithDescriptions, BSTR *aStats)
-{
-    Console::SafeVMPtrQuiet pVM (mParent);
+STDMETHODIMP MachineDebugger::GetStats (INPTR BSTR aPattern, BOOL aWithDescriptions, BSTR *aStats)
+{
+    Console::SafeVMPtrQuiet pVM (mParent);
+
     if (!pVM.isOk())
         return E_FAIL;
 
     char *pszSnapshot;
-    int vrc = STAMR3Snapshot(pVM, Utf8Str(aPattern).raw(), &pszSnapshot, NULL,
-                             !!aWithDescriptions);
-    if (RT_FAILURE(vrc))
+    int vrc = STAMR3Snapshot (pVM, Utf8Str (aPattern).raw(), &pszSnapshot, NULL,
+                              !!aWithDescriptions);
+    if (RT_FAILURE (vrc))
         return vrc == VERR_NO_MEMORY ? E_OUTOFMEMORY : E_FAIL;
 
@@ -186,572 +751,71 @@
      * Until that's done, this method is kind of useless for debugger statistics GUI because
      * of the amount statistics in a debug build. */
-    Bstr(pszSnapshot).cloneTo(aStats);
-
-    return S_OK;
-}
-
-/**
- * Returns the current recompile user mode code flag.
- *
- * @returns COM status code
- * @param   enabled address of result variable
- */
-STDMETHODIMP MachineDebugger::COMGETTER(RecompileUser)(BOOL *enabled)
-{
-    if (!enabled)
-        return E_POINTER;
-    AutoWriteLock alock (this);
-    CHECK_READY();
-    Console::SafeVMPtrQuiet pVM (mParent);
-    if (pVM.isOk())
-        *enabled = !EMIsRawRing3Enabled(pVM.raw());
-    else
-        *enabled = false;
-    return S_OK;
-}
-
-/**
- * Sets the recompile user mode code flag.
- *
- * @returns COM status
- * @param   enable new user mode code recompile flag.
- */
-STDMETHODIMP MachineDebugger::COMSETTER(RecompileUser)(BOOL enable)
-{
-    LogFlowThisFunc (("enable=%d\n", enable));
-
-    AutoWriteLock alock (this);
-    CHECK_READY();
-
-    if (!fFlushMode)
+    Bstr (pszSnapshot).cloneTo (aStats);
+
+    return S_OK;
+}
+
+
+// public methods only for internal purposes
+/////////////////////////////////////////////////////////////////////////////
+
+void MachineDebugger::flushQueuedSettings()
+{
+    mFlushMode = true;
+    if (mSinglestepQueued != ~0)
+    {
+        COMSETTER(Singlestep) (mSinglestepQueued);
+        mSinglestepQueued = ~0;
+    }
+    if (mRecompileUserQueued != ~0)
+    {
+        COMSETTER(RecompileUser) (mRecompileUserQueued);
+        mRecompileUserQueued = ~0;
+    }
+    if (mRecompileSupervisorQueued != ~0)
+    {
+        COMSETTER(RecompileSupervisor) (mRecompileSupervisorQueued);
+        mRecompileSupervisorQueued = ~0;
+    }
+    if (mPatmEnabledQueued != ~0)
+    {
+        COMSETTER(PATMEnabled) (mPatmEnabledQueued);
+        mPatmEnabledQueued = ~0;
+    }
+    if (mCsamEnabledQueued != ~0)
+    {
+        COMSETTER(CSAMEnabled) (mCsamEnabledQueued);
+        mCsamEnabledQueued = ~0;
+    }
+    if (mLogEnabledQueued != ~0)
+    {
+        COMSETTER(LogEnabled) (mLogEnabledQueued);
+        mLogEnabledQueued = ~0;
+    }
+    if (mVirtualTimeRateQueued != ~(uint32_t)0)
+    {
+        COMSETTER(VirtualTimeRate) (mVirtualTimeRateQueued);
+        mVirtualTimeRateQueued = ~0;
+    }
+    mFlushMode = false;
+}
+
+// private methods
+/////////////////////////////////////////////////////////////////////////////
+
+bool MachineDebugger::queueSettings() const
+{
+    if (!mFlushMode)
     {
         // check if the machine is running
         MachineState_T machineState;
-        mParent->COMGETTER(State)(&machineState);
+        mParent->COMGETTER(State) (&machineState);
         if (    machineState != MachineState_Running
             &&  machineState != MachineState_Paused
             &&  machineState != MachineState_Stuck)
-        {
             // queue the request
-            recompileUserQueued = enable;
-            return S_OK;
-        }
-    }
-
-    Console::SafeVMPtr pVM (mParent);
-    CheckComRCReturnRC (pVM.rc());
-
-    PVMREQ pReq;
-    EMRAWMODE rawModeFlag = enable ? EMRAW_RING3_DISABLE : EMRAW_RING3_ENABLE;
-    int rcVBox = VMR3ReqCall(pVM, VMREQDEST_ANY, &pReq, RT_INDEFINITE_WAIT,
-                             (PFNRT)EMR3RawSetMode, 2, pVM.raw(), rawModeFlag);
-    if (RT_SUCCESS(rcVBox))
-    {
-        rcVBox = pReq->iStatus;
-        VMR3ReqFree(pReq);
-    }
-
-    if (RT_SUCCESS(rcVBox))
-        return S_OK;
-
-    AssertMsgFailed(("Could not set raw mode flags to %d, rcVBox = %Rrc\n",
-                     rawModeFlag, rcVBox));
-    return E_FAIL;
-}
-
-/**
- * Returns the current recompile supervisor code flag.
- *
- * @returns COM status code
- * @param   enabled address of result variable
- */
-STDMETHODIMP MachineDebugger::COMGETTER(RecompileSupervisor)(BOOL *enabled)
-{
-    if (!enabled)
-        return E_POINTER;
-    AutoWriteLock alock (this);
-    CHECK_READY();
-    Console::SafeVMPtrQuiet pVM (mParent);
-    if (pVM.isOk())
-        *enabled = !EMIsRawRing0Enabled(pVM.raw());
-    else
-        *enabled = false;
-    return S_OK;
-}
-
-/**
- * Sets the new recompile supervisor code flag.
- *
- * @returns COM status code
- * @param   enable new recompile supervisor code flag
- */
-STDMETHODIMP MachineDebugger::COMSETTER(RecompileSupervisor)(BOOL enable)
-{
-    LogFlowThisFunc (("enable=%d\n", enable));
-
-    AutoWriteLock alock (this);
-    CHECK_READY();
-
-    if (!fFlushMode)
-    {
-        // check if the machine is running
-        MachineState_T machineState;
-        mParent->COMGETTER(State)(&machineState);
-        if (    machineState != MachineState_Running
-            &&  machineState != MachineState_Paused
-            &&  machineState != MachineState_Stuck)
-        {
-            // queue the request
-            recompileSupervisorQueued = enable;
-            return S_OK;
-        }
-    }
-
-    Console::SafeVMPtr pVM (mParent);
-    CheckComRCReturnRC (pVM.rc());
-
-    PVMREQ pReq;
-    EMRAWMODE rawModeFlag = enable ? EMRAW_RING0_DISABLE : EMRAW_RING0_ENABLE;
-    int rcVBox = VMR3ReqCall(pVM, VMREQDEST_ANY, &pReq, RT_INDEFINITE_WAIT,
-                             (PFNRT)EMR3RawSetMode, 2, pVM.raw(), rawModeFlag);
-    if (RT_SUCCESS(rcVBox))
-    {
-        rcVBox = pReq->iStatus;
-        VMR3ReqFree(pReq);
-    }
-
-    if (RT_SUCCESS(rcVBox))
-        return S_OK;
-
-    AssertMsgFailed(("Could not set raw mode flags to %d, rcVBox = %Rrc\n",
-                     rawModeFlag, rcVBox));
-    return E_FAIL;
-}
-
-/**
- * Returns the current patch manager enabled flag.
- *
- * @returns COM status code
- * @param   enabled address of result variable
- */
-STDMETHODIMP MachineDebugger::COMGETTER(PATMEnabled)(BOOL *enabled)
-{
-    if (!enabled)
-        return E_POINTER;
-    AutoWriteLock alock (this);
-    CHECK_READY();
-    Console::SafeVMPtrQuiet pVM (mParent);
-    if (pVM.isOk())
-        *enabled = PATMIsEnabled(pVM.raw());
-    else
-        *enabled = false;
-    return S_OK;
-}
-
-/**
- * Set the new patch manager enabled flag.
- *
- * @returns COM status code
- * @param   new patch manager enabled flag
- */
-STDMETHODIMP MachineDebugger::COMSETTER(PATMEnabled)(BOOL enable)
-{
-    AutoWriteLock alock (this);
-    CHECK_READY();
-    LogFlowThisFunc (("enable=%d\n", enable));
-
-    if (!fFlushMode)
-    {
-        // check if the machine is running
-        MachineState_T machineState;
-        mParent->COMGETTER(State)(&machineState);
-        if (    machineState != MachineState_Running
-            &&  machineState != MachineState_Paused
-            &&  machineState != MachineState_Stuck)
-        {
-            // queue the request
-            patmEnabledQueued = enable;
-            return S_OK;
-        }
-    }
-
-    Console::SafeVMPtr pVM (mParent);
-    CheckComRCReturnRC (pVM.rc());
-
-    PATMR3AllowPatching(pVM, enable);
-    return S_OK;
-}
-
-/**
- * Set the new patch manager enabled flag.
- *
- * @returns COM status code
- * @param   new patch manager enabled flag
- */
-STDMETHODIMP MachineDebugger::InjectNMI()
-{
-    AutoWriteLock alock (this);
-    CHECK_READY();
-    LogFlowThisFunc ((""));
-
-    Console::SafeVMPtr pVM (mParent);
-    CheckComRCReturnRC (pVM.rc());
-
-    HWACCMR3InjectNMI(pVM);
-    return S_OK;
-}
-
-/**
- * Returns the current code scanner enabled flag.
- *
- * @returns COM status code
- * @param   enabled address of result variable
- */
-STDMETHODIMP MachineDebugger::COMGETTER(CSAMEnabled)(BOOL *enabled)
-{
-    if (!enabled)
-        return E_POINTER;
-    AutoWriteLock alock (this);
-    CHECK_READY();
-    Console::SafeVMPtrQuiet pVM (mParent);
-    if (pVM.isOk())
-        *enabled = CSAMIsEnabled(pVM.raw());
-    else
-        *enabled = false;
-    return S_OK;
-}
-
-/**
- * Sets the new code scanner enabled flag.
- *
- * @returns COM status code
- * @param   enable new code scanner enabled flag
- */
-STDMETHODIMP MachineDebugger::COMSETTER(CSAMEnabled)(BOOL enable)
-{
-    AutoWriteLock alock (this);
-    CHECK_READY();
-    LogFlowThisFunc (("enable=%d\n", enable));
-
-    if (!fFlushMode)
-    {
-        // check if the machine is running
-        MachineState_T machineState;
-        mParent->COMGETTER(State)(&machineState);
-        if (    machineState != MachineState_Running
-            &&  machineState != MachineState_Paused
-            &&  machineState != MachineState_Stuck)
-        {
-            // queue the request
-            csamEnabledQueued = enable;
-            return S_OK;
-        }
-    }
-
-    Console::SafeVMPtr pVM (mParent);
-    CheckComRCReturnRC (pVM.rc());
-
-    int vrc;
-    if (enable)
-        vrc = CSAMEnableScanning(pVM);
-    else
-        vrc = CSAMDisableScanning(pVM);
-    if (RT_FAILURE(vrc))
-    {
-        /** @todo handle error case */
-    }
-    return S_OK;
-}
-
-/**
- * Returns the log enabled / disabled status.
- *
- * @returns COM status code
- * @param   aEnabled     address of result variable
- */
-STDMETHODIMP MachineDebugger::COMGETTER(LogEnabled)(BOOL *aEnabled)
-{
-    if (!aEnabled)
-        return E_POINTER;
-    AutoWriteLock alock(this);
-    CHECK_READY();
-#ifdef LOG_ENABLED
-    PRTLOGGER pLogInstance = RTLogDefaultInstance();
-    *aEnabled = pLogInstance && !(pLogInstance->fFlags & RTLOGFLAGS_DISABLED);
-#else
-    *aEnabled = false;
-#endif
-    return S_OK;
-}
-
-/**
- * Enables or disables logging.
- *
- * @returns COM status code
- * @param   aEnabled    The new code log state.
- */
-STDMETHODIMP MachineDebugger::COMSETTER(LogEnabled)(BOOL aEnabled)
-{
-    AutoWriteLock alock(this);
-
-    CHECK_READY();
-    LogFlowThisFunc (("aEnabled=%d\n", aEnabled));
-
-    if (!fFlushMode)
-    {
-        // check if the machine is running
-        MachineState_T machineState;
-        mParent->COMGETTER(State)(&machineState);
-        if (    machineState != MachineState_Running
-            &&  machineState != MachineState_Paused
-            &&  machineState != MachineState_Stuck)
-        {
-            // queue the request
-            mLogEnabledQueued = aEnabled;
-            return S_OK;
-        }
-    }
-
-    Console::SafeVMPtr pVM (mParent);
-    CheckComRCReturnRC (pVM.rc());
-
-#ifdef LOG_ENABLED
-    int vrc = DBGFR3LogModifyFlags(pVM, aEnabled ? "enabled" : "disabled");
-    if (RT_FAILURE(vrc))
-    {
-        /** @todo handle error code. */
-    }
-#endif
-    return S_OK;
-}
-
-/**
- * Returns the current hardware virtualization flag.
- *
- * @returns COM status code
- * @param   enabled address of result variable
- */
-STDMETHODIMP MachineDebugger::COMGETTER(HWVirtExEnabled)(BOOL *enabled)
-{
-    if (!enabled)
-        return E_POINTER;
-
-    AutoWriteLock alock (this);
-    CHECK_READY();
-
-    Console::SafeVMPtrQuiet pVM (mParent);
-    if (pVM.isOk())
-        *enabled = HWACCMIsEnabled(pVM.raw());
-    else
-        *enabled = false;
-    return S_OK;
-}
-
-/**
- * Returns the current nested paging flag.
- *
- * @returns COM status code
- * @param   enabled address of result variable
- */
-STDMETHODIMP MachineDebugger::COMGETTER(HWVirtExNestedPagingEnabled)(BOOL *enabled)
-{
-    if (!enabled)
-        return E_POINTER;
-
-    AutoWriteLock alock (this);
-    CHECK_READY();
-
-    Console::SafeVMPtrQuiet pVM (mParent);
-    if (pVM.isOk())
-        *enabled = HWACCMR3IsNestedPagingActive(pVM.raw());
-    else
-        *enabled = false;
-    return S_OK;
-}
-
-/**
- * Returns the current VPID flag.
- *
- * @returns COM status code
- * @param   enabled address of result variable
- */
-STDMETHODIMP MachineDebugger::COMGETTER(HWVirtExVPIDEnabled)(BOOL *enabled)
-{
-    if (!enabled)
-        return E_POINTER;
-
-    AutoWriteLock alock (this);
-    CHECK_READY();
-
-    Console::SafeVMPtrQuiet pVM (mParent);
-    if (pVM.isOk())
-        *enabled = HWACCMR3IsVPIDActive(pVM.raw());
-    else
-        *enabled = false;
-    return S_OK;
-}
-
-/**
- * Returns the current PAE flag.
- *
- * @returns COM status code
- * @param   enabled address of result variable
- */
-STDMETHODIMP MachineDebugger::COMGETTER(PAEEnabled)(BOOL *enabled)
-{
-    if (!enabled)
-        return E_POINTER;
-
-    AutoWriteLock alock (this);
-    CHECK_READY();
-
-    Console::SafeVMPtrQuiet pVM (mParent);
-    if (pVM.isOk())
-    {
-        uint64_t cr4 = CPUMGetGuestCR4(pVM.raw());
-        *enabled = !!(cr4 & X86_CR4_PAE);
-    }
-    else
-        *enabled = false;
-    return S_OK;
-}
-
-/**
- * Returns the current virtual time rate.
- *
- * @returns COM status code.
- * @param   pct     Where to store the rate.
- */
-STDMETHODIMP MachineDebugger::COMGETTER(VirtualTimeRate)(ULONG *pct)
-{
-    if (!pct)
-        return E_POINTER;
-
-    AutoWriteLock alock (this);
-    CHECK_READY();
-
-    Console::SafeVMPtrQuiet pVM (mParent);
-    if (pVM.isOk())
-        *pct = TMVirtualGetWarpDrive(pVM);
-    else
-        *pct = 100;
-    return S_OK;
-}
-
-/**
- * Returns the current virtual time rate.
- *
- * @returns COM status code.
- * @param   pct     Where to store the rate.
- */
-STDMETHODIMP MachineDebugger::COMSETTER(VirtualTimeRate)(ULONG pct)
-{
-    if (pct < 2 || pct > 20000)
-        return E_INVALIDARG;
-
-    AutoWriteLock alock (this);
-    CHECK_READY();
-
-    if (!fFlushMode)
-    {
-        // check if the machine is running
-        MachineState_T machineState;
-        mParent->COMGETTER(State)(&machineState);
-        if (    machineState != MachineState_Running
-            &&  machineState != MachineState_Paused
-            &&  machineState != MachineState_Stuck)
-        {
-            // queue the request
-            mVirtualTimeRateQueued = pct;
-            return S_OK;
-        }
-    }
-
-    Console::SafeVMPtr pVM (mParent);
-    CheckComRCReturnRC (pVM.rc());
-
-    int vrc = TMVirtualSetWarpDrive(pVM, pct);
-    if (RT_FAILURE(vrc))
-    {
-        /** @todo handle error code. */
-    }
-    return S_OK;
-}
-
-/**
- * Hack for getting the VM handle.
- * This is only temporary (promise) while prototyping the debugger.
- *
- * @returns COM status code
- * @param   vm      Where to store the vm handle.
- *                  Since there is no uintptr_t in COM, we're using the max integer.
- *                  (No, ULONG is not pointer sized!)
- */
-STDMETHODIMP MachineDebugger::COMGETTER(VM)(ULONG64 *vm)
-{
-    if (!vm)
-        return E_POINTER;
-
-    AutoWriteLock alock (this);
-    CHECK_READY();
-
-    Console::SafeVMPtr pVM (mParent);
-    CheckComRCReturnRC (pVM.rc());
-
-    *vm = (uintptr_t)pVM.raw();
-
-    /*
-     *  Note: pVM protection provided by SafeVMPtr is no more effective
-     *  after we return from this method.
-     */
-
-    return S_OK;
-}
-
-//
-// "public-private" methods
-//
-void MachineDebugger::flushQueuedSettings()
-{
-    fFlushMode = true;
-    if (singlestepQueued != ~0)
-    {
-        COMSETTER(Singlestep)(singlestepQueued);
-        singlestepQueued = ~0;
-    }
-    if (recompileUserQueued != ~0)
-    {
-        COMSETTER(RecompileUser)(recompileUserQueued);
-        recompileUserQueued = ~0;
-    }
-    if (recompileSupervisorQueued != ~0)
-    {
-        COMSETTER(RecompileSupervisor)(recompileSupervisorQueued);
-        recompileSupervisorQueued = ~0;
-    }
-    if (patmEnabledQueued != ~0)
-    {
-        COMSETTER(PATMEnabled)(patmEnabledQueued);
-        patmEnabledQueued = ~0;
-    }
-    if (csamEnabledQueued != ~0)
-    {
-        COMSETTER(CSAMEnabled)(csamEnabledQueued);
-        csamEnabledQueued = ~0;
-    }
-    if (mLogEnabledQueued != ~0)
-    {
-        COMSETTER(LogEnabled)(mLogEnabledQueued);
-        mLogEnabledQueued = ~0;
-    }
-    if (mVirtualTimeRateQueued != ~(uint32_t)0)
-    {
-        COMSETTER(VirtualTimeRate)(mVirtualTimeRateQueued);
-        mVirtualTimeRateQueued = ~0;
-    }
-    fFlushMode = false;
-}
-
-//
-// private methods
-//
+            return true;
+    }
+    return false;
+}
+
Index: trunk/src/VBox/Main/include/MachineDebuggerImpl.h
===================================================================
--- trunk/src/VBox/Main/include/MachineDebuggerImpl.h	(revision 14626)
+++ trunk/src/VBox/Main/include/MachineDebuggerImpl.h	(revision 14627)
@@ -1,2 +1,4 @@
+/* $Id$ */
+
 /** @file
  *
@@ -5,5 +7,5 @@
 
 /*
- * Copyright (C) 2006-2007 Sun Microsystems, Inc.
+ * Copyright (C) 2006-2008 Sun Microsystems, Inc.
  *
  * This file is part of VirtualBox Open Source Edition (OSE), as
@@ -28,21 +30,25 @@
 
 class ATL_NO_VTABLE MachineDebugger :
+    public VirtualBoxBaseNEXT,
     public VirtualBoxSupportErrorInfoImpl <MachineDebugger, IMachineDebugger>,
     public VirtualBoxSupportTranslation <MachineDebugger>,
-    public VirtualBoxBase,
     public IMachineDebugger
 {
 public:
 
-    DECLARE_NOT_AGGREGATABLE(MachineDebugger)
+    VIRTUALBOXBASE_ADD_ERRORINFO_SUPPORT (MachineDebugger)
+
+    DECLARE_NOT_AGGREGATABLE (MachineDebugger)
 
     DECLARE_PROTECT_FINAL_CONSTRUCT()
 
     BEGIN_COM_MAP(MachineDebugger)
-        COM_INTERFACE_ENTRY(ISupportErrorInfo)
-        COM_INTERFACE_ENTRY(IMachineDebugger)
+        COM_INTERFACE_ENTRY (ISupportErrorInfo)
+        COM_INTERFACE_ENTRY (IMachineDebugger)
     END_COM_MAP()
 
     NS_DECL_ISUPPORTS
+
+    DECLARE_EMPTY_CTOR_DTOR (MachineDebugger)
 
     HRESULT FinalConstruct();
@@ -50,33 +56,33 @@
 
     // public initializer/uninitializer for internal purposes only
-    HRESULT init (Console *parent);
+    HRESULT init (Console *aParent);
     void uninit();
 
     // IMachineDebugger properties
-    STDMETHOD(COMGETTER(Singlestep))(BOOL *enabled);
-    STDMETHOD(COMSETTER(Singlestep))(BOOL enable);
-    STDMETHOD(COMGETTER(RecompileUser))(BOOL *enabled);
-    STDMETHOD(COMSETTER(RecompileUser))(BOOL enable);
-    STDMETHOD(COMGETTER(RecompileSupervisor))(BOOL *enabled);
-    STDMETHOD(COMSETTER(RecompileSupervisor))(BOOL enable);
-    STDMETHOD(COMGETTER(PATMEnabled))(BOOL *enabled);
-    STDMETHOD(COMSETTER(PATMEnabled))(BOOL enable);
-    STDMETHOD(COMGETTER(CSAMEnabled))(BOOL *enabled);
-    STDMETHOD(COMSETTER(CSAMEnabled))(BOOL enable);
-    STDMETHOD(COMGETTER(LogEnabled))(BOOL *enabled);
-    STDMETHOD(COMSETTER(LogEnabled))(BOOL enable);
-    STDMETHOD(COMGETTER(HWVirtExEnabled))(BOOL *enabled);
-    STDMETHOD(COMGETTER(HWVirtExNestedPagingEnabled))(BOOL *enabled);
-    STDMETHOD(COMGETTER(HWVirtExVPIDEnabled))(BOOL *enabled);
-    STDMETHOD(COMGETTER(PAEEnabled))(BOOL *enabled);
-    STDMETHOD(COMGETTER(VirtualTimeRate))(ULONG *pct);
-    STDMETHOD(COMSETTER(VirtualTimeRate))(ULONG pct);
-    STDMETHOD(COMGETTER(VM))(ULONG64 *vm);
+    STDMETHOD(COMGETTER(Singlestep)) (BOOL *aEnabled);
+    STDMETHOD(COMSETTER(Singlestep)) (BOOL aEnable);
+    STDMETHOD(COMGETTER(RecompileUser)) (BOOL *aEnabled);
+    STDMETHOD(COMSETTER(RecompileUser)) (BOOL aEnable);
+    STDMETHOD(COMGETTER(RecompileSupervisor)) (BOOL *aEnabled);
+    STDMETHOD(COMSETTER(RecompileSupervisor)) (BOOL aEnable);
+    STDMETHOD(COMGETTER(PATMEnabled)) (BOOL *aEnabled);
+    STDMETHOD(COMSETTER(PATMEnabled)) (BOOL aEnable);
+    STDMETHOD(COMGETTER(CSAMEnabled)) (BOOL *aEnabled);
+    STDMETHOD(COMSETTER(CSAMEnabled)) (BOOL aEnable);
+    STDMETHOD(COMGETTER(LogEnabled)) (BOOL *aEnabled);
+    STDMETHOD(COMSETTER(LogEnabled)) (BOOL aEnable);
+    STDMETHOD(COMGETTER(HWVirtExEnabled)) (BOOL *aEnabled);
+    STDMETHOD(COMGETTER(HWVirtExNestedPagingEnabled)) (BOOL *aEnabled);
+    STDMETHOD(COMGETTER(HWVirtExVPIDEnabled)) (BOOL *aEnabled);
+    STDMETHOD(COMGETTER(PAEEnabled)) (BOOL *aEnabled);
+    STDMETHOD(COMGETTER(VirtualTimeRate)) (ULONG *aPct);
+    STDMETHOD(COMSETTER(VirtualTimeRate)) (ULONG aPct);
+    STDMETHOD(COMGETTER(VM)) (ULONG64 *aVm);
     STDMETHOD(InjectNMI)();
 
     // IMachineDebugger methods
-    STDMETHOD(ResetStats(INPTR BSTR aPattern));
-    STDMETHOD(DumpStats(INPTR BSTR aPattern));
-    STDMETHOD(GetStats(INPTR BSTR aPattern, BOOL aWithDescriptions, BSTR *aStats));
+    STDMETHOD(ResetStats (INPTR BSTR aPattern));
+    STDMETHOD(DumpStats (INPTR BSTR aPattern));
+    STDMETHOD(GetStats (INPTR BSTR aPattern, BOOL aWithDescriptions, BSTR *aStats));
 
 
@@ -88,16 +94,19 @@
 
 private:
-    ComObjPtr <Console, ComWeakRef> mParent;
+    // private methods
+    bool queueSettings() const;
+
+    const ComObjPtr <Console, ComWeakRef> mParent;
     // flags whether settings have been queued because
     // they could not be sent to the VM (not up yet, etc.)
-    int singlestepQueued;
-    int recompileUserQueued;
-    int recompileSupervisorQueued;
-    int patmEnabledQueued;
-    int csamEnabledQueued;
+    int mSinglestepQueued;
+    int mRecompileUserQueued;
+    int mRecompileSupervisorQueued;
+    int mPatmEnabledQueued;
+    int mCsamEnabledQueued;
     int mLogEnabledQueued;
     uint32_t mVirtualTimeRateQueued;
-    bool fFlushMode;
+    bool mFlushMode;
 };
 
-#endif // ____H_MACHINEDEBUGGER
+#endif /* ____H_MACHINEDEBUGGER */
