Author: zoltan
Date: 2005-05-25 13:10:15 -0400 (Wed, 25 May 2005)
New Revision: 45007

Modified:
   trunk/mcs/class/corlib/System.Diagnostics/StackTrace.cs
Log:
Check-in missing changes.


Modified: trunk/mcs/class/corlib/System.Diagnostics/StackTrace.cs
===================================================================
--- trunk/mcs/class/corlib/System.Diagnostics/StackTrace.cs     2005-05-25 
16:44:13 UTC (rev 45006)
+++ trunk/mcs/class/corlib/System.Diagnostics/StackTrace.cs     2005-05-25 
17:10:15 UTC (rev 45007)
@@ -106,13 +106,35 @@
                }
 
                public StackTrace (Exception e, int skipFrames, bool 
needFileInfo)
+                       : this (e, skipFrames, needFileInfo, false)
                {
+               }
+
+               internal StackTrace (Exception e, int skipFrames, bool 
needFileInfo, bool returnNativeFrames)
+               {
                        if (e == null)
                                throw new ArgumentNullException ("e");
                        if (skipFrames < 0)
                                throw new ArgumentOutOfRangeException ("< 0", 
"skipFrames");
 
                        frames = get_trace (e, skipFrames, needFileInfo);
+
+                       if (!returnNativeFrames) {
+                               bool resize = false;
+                               for (int i = 0; i < frames.Length; ++i)
+                                       if (frames [i].GetMethod () == null)
+                                               resize = true;
+
+                               if (resize) {
+                                       ArrayList al = new ArrayList ();
+
+                                       for (int i = 0; i < frames.Length; ++i)
+                                               if (frames [i].GetMethod () != 
null)
+                                                       al.Add (frames [i]);
+
+                                       frames = (StackFrame [])al.ToArray 
(typeof (StackFrame));
+                               }
+                       }
                }
 
 #if ONLY_1_1

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to