Bugzilla – Bug 643371
Rethrow doesn't preserve stack trace
Last modified: 2010-10-04 00:11:10 UTC
User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0) The methods above the frame that rethrows aren't included in the frames constructed from an exception object: new System.Diagnostics.StackTrace(e) This bug prevents IronRuby to display correct stack traces. Reproducible: Always Steps to Reproduce: Compile and run the following code: using System; using System.Runtime.CompilerServices; public class C { public static void Main() { Baz(); } [MethodImpl(MethodImplOptions.NoInlining)] public static void Baz() { try { Bar(); } catch(Exception e) { Console.WriteLine(new System.Diagnostics.StackTrace(e)); } } [MethodImpl(MethodImplOptions.NoInlining)] public static void Bar() { try { Foo(); } catch { throw; } } [MethodImpl(MethodImplOptions.NoInlining)] public static void Foo() { throw new Exception(); } } Actual Results: at C.Foo() at C.Bar() Expected Results: at C.Foo() at C.Bar() at C.Baz()
duplicate. *** This bug has been marked as a duplicate of bug 322158 ***