Click here to Skip to main content
15,886,858 members
Articles / Desktop Programming / ATL

Function Call Tracing in JScript

Rate me:
Please Sign up or sign in to vote.
4.58/5 (18 votes)
3 Jul 2007CPOL15 min read 53.8K   6.4K   49  
Comprehensive JScript function call tracing without code modification.
/***************************************************************************
*
*	File            : ScriptDebugEngine2.cpp
*	Author          : K. Skilling
*	Description     : These are just all the methods which delegate to the 
*					  original objects without modification.
*
*	Change History
*	---------------
*	KS	28/02/2006	CREATED
*****************************************************************************/
#include "stdafx.h"
#include "JScriptDebug.h"
#include "ScriptDebugEngine.h"

/////////////////////////////////////////////////////////////////////////////
// IActiveScript

STDMETHODIMP CScriptDebugEngine::GetScriptSite(
    REFIID riid,
    void  **ppvObject)
{
	return m_pEngine->GetScriptSite(riid,ppvObject);
};


STDMETHODIMP CScriptDebugEngine::SetScriptState( 
    SCRIPTSTATE ss)
{
	return m_pEngine->SetScriptState(ss);
};

STDMETHODIMP CScriptDebugEngine::GetScriptState( 
     SCRIPTSTATE  *pssState)
{
	return m_pEngine->GetScriptState(pssState);
};

STDMETHODIMP CScriptDebugEngine::Close(void)
{
	try{return m_pEngine->Close();}catch(...){}
	return E_FAIL;
}

STDMETHODIMP CScriptDebugEngine::AddNamedItem(
    LPCOLESTR pstrName,
    DWORD dwFlags)
{
	return m_pEngine->AddNamedItem(pstrName,dwFlags);
}

STDMETHODIMP CScriptDebugEngine::AddTypeLib( 
    REFGUID rguidTypeLib,
    DWORD dwMajor,
    DWORD dwMinor,
    DWORD dwFlags)
{
	return m_pEngine->AddTypeLib(
								rguidTypeLib,
								dwMajor,
								dwMinor,
								dwFlags);
}

STDMETHODIMP CScriptDebugEngine::GetScriptDispatch(
    LPCOLESTR pstrItemName,
     IDispatch  * *ppdisp)
{
	return m_pEngine->GetScriptDispatch(
									pstrItemName,
									ppdisp);
}

STDMETHODIMP CScriptDebugEngine::GetCurrentScriptThreadID( 
     SCRIPTTHREADID  *pstidThread)
{
	return m_pEngine->GetCurrentScriptThreadID(pstidThread);
}

STDMETHODIMP CScriptDebugEngine::GetScriptThreadID( 
    DWORD dwWin32ThreadId,
     SCRIPTTHREADID  *pstidThread)
{
	return m_pEngine->GetScriptThreadID(
									dwWin32ThreadId,
									pstidThread);

}

STDMETHODIMP CScriptDebugEngine::GetScriptThreadState( 
    SCRIPTTHREADID stidThread,
     SCRIPTTHREADSTATE  *pstsState)
{
	return m_pEngine->GetScriptThreadState(
										stidThread,
										pstsState);

}

STDMETHODIMP CScriptDebugEngine::InterruptScriptThread( 
    SCRIPTTHREADID stidThread,
    const EXCEPINFO  *pexcepinfo,
    DWORD dwFlags)
{
	return m_pEngine->InterruptScriptThread(
									stidThread,
									pexcepinfo,
									dwFlags);

}

STDMETHODIMP CScriptDebugEngine::Clone( 
    IActiveScript  * *ppscript)
{
	return m_pEngine->Clone(ppscript);
}

/////////////////////////////////////////////////////////////////////////////
//IActiveScriptParse

STDMETHODIMP CScriptDebugEngine::InitNew(void)
{
	return m_pEngineParse->InitNew();
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Web Developer
Switzerland Switzerland
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions