MachineDebuggerImpl.cpp revision dc61e6a1868aeec0d6b981e824b5cd8bf32e6b42
45e9809aff7304721fddb95654901b32195c9c7avboxsync * VBox IMachineDebugger COM class implementation.
45e9809aff7304721fddb95654901b32195c9c7avboxsync * Copyright (C) 2006-2010 Oracle Corporation
45e9809aff7304721fddb95654901b32195c9c7avboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
45e9809aff7304721fddb95654901b32195c9c7avboxsync * available from http://www.virtualbox.org. This file is free software;
45e9809aff7304721fddb95654901b32195c9c7avboxsync * you can redistribute it and/or modify it under the terms of the GNU
45e9809aff7304721fddb95654901b32195c9c7avboxsync * General Public License (GPL) as published by the Free Software
45e9809aff7304721fddb95654901b32195c9c7avboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
45e9809aff7304721fddb95654901b32195c9c7avboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
45e9809aff7304721fddb95654901b32195c9c7avboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
#include "MachineDebuggerImpl.h"
#include "Global.h"
#include "ConsoleImpl.h"
#include "AutoCaller.h"
#include "Logging.h"
return BaseFinalConstruct();
uninit();
// public initializer/uninitializer for internal purposes only
mSinglestepQueued = ~0;
mRecompileUserQueued = ~0;
mPatmEnabledQueued = ~0;
mCsamEnabledQueued = ~0;
mLogEnabledQueued = ~0;
mVirtualTimeRateQueued = ~0;
mFlushMode = false;
return S_OK;
mFlushMode = false;
*aEnabled = false;
return S_OK;
if (queueSettings())
return hrc;
*aEnabled = false;
return S_OK;
if (queueSettings())
return hrc;
*aEnabled = false;
return S_OK;
if (queueSettings())
return S_OK;
return S_OK;
*aEnabled = false;
return S_OK;
if (queueSettings())
return S_OK;
int vrc;
if (aEnable)
return S_OK;
#ifdef LOG_ENABLED
*aEnabled = false;
return S_OK;
if (queueSettings())
return S_OK;
#ifdef LOG_ENABLED
return S_OK;
*aEnabled = false;
return S_OK;
*aEnabled = false;
return S_OK;
*aEnabled = false;
return S_OK;
return hrc;
return hrc;
*aEnabled = false;
return S_OK;
return S_OK;
return E_INVALIDARG;
if (queueSettings())
return S_OK;
return S_OK;
return S_OK;
return hrc;
STDMETHODIMP MachineDebugger::DumpHostProcessCore(IN_BSTR a_bstrFilename, IN_BSTR a_bstrCompression)
typedef struct MACHINEDEBUGGERINOFHLP
char *pszBuf;
bool fOutOfMemory;
static DECLCALLBACK(size_t) MachineDebuggerInfoOutput(void *pvArg, const char *pachChars, size_t cbChars)
return cbChars;
static DECLCALLBACK(void) MachineDebuggerInfoPrintfV(PCDBGFINFOHLP pHlp, const char *pszFormat, va_list va)
return E_OUTOFMEMORY;
return hrc;
return hrc;
STDMETHODIMP MachineDebugger::ReadPhysicalMemory(LONG64 a_Address, ULONG a_cbRead, ComSafeArrayOut(BYTE, a_abData))
STDMETHODIMP MachineDebugger::WritePhysicalMemory(LONG64 a_Address, ULONG a_cbRead, ComSafeArrayIn(BYTE, a_abData))
STDMETHODIMP MachineDebugger::ReadVirtualMemory(ULONG a_idCpu, LONG64 a_Address, ULONG a_cbRead, ComSafeArrayOut(BYTE, a_abData))
STDMETHODIMP MachineDebugger::WriteVirtualMemory(ULONG a_idCpu, LONG64 a_Address, ULONG a_cbRead, ComSafeArrayIn(BYTE, a_abData))
return hrc;
DECLINLINE(HRESULT) formatRegisterValue(Bstr *a_pbstr, PCDBGFREGVAL a_pValue, DBGFREGVALTYPE a_enmType)
return E_UNEXPECTED;
return S_OK;
return E_OUTOFMEMORY;
return hrc;
STDMETHODIMP MachineDebugger::GetRegisters(ULONG a_idCpu, ComSafeArrayOut(BSTR, a_bstrNames), ComSafeArrayOut(BSTR, a_bstrValues))
if (paRegs)
return hrc;
STDMETHODIMP MachineDebugger::SetRegisters(ULONG a_idCpu, ComSafeArrayIn(IN_BSTR, a_bstrNames), ComSafeArrayIn(IN_BSTR, a_bstrValues))
return S_OK;
return S_OK;
char *pszSnapshot;
return S_OK;
mFlushMode = true;
if (mSinglestepQueued != ~0)
mSinglestepQueued = ~0;
if (mRecompileUserQueued != ~0)
mRecompileUserQueued = ~0;
if (mRecompileSupervisorQueued != ~0)
if (mPatmEnabledQueued != ~0)
mPatmEnabledQueued = ~0;
if (mCsamEnabledQueued != ~0)
mCsamEnabledQueued = ~0;
if (mLogEnabledQueued != ~0)
mLogEnabledQueued = ~0;
mVirtualTimeRateQueued = ~0;
mFlushMode = false;
if (!mFlushMode)
switch (machineState)
case MachineState_Running:
case MachineState_Paused:
case MachineState_Stuck:
case MachineState_Teleporting: