/// <summary> /// Builds backtrace for the exception if it wasn't built yet. /// Captures a full stack trace starting with the current frame and combines it with the trace of the exception. /// Called from compiled code. /// </summary> internal void CaptureExceptionTrace(RubyScope /*!*/ scope) { if (_backtrace == null) { StackTrace catchSiteTrace = RubyStackTraceBuilder.GetClrStackTrace(null); _backtrace = new RubyStackTraceBuilder(scope.RubyContext, _exception, catchSiteTrace, scope.InterpretedFrame != null).RubyTrace; DynamicSetBacktrace(scope.RubyContext, _backtrace); } }
/// <summary> /// Builds backtrace for the exception if it wasn't built yet. /// Captures a full stack trace starting with the current frame and combines it with the trace of the exception. /// Called from compiled code. /// </summary> internal void CaptureExceptionTrace(RubyScope /*!*/ scope) { if (_backtrace == null) { #if FEATURE_STACK_TRACE StackTrace catchSiteTrace = RubyStackTraceBuilder.GetClrStackTrace(null); _backtrace = new RubyStackTraceBuilder(scope.RubyContext, _exception, catchSiteTrace, scope.InterpretedFrame != null).RubyTrace; #else _backtrace = new RubyArray(); #endif DynamicSetBacktrace(scope.RubyContext, _backtrace); } }