Exemple #1
0
        public static global::Array <object> makeStack(global::System.Diagnostics.StackTrace s)
        {
            global::Array <object> stack = new global::Array <object>(new object[] {});

            {
                int _g1 = 0;
                int _g  = s.FrameCount;
                while ((_g1 < _g))
                {
                    int i = _g1++;
                    global::System.Diagnostics.StackFrame frame = s.GetFrame(((int)(i)));
                    global::System.Reflection.MethodBase  m     = frame.GetMethod();
                    if ((m == null))
                    {
                        continue;
                    }

                    global::haxe.StackItem method = global::haxe.StackItem.Method(((m as global::System.Reflection.MemberInfo).ReflectedType as global::System.Reflection.MemberInfo).ToString(), (m as global::System.Reflection.MemberInfo).Name);
                    string fileName   = frame.GetFileName();
                    int    lineNumber = frame.GetFileLineNumber();
                    if ((!(string.Equals(fileName, null)) || (lineNumber >= 0)))
                    {
                        stack.push(global::haxe.StackItem.FilePos(method, fileName, lineNumber));
                    }
                    else
                    {
                        stack.push(method);
                    }
                }
            }

            return(stack);
        }
Exemple #2
0
        public static global::Array <object> toHaxe(global::System.Diagnostics.StackTrace native, global::haxe.lang.Null <int> skip)
        {
                        #line 31 "/opt/haxe/std/cs/_std/haxe/NativeStackTrace.hx"
            int skip1 = ((!(skip.hasValue)) ? (0) : ((skip).@value));
            global::Array <object> stack = new global::Array <object>(new object[] {});
                        #line 33 "/opt/haxe/std/cs/_std/haxe/NativeStackTrace.hx"
            if ((native == null))
            {
                                #line 34 "/opt/haxe/std/cs/_std/haxe/NativeStackTrace.hx"
                return(stack);
            }

                        #line 36 "/opt/haxe/std/cs/_std/haxe/NativeStackTrace.hx"
            int cnt = 0;
            {
                                #line 37 "/opt/haxe/std/cs/_std/haxe/NativeStackTrace.hx"
                int _g = 0;
                                #line 37 "/opt/haxe/std/cs/_std/haxe/NativeStackTrace.hx"
                int _g1 = native.FrameCount;
                                #line 37 "/opt/haxe/std/cs/_std/haxe/NativeStackTrace.hx"
                while ((_g < _g1))
                {
                                        #line 37 "/opt/haxe/std/cs/_std/haxe/NativeStackTrace.hx"
                    int i = _g++;
                    global::System.Diagnostics.StackFrame frame = native.GetFrame(((int)(i)));
                                        #line 39 "/opt/haxe/std/cs/_std/haxe/NativeStackTrace.hx"
                    global::System.Reflection.MethodBase m = frame.GetMethod();
                                        #line 41 "/opt/haxe/std/cs/_std/haxe/NativeStackTrace.hx"
                    if ((m == null))
                    {
                                                #line 42 "/opt/haxe/std/cs/_std/haxe/NativeStackTrace.hx"
                        continue;
                    }

                                        #line 44 "/opt/haxe/std/cs/_std/haxe/NativeStackTrace.hx"
                    if ((skip1 > cnt++))
                    {
                                                #line 45 "/opt/haxe/std/cs/_std/haxe/NativeStackTrace.hx"
                        continue;
                    }

                                        #line 48 "/opt/haxe/std/cs/_std/haxe/NativeStackTrace.hx"
                    global::haxe.StackItem method = global::haxe.StackItem.Method(((m as global::System.Reflection.MemberInfo).ReflectedType as global::System.Reflection.MemberInfo).ToString(), (m as global::System.Reflection.MemberInfo).Name);
                                        #line 50 "/opt/haxe/std/cs/_std/haxe/NativeStackTrace.hx"
                    string fileName   = frame.GetFileName();
                    int    lineNumber = frame.GetFileLineNumber();
                                        #line 53 "/opt/haxe/std/cs/_std/haxe/NativeStackTrace.hx"
                    if (((fileName != null) || (lineNumber >= 0)))
                    {
                                                #line 54 "/opt/haxe/std/cs/_std/haxe/NativeStackTrace.hx"
                        stack.push(global::haxe.StackItem.FilePos(method, fileName, lineNumber, default(global::haxe.lang.Null <int>)));
                    }
                    else
                    {
                                                #line 56 "/opt/haxe/std/cs/_std/haxe/NativeStackTrace.hx"
                        stack.push(method);
                    }
                }
            }

                        #line 58 "/opt/haxe/std/cs/_std/haxe/NativeStackTrace.hx"
            return(stack);
        }