private unsafe static void PrintCallingStackToScreen (StackFrame [] callingStack) { for (int i = 2; i < callingStack.Length; i++) { TextMode.Write (" at "); if (callingStack [i] == null) { TextMode.WriteLine ("(unknown)"); } else { TextMode.Write (callingStack [i].MethodBoundary.Name); TextMode.Write (" [IP=0x"); TextMode.Write ((int) callingStack [i].IP, true); TextMode.Write (", BP=0x"); TextMode.Write ((int) callingStack [i].BP, true); TextMode.WriteLine ("]"); } } }
private unsafe static void PrintCallingStack (int skipFrames, StackFrame [] callingStack) { Debug.COM1.WriteLine ("============================================================="); Debug.COM1.WriteLine ("Stack Trace:"); for (int i = skipFrames; i < callingStack.Length; i++) { Debug.COM1.Write (" at "); if (callingStack [i] == null) { Debug.COM1.WriteLine ("(unknown)"); } else { Debug.COM1.Write (callingStack [i].MethodBoundary.Name); Debug.COM1.Write (" [IP=0x"); Debug.COM1.WriteNumber ((int) callingStack [i].IP, true); Debug.COM1.Write (", BP=0x"); Debug.COM1.WriteNumber ((int) callingStack [i].BP, true); Debug.COM1.WriteLine ("]"); } } }