All pastes #106295 Raw Edit

radekp

public text v1 · immutable
#106295 ·published 2006-07-30 07:32 UTC
rendered paste body
/*
 * Get IL offset for the call frame up n slots.
 * Returns 0 if the function at that slot is not a jitted function.
 */
ILInt32 _ILJitGetILOffset(ILExecThread *thread, ILUInt32 skipFrames)
{
	ILJITCoder *jitCoder = (ILJITCoder *)(_ILExecThreadProcess(thread)->coder);
	jit_stack_trace_t stackTrace = jit_exception_get_stack_trace();
	ILInt32 result;

	if(jitCoder && stackTrace)
	{
		result = jit_stack_trace_get_offset(jitCoder->context, stackTrace, skipFrames);
		if(result == JIT_NO_OFFSET)
		{
			return -1;
		}
		else
		{
			return result;
		}
	}
	return -1;
}