Source

gb_emulator / gb_debugger_msvs / engine.cpp

Full commit
/*  Copyright Š 2011 Chris Spencer <spencercw@gmail.com>

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */

#include "stdafx.h"

#include "engine.h"

#include "program.h"

// IDebugEngine2 methods

HRESULT CEngine::EnumPrograms(IEnumDebugPrograms2 ** /*ppEnum*/)
{
	return E_NOTIMPL;
}

HRESULT CEngine::Attach(
	IDebugProgram2 **rgpPrograms,
	IDebugProgramNode2 **rgpProgramNodes,
	DWORD celtPrograms,
	IDebugEventCallback2 *pCallback,
	ATTACH_REASON dwReason)
{
	for (DWORD i = 0; i != celtPrograms; ++i)
	{
		CProgram *program = NULL;
		if (rgpProgramNodes[i] != NULL &&
			rgpProgramNodes[i]->QueryInterface(IID_GbDebuggerMsvsProgram,
			reinterpret_cast<void **>(&program)) == S_OK)
		{
			program->EngineAttach(this, rgpPrograms[i], pCallback, dwReason);
			program->Release();
			return S_OK;
		}
	}

	return E_FAIL;
}

HRESULT CEngine::CreatePendingBreakpoint(
	IDebugBreakpointRequest2 *pBPRequest,
	IDebugPendingBreakpoint2 **ppPendingBP)
{
	return gProgram->CreatePendingBreakpoint(pBPRequest, ppPendingBP);
}

HRESULT CEngine::SetException(EXCEPTION_INFO * /*pException*/)
{
	return E_NOTIMPL;
}

HRESULT CEngine::RemoveSetException(EXCEPTION_INFO * /*pException*/)
{
	return E_NOTIMPL;
}

HRESULT CEngine::RemoveAllSetExceptions(const GUID & /*guidType*/)
{
	return E_NOTIMPL;
}

HRESULT CEngine::GetEngineId(GUID * /*pguidEngine*/)
{
	return E_NOTIMPL;
}

HRESULT CEngine::DestroyProgram(IDebugProgram2 * /*pProgram*/)
{
	return E_NOTIMPL;
}

HRESULT CEngine::ContinueFromSynchronousEvent(IDebugEvent2 *)
{
	PostThreadMessage(GetCurrentThreadId(), WM_CONTINUE_SYNC_EVENT, 0, 0);
	return S_OK;
}

HRESULT CEngine::SetLocale(WORD /*wLangID*/)
{
	return E_NOTIMPL;
}

HRESULT CEngine::SetRegistryRoot(const OLECHAR * /*pszRegistryRoot*/)
{
	return E_NOTIMPL;
}

HRESULT CEngine::SetMetric(const OLECHAR * /*pszMetric*/, VARIANT /*varValue*/)
{
	return E_NOTIMPL;
}

HRESULT CEngine::CauseBreak()
{
	return E_NOTIMPL;
}