VirtualBox

Changeset 14627 in vbox for trunk/src


Ignore:
Timestamp:
Nov 26, 2008 10:17:37 AM (16 years ago)
Author:
vboxsync
Message:

Main: new locking scheme

Location:
trunk/src/VBox/Main
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/MachineDebuggerImpl.cpp

    r14579 r14627  
     1/* $Id$ */
     2
    13/** @file
    24 *
     
    57
    68/*
    7  * Copyright (C) 2006-2007 Sun Microsystems, Inc.
     9 * Copyright (C) 2006-2008 Sun Microsystems, Inc.
    810 *
    911 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    3234#include <VBox/hwaccm.h>
    3335
    34 //
    3536// defines
    36 //
    37 
    38 
    39 //
     37/////////////////////////////////////////////////////////////////////////////
     38
     39
    4040// globals
    41 //
    42 
    43 
    44 //
     41/////////////////////////////////////////////////////////////////////////////
     42
     43
    4544// constructor / destructor
    46 //
     45/////////////////////////////////////////////////////////////////////////////
     46
     47DEFINE_EMPTY_CTOR_DTOR (MachineDebugger)
    4748
    4849HRESULT MachineDebugger::FinalConstruct()
    4950{
    50     mParent = NULL;
     51    unconst (mParent) = NULL;
    5152    return S_OK;
    5253}
     
    5455void MachineDebugger::FinalRelease()
    5556{
    56     if (isReady())
    57         uninit();
    58 }
    59 
    60 //
    61 // public methods
    62 //
     57    uninit();
     58}
     59
     60// public initializer/uninitializer for internal purposes only
     61/////////////////////////////////////////////////////////////////////////////
    6362
    6463/**
     
    6665 *
    6766 * @returns COM result indicator
    68  * @param parent handle of our parent object
    69  */
    70 HRESULT MachineDebugger::init(Console *parent)
    71 {
    72     LogFlow(("MachineDebugger::init(): isReady=%d\n", isReady()));
    73 
    74     ComAssertRet (parent, E_INVALIDARG);
    75 
    76     AutoWriteLock alock (this);
    77     ComAssertRet (!isReady(), E_FAIL);
    78 
    79     mParent = parent;
    80     singlestepQueued = ~0;
    81     recompileUserQueued = ~0;
    82     recompileSupervisorQueued = ~0;
    83     patmEnabledQueued = ~0;
    84     csamEnabledQueued = ~0;
     67 * @param aParent handle of our parent object
     68 */
     69HRESULT MachineDebugger::init (Console *aParent)
     70{
     71    LogFlowThisFunc (("aParent=%p\n", aParent));
     72
     73    ComAssertRet (aParent, E_INVALIDARG);
     74
     75    /* Enclose the state transition NotReady->InInit->Ready */
     76    AutoInitSpan autoInitSpan (this);
     77    AssertReturn (autoInitSpan.isOk(), E_FAIL);
     78
     79    unconst (mParent) = aParent;
     80
     81    mSinglestepQueued = ~0;
     82    mRecompileUserQueued = ~0;
     83    mRecompileSupervisorQueued = ~0;
     84    mPatmEnabledQueued = ~0;
     85    mCsamEnabledQueued = ~0;
    8586    mLogEnabledQueued = ~0;
    8687    mVirtualTimeRateQueued = ~0;
    87     fFlushMode = false;
    88     setReady(true);
     88    mFlushMode = false;
     89
     90    /* Confirm a successful initialization */
     91    autoInitSpan.setSucceeded();
     92
    8993    return S_OK;
    9094}
     
    96100void MachineDebugger::uninit()
    97101{
    98     LogFlow(("MachineDebugger::uninit(): isReady=%d\n", isReady()));
    99 
    100     AutoWriteLock alock (this);
    101     AssertReturn (isReady(), (void) 0);
    102 
    103     setReady (false);
    104 }
     102    LogFlowThisFunc (("\n"));
     103
     104    /* Enclose the state transition Ready->InUninit->NotReady */
     105    AutoUninitSpan autoUninitSpan (this);
     106    if (autoUninitSpan.uninitDone())
     107        return;
     108
     109    unconst (mParent).setNull();
     110    mFlushMode = false;
     111}
     112
     113// IMachineDebugger properties
     114/////////////////////////////////////////////////////////////////////////////
    105115
    106116/**
     
    108118 *
    109119 * @returns COM status code
    110  * @param   enabled address of result variable
    111  */
    112 STDMETHODIMP MachineDebugger::COMGETTER(Singlestep)(BOOL *enabled)
    113 {
    114     if (!enabled)
    115         return E_POINTER;
    116     AutoWriteLock alock (this);
    117     CHECK_READY();
     120 * @param   aEnabled address of result variable
     121 */
     122STDMETHODIMP MachineDebugger::COMGETTER(Singlestep) (BOOL *aEnabled)
     123{
     124    if (!aEnabled)
     125        return E_POINTER;
     126
     127    AutoCaller autoCaller (this);
     128    CheckComRCReturnRC (autoCaller.rc());
     129
    118130    /** @todo */
    119131    return E_NOTIMPL;
     
    124136 *
    125137 * @returns COM status code
    126  * @param enable new singlestepping flag
    127  */
    128 STDMETHODIMP MachineDebugger::COMSETTER(Singlestep)(BOOL enable)
    129 {
    130     AutoWriteLock alock (this);
    131     CHECK_READY();
     138 * @param aEnable new singlestepping flag
     139 */
     140STDMETHODIMP MachineDebugger::COMSETTER(Singlestep) (BOOL aEnable)
     141{
     142    AutoCaller autoCaller (this);
     143    CheckComRCReturnRC (autoCaller.rc());
     144
    132145    /** @todo */
    133146    return E_NOTIMPL;
     
    135148
    136149/**
     150 * Returns the current recompile user mode code flag.
     151 *
     152 * @returns COM status code
     153 * @param   aEnabled address of result variable
     154 */
     155STDMETHODIMP MachineDebugger::COMGETTER(RecompileUser) (BOOL *aEnabled)
     156{
     157    if (!aEnabled)
     158        return E_POINTER;
     159
     160    AutoCaller autoCaller (this);
     161    CheckComRCReturnRC (autoCaller.rc());
     162
     163    AutoReadLock alock (this);
     164
     165    Console::SafeVMPtrQuiet pVM (mParent);
     166
     167    if (pVM.isOk())
     168        *aEnabled = !EMIsRawRing3Enabled (pVM.raw());
     169    else
     170        *aEnabled = false;
     171
     172    return S_OK;
     173}
     174
     175/**
     176 * Sets the recompile user mode code flag.
     177 *
     178 * @returns COM status
     179 * @param   aEnable new user mode code recompile flag.
     180 */
     181STDMETHODIMP MachineDebugger::COMSETTER(RecompileUser) (BOOL aEnable)
     182{
     183    LogFlowThisFunc (("enable=%d\n", aEnable));
     184
     185    AutoCaller autoCaller (this);
     186    CheckComRCReturnRC (autoCaller.rc());
     187
     188    AutoWriteLock alock (this);
     189
     190    if (queueSettings())
     191    {
     192        // queue the request
     193        mRecompileUserQueued = aEnable;
     194        return S_OK;
     195    }
     196
     197    Console::SafeVMPtr pVM (mParent);
     198    CheckComRCReturnRC (pVM.rc());
     199
     200    PVMREQ pReq;
     201    EMRAWMODE rawModeFlag = aEnable ? EMRAW_RING3_DISABLE : EMRAW_RING3_ENABLE;
     202    int rcVBox = VMR3ReqCall (pVM, VMREQDEST_ANY, &pReq, RT_INDEFINITE_WAIT,
     203                              (PFNRT)EMR3RawSetMode, 2, pVM.raw(), rawModeFlag);
     204    if (RT_SUCCESS (rcVBox))
     205    {
     206        rcVBox = pReq->iStatus;
     207        VMR3ReqFree (pReq);
     208    }
     209
     210    if (RT_SUCCESS (rcVBox))
     211        return S_OK;
     212
     213    AssertMsgFailed (("Could not set raw mode flags to %d, rcVBox = %Rrc\n",
     214                      rawModeFlag, rcVBox));
     215    return E_FAIL;
     216}
     217
     218/**
     219 * Returns the current recompile supervisor code flag.
     220 *
     221 * @returns COM status code
     222 * @param   aEnabled address of result variable
     223 */
     224STDMETHODIMP MachineDebugger::COMGETTER(RecompileSupervisor) (BOOL *aEnabled)
     225{
     226    if (!aEnabled)
     227        return E_POINTER;
     228
     229    AutoCaller autoCaller (this);
     230    CheckComRCReturnRC (autoCaller.rc());
     231
     232    AutoReadLock alock (this);
     233
     234    Console::SafeVMPtrQuiet pVM (mParent);
     235
     236    if (pVM.isOk())
     237        *aEnabled = !EMIsRawRing0Enabled (pVM.raw());
     238    else
     239        *aEnabled = false;
     240
     241    return S_OK;
     242}
     243
     244/**
     245 * Sets the new recompile supervisor code flag.
     246 *
     247 * @returns COM status code
     248 * @param   aEnable new recompile supervisor code flag
     249 */
     250STDMETHODIMP MachineDebugger::COMSETTER(RecompileSupervisor) (BOOL aEnable)
     251{
     252    LogFlowThisFunc (("enable=%d\n", aEnable));
     253
     254    AutoCaller autoCaller (this);
     255    CheckComRCReturnRC (autoCaller.rc());
     256
     257    AutoWriteLock alock (this);
     258
     259    if (queueSettings())
     260    {
     261        // queue the request
     262        mRecompileSupervisorQueued = aEnable;
     263        return S_OK;
     264    }
     265
     266    Console::SafeVMPtr pVM (mParent);
     267    CheckComRCReturnRC (pVM.rc());
     268
     269    PVMREQ pReq;
     270    EMRAWMODE rawModeFlag = aEnable ? EMRAW_RING0_DISABLE : EMRAW_RING0_ENABLE;
     271    int rcVBox = VMR3ReqCall (pVM, VMREQDEST_ANY, &pReq, RT_INDEFINITE_WAIT,
     272                              (PFNRT)EMR3RawSetMode, 2, pVM.raw(), rawModeFlag);
     273    if (RT_SUCCESS (rcVBox))
     274    {
     275        rcVBox = pReq->iStatus;
     276        VMR3ReqFree (pReq);
     277    }
     278
     279    if (RT_SUCCESS (rcVBox))
     280        return S_OK;
     281
     282    AssertMsgFailed (("Could not set raw mode flags to %d, rcVBox = %Rrc\n",
     283                      rawModeFlag, rcVBox));
     284    return E_FAIL;
     285}
     286
     287/**
     288 * Returns the current patch manager enabled flag.
     289 *
     290 * @returns COM status code
     291 * @param   aEnabled address of result variable
     292 */
     293STDMETHODIMP MachineDebugger::COMGETTER(PATMEnabled) (BOOL *aEnabled)
     294{
     295    if (!aEnabled)
     296        return E_POINTER;
     297
     298    AutoCaller autoCaller (this);
     299    CheckComRCReturnRC (autoCaller.rc());
     300
     301    AutoReadLock alock (this);
     302
     303    Console::SafeVMPtrQuiet pVM (mParent);
     304
     305    if (pVM.isOk())
     306        *aEnabled = PATMIsEnabled (pVM.raw());
     307    else
     308        *aEnabled = false;
     309
     310    return S_OK;
     311}
     312
     313/**
     314 * Set the new patch manager enabled flag.
     315 *
     316 * @returns COM status code
     317 * @param   aEnable new patch manager enabled flag
     318 */
     319STDMETHODIMP MachineDebugger::COMSETTER(PATMEnabled) (BOOL aEnable)
     320{
     321    LogFlowThisFunc (("enable=%d\n", aEnable));
     322
     323    AutoCaller autoCaller (this);
     324    CheckComRCReturnRC (autoCaller.rc());
     325
     326    AutoWriteLock alock (this);
     327
     328    if (queueSettings())
     329    {
     330        // queue the request
     331        mPatmEnabledQueued = aEnable;
     332        return S_OK;
     333    }
     334
     335    Console::SafeVMPtr pVM (mParent);
     336    CheckComRCReturnRC (pVM.rc());
     337
     338    PATMR3AllowPatching (pVM, aEnable);
     339
     340    return S_OK;
     341}
     342
     343/**
     344 * Set the new patch manager enabled flag.
     345 *
     346 * @returns COM status code
     347 * @param   new patch manager enabled flag
     348 */
     349STDMETHODIMP MachineDebugger::InjectNMI()
     350{
     351    LogFlowThisFunc ((""));
     352
     353    AutoCaller autoCaller (this);
     354    CheckComRCReturnRC (autoCaller.rc());
     355
     356    AutoWriteLock alock (this);
     357
     358    Console::SafeVMPtr pVM (mParent);
     359    CheckComRCReturnRC (pVM.rc());
     360
     361    HWACCMR3InjectNMI(pVM);
     362
     363    return S_OK;
     364}
     365
     366/**
     367 * Returns the current code scanner enabled flag.
     368 *
     369 * @returns COM status code
     370 * @param   aEnabled address of result variable
     371 */
     372STDMETHODIMP MachineDebugger::COMGETTER(CSAMEnabled) (BOOL *aEnabled)
     373{
     374    if (!aEnabled)
     375        return E_POINTER;
     376
     377    AutoCaller autoCaller (this);
     378    CheckComRCReturnRC (autoCaller.rc());
     379
     380    AutoReadLock alock (this);
     381
     382    Console::SafeVMPtrQuiet pVM (mParent);
     383
     384    if (pVM.isOk())
     385        *aEnabled = CSAMIsEnabled (pVM.raw());
     386    else
     387        *aEnabled = false;
     388
     389    return S_OK;
     390}
     391
     392/**
     393 * Sets the new code scanner enabled flag.
     394 *
     395 * @returns COM status code
     396 * @param   aEnable new code scanner enabled flag
     397 */
     398STDMETHODIMP MachineDebugger::COMSETTER(CSAMEnabled) (BOOL aEnable)
     399{
     400    LogFlowThisFunc (("enable=%d\n", aEnable));
     401
     402    AutoCaller autoCaller (this);
     403    CheckComRCReturnRC (autoCaller.rc());
     404
     405    AutoWriteLock alock (this);
     406
     407    if (queueSettings())
     408    {
     409        // queue the request
     410        mCsamEnabledQueued = aEnable;
     411        return S_OK;
     412    }
     413
     414    Console::SafeVMPtr pVM (mParent);
     415    CheckComRCReturnRC (pVM.rc());
     416
     417    int vrc;
     418    if (aEnable)
     419        vrc = CSAMEnableScanning (pVM);
     420    else
     421        vrc = CSAMDisableScanning (pVM);
     422
     423    if (RT_FAILURE (vrc))
     424    {
     425        /** @todo handle error case */
     426    }
     427
     428    return S_OK;
     429}
     430
     431/**
     432 * Returns the log enabled / disabled status.
     433 *
     434 * @returns COM status code
     435 * @param   aEnabled     address of result variable
     436 */
     437STDMETHODIMP MachineDebugger::COMGETTER(LogEnabled) (BOOL *aEnabled)
     438{
     439    if (!aEnabled)
     440        return E_POINTER;
     441
     442    AutoCaller autoCaller (this);
     443    CheckComRCReturnRC (autoCaller.rc());
     444
     445#ifdef LOG_ENABLED
     446    AutoReadLock alock (this);
     447
     448    const PRTLOGGER pLogInstance = RTLogDefaultInstance();
     449    *aEnabled = pLogInstance && !(pLogInstance->fFlags & RTLOGFLAGS_DISABLED);
     450#else
     451    *aEnabled = false;
     452#endif
     453
     454    return S_OK;
     455}
     456
     457/**
     458 * Enables or disables logging.
     459 *
     460 * @returns COM status code
     461 * @param   aEnabled    The new code log state.
     462 */
     463STDMETHODIMP MachineDebugger::COMSETTER(LogEnabled) (BOOL aEnabled)
     464{
     465    LogFlowThisFunc (("aEnabled=%d\n", aEnabled));
     466
     467    AutoCaller autoCaller (this);
     468    CheckComRCReturnRC (autoCaller.rc());
     469
     470    AutoWriteLock alock (this);
     471
     472    if (queueSettings())
     473    {
     474        // queue the request
     475        mLogEnabledQueued = aEnabled;
     476        return S_OK;
     477    }
     478
     479    Console::SafeVMPtr pVM (mParent);
     480    CheckComRCReturnRC (pVM.rc());
     481
     482#ifdef LOG_ENABLED
     483    int vrc = DBGFR3LogModifyFlags (pVM, aEnabled ? "enabled" : "disabled");
     484    if (RT_FAILURE (vrc))
     485    {
     486        /** @todo handle error code. */
     487    }
     488#endif
     489
     490    return S_OK;
     491}
     492
     493/**
     494 * Returns the current hardware virtualization flag.
     495 *
     496 * @returns COM status code
     497 * @param   aEnabled address of result variable
     498 */
     499STDMETHODIMP MachineDebugger::COMGETTER(HWVirtExEnabled) (BOOL *aEnabled)
     500{
     501    if (!aEnabled)
     502        return E_POINTER;
     503
     504    AutoCaller autoCaller (this);
     505    CheckComRCReturnRC (autoCaller.rc());
     506
     507    AutoReadLock alock (this);
     508
     509    Console::SafeVMPtrQuiet pVM (mParent);
     510
     511    if (pVM.isOk())
     512        *aEnabled = HWACCMIsEnabled (pVM.raw());
     513    else
     514        *aEnabled = false;
     515
     516    return S_OK;
     517}
     518
     519/**
     520 * Returns the current nested paging flag.
     521 *
     522 * @returns COM status code
     523 * @param   aEnabled address of result variable
     524 */
     525STDMETHODIMP MachineDebugger::COMGETTER(HWVirtExNestedPagingEnabled) (BOOL *aEnabled)
     526{
     527    if (!aEnabled)
     528        return E_POINTER;
     529
     530    AutoCaller autoCaller (this);
     531    CheckComRCReturnRC (autoCaller.rc());
     532
     533    AutoReadLock alock (this);
     534
     535    Console::SafeVMPtrQuiet pVM (mParent);
     536
     537    if (pVM.isOk())
     538        *aEnabled = HWACCMR3IsNestedPagingActive (pVM.raw());
     539    else
     540        *aEnabled = false;
     541
     542    return S_OK;
     543}
     544
     545/**
     546 * Returns the current VPID flag.
     547 *
     548 * @returns COM status code
     549 * @param   aEnabled address of result variable
     550 */
     551STDMETHODIMP MachineDebugger::COMGETTER(HWVirtExVPIDEnabled) (BOOL *aEnabled)
     552{
     553    if (!aEnabled)
     554        return E_POINTER;
     555
     556    AutoCaller autoCaller (this);
     557    CheckComRCReturnRC (autoCaller.rc());
     558
     559    AutoReadLock alock (this);
     560
     561    Console::SafeVMPtrQuiet pVM (mParent);
     562
     563    if (pVM.isOk())
     564        *aEnabled = HWACCMR3IsVPIDActive (pVM.raw());
     565    else
     566        *aEnabled = false;
     567
     568    return S_OK;
     569}
     570
     571/**
     572 * Returns the current PAE flag.
     573 *
     574 * @returns COM status code
     575 * @param   aEnabled address of result variable
     576 */
     577STDMETHODIMP MachineDebugger::COMGETTER(PAEEnabled) (BOOL *aEnabled)
     578{
     579    if (!aEnabled)
     580        return E_POINTER;
     581
     582    AutoCaller autoCaller (this);
     583    CheckComRCReturnRC (autoCaller.rc());
     584
     585    AutoReadLock alock (this);
     586
     587    Console::SafeVMPtrQuiet pVM (mParent);
     588
     589    if (pVM.isOk())
     590    {
     591        uint64_t cr4 = CPUMGetGuestCR4 (pVM.raw());
     592        *aEnabled = !!(cr4 & X86_CR4_PAE);
     593    }
     594    else
     595        *aEnabled = false;
     596
     597    return S_OK;
     598}
     599
     600/**
     601 * Returns the current virtual time rate.
     602 *
     603 * @returns COM status code.
     604 * @param   aPct     Where to store the rate.
     605 */
     606STDMETHODIMP MachineDebugger::COMGETTER(VirtualTimeRate) (ULONG *aPct)
     607{
     608    if (!aPct)
     609        return E_POINTER;
     610
     611    AutoCaller autoCaller (this);
     612    CheckComRCReturnRC (autoCaller.rc());
     613
     614    AutoReadLock alock (this);
     615
     616    Console::SafeVMPtrQuiet pVM (mParent);
     617
     618    if (pVM.isOk())
     619        *aPct = TMVirtualGetWarpDrive (pVM);
     620    else
     621        *aPct = 100;
     622
     623    return S_OK;
     624}
     625
     626/**
     627 * Returns the current virtual time rate.
     628 *
     629 * @returns COM status code.
     630 * @param   aPct     Where to store the rate.
     631 */
     632STDMETHODIMP MachineDebugger::COMSETTER(VirtualTimeRate) (ULONG aPct)
     633{
     634    if (aPct < 2 || aPct > 20000)
     635        return E_INVALIDARG;
     636
     637    AutoCaller autoCaller (this);
     638    CheckComRCReturnRC (autoCaller.rc());
     639
     640    AutoWriteLock alock (this);
     641
     642    if (queueSettings())
     643    {
     644        // queue the request
     645        mVirtualTimeRateQueued = aPct;
     646        return S_OK;
     647    }
     648
     649    Console::SafeVMPtr pVM (mParent);
     650    CheckComRCReturnRC (pVM.rc());
     651
     652    int vrc = TMVirtualSetWarpDrive (pVM, aPct);
     653    if (RT_FAILURE (vrc))
     654    {
     655        /** @todo handle error code. */
     656    }
     657
     658    return S_OK;
     659}
     660
     661/**
     662 * Hack for getting the VM handle.
     663 * This is only temporary (promise) while prototyping the debugger.
     664 *
     665 * @returns COM status code
     666 * @param   aVm      Where to store the vm handle.
     667 *                  Since there is no uintptr_t in COM, we're using the max integer.
     668 *                  (No, ULONG is not pointer sized!)
     669 */
     670STDMETHODIMP MachineDebugger::COMGETTER(VM) (ULONG64 *aVm)
     671{
     672    if (!aVm)
     673        return E_POINTER;
     674
     675    AutoCaller autoCaller (this);
     676    CheckComRCReturnRC (autoCaller.rc());
     677
     678    AutoReadLock alock (this);
     679
     680    Console::SafeVMPtr pVM (mParent);
     681    CheckComRCReturnRC (pVM.rc());
     682
     683    *aVm = (uintptr_t)pVM.raw();
     684
     685    /*
     686     *  Note: pVM protection provided by SafeVMPtr is no more effective
     687     *  after we return from this method.
     688     */
     689
     690    return S_OK;
     691}
     692
     693// IMachineDebugger methods
     694/////////////////////////////////////////////////////////////////////////////
     695
     696/**
    137697 * Resets VM statistics.
    138698 *
     
    140700 * @param   aPattern            The selection pattern. A bit similar to filename globbing.
    141701 */
    142 STDMETHODIMP MachineDebugger::ResetStats(INPTR BSTR aPattern)
    143 {
    144     Console::SafeVMPtrQuiet pVM (mParent);
    145     if (pVM.isOk())
    146         STAMR3Reset(pVM, Utf8Str(aPattern).raw());
     702STDMETHODIMP MachineDebugger::ResetStats (INPTR BSTR aPattern)
     703{
     704    Console::SafeVMPtrQuiet pVM (mParent);
     705
     706    if (pVM.isOk())
     707        STAMR3Reset (pVM, Utf8Str (aPattern).raw());
     708
    147709    return S_OK;
    148710}
     
    154716 * @param   aPattern            The selection pattern. A bit similar to filename globbing.
    155717 */
    156 STDMETHODIMP MachineDebugger::DumpStats(INPTR BSTR aPattern)
    157 {
    158     Console::SafeVMPtrQuiet pVM (mParent);
    159     if (pVM.isOk())
    160         STAMR3Dump(pVM, Utf8Str(aPattern).raw());
     718STDMETHODIMP MachineDebugger::DumpStats (INPTR BSTR aPattern)
     719{
     720    Console::SafeVMPtrQuiet pVM (mParent);
     721
     722    if (pVM.isOk())
     723        STAMR3Dump (pVM, Utf8Str (aPattern).raw());
     724
    161725    return S_OK;
    162726}
     
    170734 * @param   aStats              The XML document containing the statistics.
    171735 */
    172 STDMETHODIMP MachineDebugger::GetStats(INPTR BSTR aPattern, BOOL aWithDescriptions, BSTR *aStats)
    173 {
    174     Console::SafeVMPtrQuiet pVM (mParent);
     736STDMETHODIMP MachineDebugger::GetStats (INPTR BSTR aPattern, BOOL aWithDescriptions, BSTR *aStats)
     737{
     738    Console::SafeVMPtrQuiet pVM (mParent);
     739
    175740    if (!pVM.isOk())
    176741        return E_FAIL;
    177742
    178743    char *pszSnapshot;
    179     int vrc = STAMR3Snapshot(pVM, Utf8Str(aPattern).raw(), &pszSnapshot, NULL,
    180                              !!aWithDescriptions);
    181     if (RT_FAILURE(vrc))
     744    int vrc = STAMR3Snapshot (pVM, Utf8Str (aPattern).raw(), &pszSnapshot, NULL,
     745                              !!aWithDescriptions);
     746    if (RT_FAILURE (vrc))
    182747        return vrc == VERR_NO_MEMORY ? E_OUTOFMEMORY : E_FAIL;
    183748
     
    186751     * Until that's done, this method is kind of useless for debugger statistics GUI because
    187752     * of the amount statistics in a debug build. */
    188     Bstr(pszSnapshot).cloneTo(aStats);
    189 
    190     return S_OK;
    191 }
    192 
    193 /**
    194  * Returns the current recompile user mode code flag.
    195  *
    196  * @returns COM status code
    197  * @param   enabled address of result variable
    198  */
    199 STDMETHODIMP MachineDebugger::COMGETTER(RecompileUser)(BOOL *enabled)
    200 {
    201     if (!enabled)
    202         return E_POINTER;
    203     AutoWriteLock alock (this);
    204     CHECK_READY();
    205     Console::SafeVMPtrQuiet pVM (mParent);
    206     if (pVM.isOk())
    207         *enabled = !EMIsRawRing3Enabled(pVM.raw());
    208     else
    209         *enabled = false;
    210     return S_OK;
    211 }
    212 
    213 /**
    214  * Sets the recompile user mode code flag.
    215  *
    216  * @returns COM status
    217  * @param   enable new user mode code recompile flag.
    218  */
    219 STDMETHODIMP MachineDebugger::COMSETTER(RecompileUser)(BOOL enable)
    220 {
    221     LogFlowThisFunc (("enable=%d\n", enable));
    222 
    223     AutoWriteLock alock (this);
    224     CHECK_READY();
    225 
    226     if (!fFlushMode)
     753    Bstr (pszSnapshot).cloneTo (aStats);
     754
     755    return S_OK;
     756}
     757
     758
     759// public methods only for internal purposes
     760/////////////////////////////////////////////////////////////////////////////
     761
     762void MachineDebugger::flushQueuedSettings()
     763{
     764    mFlushMode = true;
     765    if (mSinglestepQueued != ~0)
     766    {
     767        COMSETTER(Singlestep) (mSinglestepQueued);
     768        mSinglestepQueued = ~0;
     769    }
     770    if (mRecompileUserQueued != ~0)
     771    {
     772        COMSETTER(RecompileUser) (mRecompileUserQueued);
     773        mRecompileUserQueued = ~0;
     774    }
     775    if (mRecompileSupervisorQueued != ~0)
     776    {
     777        COMSETTER(RecompileSupervisor) (mRecompileSupervisorQueued);
     778        mRecompileSupervisorQueued = ~0;
     779    }
     780    if (mPatmEnabledQueued != ~0)
     781    {
     782        COMSETTER(PATMEnabled) (mPatmEnabledQueued);
     783        mPatmEnabledQueued = ~0;
     784    }
     785    if (mCsamEnabledQueued != ~0)
     786    {
     787        COMSETTER(CSAMEnabled) (mCsamEnabledQueued);
     788        mCsamEnabledQueued = ~0;
     789    }
     790    if (mLogEnabledQueued != ~0)
     791    {
     792        COMSETTER(LogEnabled) (mLogEnabledQueued);
     793        mLogEnabledQueued = ~0;
     794    }
     795    if (mVirtualTimeRateQueued != ~(uint32_t)0)
     796    {
     797        COMSETTER(VirtualTimeRate) (mVirtualTimeRateQueued);
     798        mVirtualTimeRateQueued = ~0;
     799    }
     800    mFlushMode = false;
     801}
     802
     803// private methods
     804/////////////////////////////////////////////////////////////////////////////
     805
     806bool MachineDebugger::queueSettings() const
     807{
     808    if (!mFlushMode)
    227809    {
    228810        // check if the machine is running
    229811        MachineState_T machineState;
    230         mParent->COMGETTER(State)(&machineState);
     812        mParent->COMGETTER(State) (&machineState);
    231813        if (    machineState != MachineState_Running
    232814            &&  machineState != MachineState_Paused
    233815            &&  machineState != MachineState_Stuck)
    234         {
    235816            // queue the request
    236             recompileUserQueued = enable;
    237             return S_OK;
    238         }
    239     }
    240 
    241     Console::SafeVMPtr pVM (mParent);
    242     CheckComRCReturnRC (pVM.rc());
    243 
    244     PVMREQ pReq;
    245     EMRAWMODE rawModeFlag = enable ? EMRAW_RING3_DISABLE : EMRAW_RING3_ENABLE;
    246     int rcVBox = VMR3ReqCall(pVM, VMREQDEST_ANY, &pReq, RT_INDEFINITE_WAIT,
    247                              (PFNRT)EMR3RawSetMode, 2, pVM.raw(), rawModeFlag);
    248     if (RT_SUCCESS(rcVBox))
    249     {
    250         rcVBox = pReq->iStatus;
    251         VMR3ReqFree(pReq);
    252     }
    253 
    254     if (RT_SUCCESS(rcVBox))
    255         return S_OK;
    256 
    257     AssertMsgFailed(("Could not set raw mode flags to %d, rcVBox = %Rrc\n",
    258                      rawModeFlag, rcVBox));
    259     return E_FAIL;
    260 }
    261 
    262 /**
    263  * Returns the current recompile supervisor code flag.
    264  *
    265  * @returns COM status code
    266  * @param   enabled address of result variable
    267  */
    268 STDMETHODIMP MachineDebugger::COMGETTER(RecompileSupervisor)(BOOL *enabled)
    269 {
    270     if (!enabled)
    271         return E_POINTER;
    272     AutoWriteLock alock (this);
    273     CHECK_READY();
    274     Console::SafeVMPtrQuiet pVM (mParent);
    275     if (pVM.isOk())
    276         *enabled = !EMIsRawRing0Enabled(pVM.raw());
    277     else
    278         *enabled = false;
    279     return S_OK;
    280 }
    281 
    282 /**
    283  * Sets the new recompile supervisor code flag.
    284  *
    285  * @returns COM status code
    286  * @param   enable new recompile supervisor code flag
    287  */
    288 STDMETHODIMP MachineDebugger::COMSETTER(RecompileSupervisor)(BOOL enable)
    289 {
    290     LogFlowThisFunc (("enable=%d\n", enable));
    291 
    292     AutoWriteLock alock (this);
    293     CHECK_READY();
    294 
    295     if (!fFlushMode)
    296     {
    297         // check if the machine is running
    298         MachineState_T machineState;
    299         mParent->COMGETTER(State)(&machineState);
    300         if (    machineState != MachineState_Running
    301             &&  machineState != MachineState_Paused
    302             &&  machineState != MachineState_Stuck)
    303         {
    304             // queue the request
    305             recompileSupervisorQueued = enable;
    306             return S_OK;
    307         }
    308     }
    309 
    310     Console::SafeVMPtr pVM (mParent);
    311     CheckComRCReturnRC (pVM.rc());
    312 
    313     PVMREQ pReq;
    314     EMRAWMODE rawModeFlag = enable ? EMRAW_RING0_DISABLE : EMRAW_RING0_ENABLE;
    315     int rcVBox = VMR3ReqCall(pVM, VMREQDEST_ANY, &pReq, RT_INDEFINITE_WAIT,
    316                              (PFNRT)EMR3RawSetMode, 2, pVM.raw(), rawModeFlag);
    317     if (RT_SUCCESS(rcVBox))
    318     {
    319         rcVBox = pReq->iStatus;
    320         VMR3ReqFree(pReq);
    321     }
    322 
    323     if (RT_SUCCESS(rcVBox))
    324         return S_OK;
    325 
    326     AssertMsgFailed(("Could not set raw mode flags to %d, rcVBox = %Rrc\n",
    327                      rawModeFlag, rcVBox));
    328     return E_FAIL;
    329 }
    330 
    331 /**
    332  * Returns the current patch manager enabled flag.
    333  *
    334  * @returns COM status code
    335  * @param   enabled address of result variable
    336  */
    337 STDMETHODIMP MachineDebugger::COMGETTER(PATMEnabled)(BOOL *enabled)
    338 {
    339     if (!enabled)
    340         return E_POINTER;
    341     AutoWriteLock alock (this);
    342     CHECK_READY();
    343     Console::SafeVMPtrQuiet pVM (mParent);
    344     if (pVM.isOk())
    345         *enabled = PATMIsEnabled(pVM.raw());
    346     else
    347         *enabled = false;
    348     return S_OK;
    349 }
    350 
    351 /**
    352  * Set the new patch manager enabled flag.
    353  *
    354  * @returns COM status code
    355  * @param   new patch manager enabled flag
    356  */
    357 STDMETHODIMP MachineDebugger::COMSETTER(PATMEnabled)(BOOL enable)
    358 {
    359     AutoWriteLock alock (this);
    360     CHECK_READY();
    361     LogFlowThisFunc (("enable=%d\n", enable));
    362 
    363     if (!fFlushMode)
    364     {
    365         // check if the machine is running
    366         MachineState_T machineState;
    367         mParent->COMGETTER(State)(&machineState);
    368         if (    machineState != MachineState_Running
    369             &&  machineState != MachineState_Paused
    370             &&  machineState != MachineState_Stuck)
    371         {
    372             // queue the request
    373             patmEnabledQueued = enable;
    374             return S_OK;
    375         }
    376     }
    377 
    378     Console::SafeVMPtr pVM (mParent);
    379     CheckComRCReturnRC (pVM.rc());
    380 
    381     PATMR3AllowPatching(pVM, enable);
    382     return S_OK;
    383 }
    384 
    385 /**
    386  * Set the new patch manager enabled flag.
    387  *
    388  * @returns COM status code
    389  * @param   new patch manager enabled flag
    390  */
    391 STDMETHODIMP MachineDebugger::InjectNMI()
    392 {
    393     AutoWriteLock alock (this);
    394     CHECK_READY();
    395     LogFlowThisFunc ((""));
    396 
    397     Console::SafeVMPtr pVM (mParent);
    398     CheckComRCReturnRC (pVM.rc());
    399 
    400     HWACCMR3InjectNMI(pVM);
    401     return S_OK;
    402 }
    403 
    404 /**
    405  * Returns the current code scanner enabled flag.
    406  *
    407  * @returns COM status code
    408  * @param   enabled address of result variable
    409  */
    410 STDMETHODIMP MachineDebugger::COMGETTER(CSAMEnabled)(BOOL *enabled)
    411 {
    412     if (!enabled)
    413         return E_POINTER;
    414     AutoWriteLock alock (this);
    415     CHECK_READY();
    416     Console::SafeVMPtrQuiet pVM (mParent);
    417     if (pVM.isOk())
    418         *enabled = CSAMIsEnabled(pVM.raw());
    419     else
    420         *enabled = false;
    421     return S_OK;
    422 }
    423 
    424 /**
    425  * Sets the new code scanner enabled flag.
    426  *
    427  * @returns COM status code
    428  * @param   enable new code scanner enabled flag
    429  */
    430 STDMETHODIMP MachineDebugger::COMSETTER(CSAMEnabled)(BOOL enable)
    431 {
    432     AutoWriteLock alock (this);
    433     CHECK_READY();
    434     LogFlowThisFunc (("enable=%d\n", enable));
    435 
    436     if (!fFlushMode)
    437     {
    438         // check if the machine is running
    439         MachineState_T machineState;
    440         mParent->COMGETTER(State)(&machineState);
    441         if (    machineState != MachineState_Running
    442             &&  machineState != MachineState_Paused
    443             &&  machineState != MachineState_Stuck)
    444         {
    445             // queue the request
    446             csamEnabledQueued = enable;
    447             return S_OK;
    448         }
    449     }
    450 
    451     Console::SafeVMPtr pVM (mParent);
    452     CheckComRCReturnRC (pVM.rc());
    453 
    454     int vrc;
    455     if (enable)
    456         vrc = CSAMEnableScanning(pVM);
    457     else
    458         vrc = CSAMDisableScanning(pVM);
    459     if (RT_FAILURE(vrc))
    460     {
    461         /** @todo handle error case */
    462     }
    463     return S_OK;
    464 }
    465 
    466 /**
    467  * Returns the log enabled / disabled status.
    468  *
    469  * @returns COM status code
    470  * @param   aEnabled     address of result variable
    471  */
    472 STDMETHODIMP MachineDebugger::COMGETTER(LogEnabled)(BOOL *aEnabled)
    473 {
    474     if (!aEnabled)
    475         return E_POINTER;
    476     AutoWriteLock alock(this);
    477     CHECK_READY();
    478 #ifdef LOG_ENABLED
    479     PRTLOGGER pLogInstance = RTLogDefaultInstance();
    480     *aEnabled = pLogInstance && !(pLogInstance->fFlags & RTLOGFLAGS_DISABLED);
    481 #else
    482     *aEnabled = false;
    483 #endif
    484     return S_OK;
    485 }
    486 
    487 /**
    488  * Enables or disables logging.
    489  *
    490  * @returns COM status code
    491  * @param   aEnabled    The new code log state.
    492  */
    493 STDMETHODIMP MachineDebugger::COMSETTER(LogEnabled)(BOOL aEnabled)
    494 {
    495     AutoWriteLock alock(this);
    496 
    497     CHECK_READY();
    498     LogFlowThisFunc (("aEnabled=%d\n", aEnabled));
    499 
    500     if (!fFlushMode)
    501     {
    502         // check if the machine is running
    503         MachineState_T machineState;
    504         mParent->COMGETTER(State)(&machineState);
    505         if (    machineState != MachineState_Running
    506             &&  machineState != MachineState_Paused
    507             &&  machineState != MachineState_Stuck)
    508         {
    509             // queue the request
    510             mLogEnabledQueued = aEnabled;
    511             return S_OK;
    512         }
    513     }
    514 
    515     Console::SafeVMPtr pVM (mParent);
    516     CheckComRCReturnRC (pVM.rc());
    517 
    518 #ifdef LOG_ENABLED
    519     int vrc = DBGFR3LogModifyFlags(pVM, aEnabled ? "enabled" : "disabled");
    520     if (RT_FAILURE(vrc))
    521     {
    522         /** @todo handle error code. */
    523     }
    524 #endif
    525     return S_OK;
    526 }
    527 
    528 /**
    529  * Returns the current hardware virtualization flag.
    530  *
    531  * @returns COM status code
    532  * @param   enabled address of result variable
    533  */
    534 STDMETHODIMP MachineDebugger::COMGETTER(HWVirtExEnabled)(BOOL *enabled)
    535 {
    536     if (!enabled)
    537         return E_POINTER;
    538 
    539     AutoWriteLock alock (this);
    540     CHECK_READY();
    541 
    542     Console::SafeVMPtrQuiet pVM (mParent);
    543     if (pVM.isOk())
    544         *enabled = HWACCMIsEnabled(pVM.raw());
    545     else
    546         *enabled = false;
    547     return S_OK;
    548 }
    549 
    550 /**
    551  * Returns the current nested paging flag.
    552  *
    553  * @returns COM status code
    554  * @param   enabled address of result variable
    555  */
    556 STDMETHODIMP MachineDebugger::COMGETTER(HWVirtExNestedPagingEnabled)(BOOL *enabled)
    557 {
    558     if (!enabled)
    559         return E_POINTER;
    560 
    561     AutoWriteLock alock (this);
    562     CHECK_READY();
    563 
    564     Console::SafeVMPtrQuiet pVM (mParent);
    565     if (pVM.isOk())
    566         *enabled = HWACCMR3IsNestedPagingActive(pVM.raw());
    567     else
    568         *enabled = false;
    569     return S_OK;
    570 }
    571 
    572 /**
    573  * Returns the current VPID flag.
    574  *
    575  * @returns COM status code
    576  * @param   enabled address of result variable
    577  */
    578 STDMETHODIMP MachineDebugger::COMGETTER(HWVirtExVPIDEnabled)(BOOL *enabled)
    579 {
    580     if (!enabled)
    581         return E_POINTER;
    582 
    583     AutoWriteLock alock (this);
    584     CHECK_READY();
    585 
    586     Console::SafeVMPtrQuiet pVM (mParent);
    587     if (pVM.isOk())
    588         *enabled = HWACCMR3IsVPIDActive(pVM.raw());
    589     else
    590         *enabled = false;
    591     return S_OK;
    592 }
    593 
    594 /**
    595  * Returns the current PAE flag.
    596  *
    597  * @returns COM status code
    598  * @param   enabled address of result variable
    599  */
    600 STDMETHODIMP MachineDebugger::COMGETTER(PAEEnabled)(BOOL *enabled)
    601 {
    602     if (!enabled)
    603         return E_POINTER;
    604 
    605     AutoWriteLock alock (this);
    606     CHECK_READY();
    607 
    608     Console::SafeVMPtrQuiet pVM (mParent);
    609     if (pVM.isOk())
    610     {
    611         uint64_t cr4 = CPUMGetGuestCR4(pVM.raw());
    612         *enabled = !!(cr4 & X86_CR4_PAE);
    613     }
    614     else
    615         *enabled = false;
    616     return S_OK;
    617 }
    618 
    619 /**
    620  * Returns the current virtual time rate.
    621  *
    622  * @returns COM status code.
    623  * @param   pct     Where to store the rate.
    624  */
    625 STDMETHODIMP MachineDebugger::COMGETTER(VirtualTimeRate)(ULONG *pct)
    626 {
    627     if (!pct)
    628         return E_POINTER;
    629 
    630     AutoWriteLock alock (this);
    631     CHECK_READY();
    632 
    633     Console::SafeVMPtrQuiet pVM (mParent);
    634     if (pVM.isOk())
    635         *pct = TMVirtualGetWarpDrive(pVM);
    636     else
    637         *pct = 100;
    638     return S_OK;
    639 }
    640 
    641 /**
    642  * Returns the current virtual time rate.
    643  *
    644  * @returns COM status code.
    645  * @param   pct     Where to store the rate.
    646  */
    647 STDMETHODIMP MachineDebugger::COMSETTER(VirtualTimeRate)(ULONG pct)
    648 {
    649     if (pct < 2 || pct > 20000)
    650         return E_INVALIDARG;
    651 
    652     AutoWriteLock alock (this);
    653     CHECK_READY();
    654 
    655     if (!fFlushMode)
    656     {
    657         // check if the machine is running
    658         MachineState_T machineState;
    659         mParent->COMGETTER(State)(&machineState);
    660         if (    machineState != MachineState_Running
    661             &&  machineState != MachineState_Paused
    662             &&  machineState != MachineState_Stuck)
    663         {
    664             // queue the request
    665             mVirtualTimeRateQueued = pct;
    666             return S_OK;
    667         }
    668     }
    669 
    670     Console::SafeVMPtr pVM (mParent);
    671     CheckComRCReturnRC (pVM.rc());
    672 
    673     int vrc = TMVirtualSetWarpDrive(pVM, pct);
    674     if (RT_FAILURE(vrc))
    675     {
    676         /** @todo handle error code. */
    677     }
    678     return S_OK;
    679 }
    680 
    681 /**
    682  * Hack for getting the VM handle.
    683  * This is only temporary (promise) while prototyping the debugger.
    684  *
    685  * @returns COM status code
    686  * @param   vm      Where to store the vm handle.
    687  *                  Since there is no uintptr_t in COM, we're using the max integer.
    688  *                  (No, ULONG is not pointer sized!)
    689  */
    690 STDMETHODIMP MachineDebugger::COMGETTER(VM)(ULONG64 *vm)
    691 {
    692     if (!vm)
    693         return E_POINTER;
    694 
    695     AutoWriteLock alock (this);
    696     CHECK_READY();
    697 
    698     Console::SafeVMPtr pVM (mParent);
    699     CheckComRCReturnRC (pVM.rc());
    700 
    701     *vm = (uintptr_t)pVM.raw();
    702 
    703     /*
    704      *  Note: pVM protection provided by SafeVMPtr is no more effective
    705      *  after we return from this method.
    706      */
    707 
    708     return S_OK;
    709 }
    710 
    711 //
    712 // "public-private" methods
    713 //
    714 void MachineDebugger::flushQueuedSettings()
    715 {
    716     fFlushMode = true;
    717     if (singlestepQueued != ~0)
    718     {
    719         COMSETTER(Singlestep)(singlestepQueued);
    720         singlestepQueued = ~0;
    721     }
    722     if (recompileUserQueued != ~0)
    723     {
    724         COMSETTER(RecompileUser)(recompileUserQueued);
    725         recompileUserQueued = ~0;
    726     }
    727     if (recompileSupervisorQueued != ~0)
    728     {
    729         COMSETTER(RecompileSupervisor)(recompileSupervisorQueued);
    730         recompileSupervisorQueued = ~0;
    731     }
    732     if (patmEnabledQueued != ~0)
    733     {
    734         COMSETTER(PATMEnabled)(patmEnabledQueued);
    735         patmEnabledQueued = ~0;
    736     }
    737     if (csamEnabledQueued != ~0)
    738     {
    739         COMSETTER(CSAMEnabled)(csamEnabledQueued);
    740         csamEnabledQueued = ~0;
    741     }
    742     if (mLogEnabledQueued != ~0)
    743     {
    744         COMSETTER(LogEnabled)(mLogEnabledQueued);
    745         mLogEnabledQueued = ~0;
    746     }
    747     if (mVirtualTimeRateQueued != ~(uint32_t)0)
    748     {
    749         COMSETTER(VirtualTimeRate)(mVirtualTimeRateQueued);
    750         mVirtualTimeRateQueued = ~0;
    751     }
    752     fFlushMode = false;
    753 }
    754 
    755 //
    756 // private methods
    757 //
     817            return true;
     818    }
     819    return false;
     820}
     821
  • trunk/src/VBox/Main/include/MachineDebuggerImpl.h

    r14107 r14627  
     1/* $Id$ */
     2
    13/** @file
    24 *
     
    57
    68/*
    7  * Copyright (C) 2006-2007 Sun Microsystems, Inc.
     9 * Copyright (C) 2006-2008 Sun Microsystems, Inc.
    810 *
    911 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    2830
    2931class ATL_NO_VTABLE MachineDebugger :
     32    public VirtualBoxBaseNEXT,
    3033    public VirtualBoxSupportErrorInfoImpl <MachineDebugger, IMachineDebugger>,
    3134    public VirtualBoxSupportTranslation <MachineDebugger>,
    32     public VirtualBoxBase,
    3335    public IMachineDebugger
    3436{
    3537public:
    3638
    37     DECLARE_NOT_AGGREGATABLE(MachineDebugger)
     39    VIRTUALBOXBASE_ADD_ERRORINFO_SUPPORT (MachineDebugger)
     40
     41    DECLARE_NOT_AGGREGATABLE (MachineDebugger)
    3842
    3943    DECLARE_PROTECT_FINAL_CONSTRUCT()
    4044
    4145    BEGIN_COM_MAP(MachineDebugger)
    42         COM_INTERFACE_ENTRY(ISupportErrorInfo)
    43         COM_INTERFACE_ENTRY(IMachineDebugger)
     46        COM_INTERFACE_ENTRY (ISupportErrorInfo)
     47        COM_INTERFACE_ENTRY (IMachineDebugger)
    4448    END_COM_MAP()
    4549
    4650    NS_DECL_ISUPPORTS
     51
     52    DECLARE_EMPTY_CTOR_DTOR (MachineDebugger)
    4753
    4854    HRESULT FinalConstruct();
     
    5056
    5157    // public initializer/uninitializer for internal purposes only
    52     HRESULT init (Console *parent);
     58    HRESULT init (Console *aParent);
    5359    void uninit();
    5460
    5561    // IMachineDebugger properties
    56     STDMETHOD(COMGETTER(Singlestep))(BOOL *enabled);
    57     STDMETHOD(COMSETTER(Singlestep))(BOOL enable);
    58     STDMETHOD(COMGETTER(RecompileUser))(BOOL *enabled);
    59     STDMETHOD(COMSETTER(RecompileUser))(BOOL enable);
    60     STDMETHOD(COMGETTER(RecompileSupervisor))(BOOL *enabled);
    61     STDMETHOD(COMSETTER(RecompileSupervisor))(BOOL enable);
    62     STDMETHOD(COMGETTER(PATMEnabled))(BOOL *enabled);
    63     STDMETHOD(COMSETTER(PATMEnabled))(BOOL enable);
    64     STDMETHOD(COMGETTER(CSAMEnabled))(BOOL *enabled);
    65     STDMETHOD(COMSETTER(CSAMEnabled))(BOOL enable);
    66     STDMETHOD(COMGETTER(LogEnabled))(BOOL *enabled);
    67     STDMETHOD(COMSETTER(LogEnabled))(BOOL enable);
    68     STDMETHOD(COMGETTER(HWVirtExEnabled))(BOOL *enabled);
    69     STDMETHOD(COMGETTER(HWVirtExNestedPagingEnabled))(BOOL *enabled);
    70     STDMETHOD(COMGETTER(HWVirtExVPIDEnabled))(BOOL *enabled);
    71     STDMETHOD(COMGETTER(PAEEnabled))(BOOL *enabled);
    72     STDMETHOD(COMGETTER(VirtualTimeRate))(ULONG *pct);
    73     STDMETHOD(COMSETTER(VirtualTimeRate))(ULONG pct);
    74     STDMETHOD(COMGETTER(VM))(ULONG64 *vm);
     62    STDMETHOD(COMGETTER(Singlestep)) (BOOL *aEnabled);
     63    STDMETHOD(COMSETTER(Singlestep)) (BOOL aEnable);
     64    STDMETHOD(COMGETTER(RecompileUser)) (BOOL *aEnabled);
     65    STDMETHOD(COMSETTER(RecompileUser)) (BOOL aEnable);
     66    STDMETHOD(COMGETTER(RecompileSupervisor)) (BOOL *aEnabled);
     67    STDMETHOD(COMSETTER(RecompileSupervisor)) (BOOL aEnable);
     68    STDMETHOD(COMGETTER(PATMEnabled)) (BOOL *aEnabled);
     69    STDMETHOD(COMSETTER(PATMEnabled)) (BOOL aEnable);
     70    STDMETHOD(COMGETTER(CSAMEnabled)) (BOOL *aEnabled);
     71    STDMETHOD(COMSETTER(CSAMEnabled)) (BOOL aEnable);
     72    STDMETHOD(COMGETTER(LogEnabled)) (BOOL *aEnabled);
     73    STDMETHOD(COMSETTER(LogEnabled)) (BOOL aEnable);
     74    STDMETHOD(COMGETTER(HWVirtExEnabled)) (BOOL *aEnabled);
     75    STDMETHOD(COMGETTER(HWVirtExNestedPagingEnabled)) (BOOL *aEnabled);
     76    STDMETHOD(COMGETTER(HWVirtExVPIDEnabled)) (BOOL *aEnabled);
     77    STDMETHOD(COMGETTER(PAEEnabled)) (BOOL *aEnabled);
     78    STDMETHOD(COMGETTER(VirtualTimeRate)) (ULONG *aPct);
     79    STDMETHOD(COMSETTER(VirtualTimeRate)) (ULONG aPct);
     80    STDMETHOD(COMGETTER(VM)) (ULONG64 *aVm);
    7581    STDMETHOD(InjectNMI)();
    7682
    7783    // IMachineDebugger methods
    78     STDMETHOD(ResetStats(INPTR BSTR aPattern));
    79     STDMETHOD(DumpStats(INPTR BSTR aPattern));
    80     STDMETHOD(GetStats(INPTR BSTR aPattern, BOOL aWithDescriptions, BSTR *aStats));
     84    STDMETHOD(ResetStats (INPTR BSTR aPattern));
     85    STDMETHOD(DumpStats (INPTR BSTR aPattern));
     86    STDMETHOD(GetStats (INPTR BSTR aPattern, BOOL aWithDescriptions, BSTR *aStats));
    8187
    8288
     
    8894
    8995private:
    90     ComObjPtr <Console, ComWeakRef> mParent;
     96    // private methods
     97    bool queueSettings() const;
     98
     99    const ComObjPtr <Console, ComWeakRef> mParent;
    91100    // flags whether settings have been queued because
    92101    // they could not be sent to the VM (not up yet, etc.)
    93     int singlestepQueued;
    94     int recompileUserQueued;
    95     int recompileSupervisorQueued;
    96     int patmEnabledQueued;
    97     int csamEnabledQueued;
     102    int mSinglestepQueued;
     103    int mRecompileUserQueued;
     104    int mRecompileSupervisorQueued;
     105    int mPatmEnabledQueued;
     106    int mCsamEnabledQueued;
    98107    int mLogEnabledQueued;
    99108    uint32_t mVirtualTimeRateQueued;
    100     bool fFlushMode;
     109    bool mFlushMode;
    101110};
    102111
    103 #endif // ____H_MACHINEDEBUGGER
     112#endif /* ____H_MACHINEDEBUGGER */
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