Exemplo n.º 1
0
        // -- Static --------------------------------------------------------------

        /// <summary>Get the LuaStackFrame from a .net StackFrame, if someone exists. In the other case, the return LuaStackFrame is only proxy to the orginal frame.</summary>
        /// <param name="frame">.net stackframe</param>
        /// <returns>LuaStackFrame</returns>
        public static LuaStackFrame GetStackFrame(StackFrame frame)
        {
            ILuaDebugInfo info = null;

            // find the lua debug info
            var method = frame.GetMethod();
            var chunk  = Lua.GetChunkFromMethodInfo(method);

            if (chunk != null)
            {
                info = chunk.GetDebugInfo(method, frame.GetILOffset());
            }

            return(new LuaStackFrame(frame, info));
        }         // func GetStackFrame
Exemplo n.º 2
0
 /// <summary></summary>
 /// <param name="frame"></param>
 /// <param name="info"></param>
 public LuaStackFrame(StackFrame frame, ILuaDebugInfo info)
 {
     this.frame = frame;
     this.info  = info;
 }         // ctor