public static string GetStackTrace(Exception exception) { XaeiOSException xaeiosException = (XaeiOSException)exception; Continuation continuation = xaeiosException.ThrowContext; // TODO: Create StackWalker framework NativeArray<string> buffer = new NativeArray<string>(); while (continuation != null) { buffer.Push("at "); string methodName = RuntimeHelpers.GetMethodNameForStackTrace(continuation.Frame.Function); if (methodName == null) { methodName = "[External Code]"; // TODO: Provide something more descriptive. Maybe a code pointer? } buffer.Push(methodName); // TODO: Debug symbols should put C# line numbers here, rather than xaeios execution pointers // TODO: These execution pointers are wrong!!!, the execution pointer is set to the next execution pointer at the BEGINNING of the current execution block buffer.Push(":"); buffer.Push((continuation.ExecutionPointer).ToString()); buffer.Push("\n"); continuation = continuation.ParentContinuation; } return buffer.Join(""); }
internal static string NativeConcat(string[] objs) { NativeArray<string> sb = new NativeArray<string>(); for (int i = 0; i < objs.Length; i++) { sb.Push(objs[i]); } return sb.Join(""); }