I am playing with IE's JavaScript Chakra engine.
I have downloaded example code from MSDN and I am trying to figure out how to get the function source when I have just function IDand script ID.
I start profiling my js script and from profiler (IActiveScriptProfilerCallback2
) output I can see what functions are compiled, called...
For example callback for FunctionCompiled
looks like this. I get function id and script id, even function name, but I can't figure out how to find function source code.
HRESULT Profiler::FunctionCompiled(PROFILER_TOKEN functionId, PROFILER_TOKEN scriptId, const wchar_t *pwszFunctionName, const wchar_t *pwszFunctionNameHint, IUnknown *pIDebugDocumentContext)
{
fwprintf(stdout, L"Profiler::FunctionCompiled: 0x%lx, 0x%lx, %s, %s\n", scriptId, functionId, pwszFunctionName, pwszFunctionNameHint);
return S_OK;
}