Merge pull request #2819 from BrzVlad/fix-major-log
[mono.git] / mcs / class / corlib / System.Diagnostics / StackFrame.cs
index 8d9c83f7368a390dda37f18202c0542be5e9605e..702cd540d976d92e34dbce66fc2e116a679f2603 100644 (file)
@@ -41,6 +41,7 @@ namespace System.Diagnostics {
        [Serializable]
        [ComVisible (true)]
        [MonoTODO ("Serialized objects are not compatible with MS.NET")]
+       [StructLayout (LayoutKind.Sequential)]
         public class StackFrame {
 
                 public const int OFFSET_UNKNOWN = -1;
@@ -48,6 +49,8 @@ namespace System.Diagnostics {
                #region Keep in sync with object-internals.h
                private int ilOffset = OFFSET_UNKNOWN;
                private int nativeOffset = OFFSET_UNKNOWN;
+               private long methodAddress;
+               private uint methodIndex;
                private MethodBase methodBase;
                private string fileName;
                private int lineNumber;
@@ -140,26 +143,12 @@ namespace System.Diagnostics {
                        string filename = "<filename unknown>";
                        if (fileName == null)
                                return filename;
-#if !MOONLIGHT
                        try {
                                filename = GetFileName ();
                        }
                        catch (SecurityException) {
                                // CAS check failure
                        }
-#else
-                       // Silverlight always return <filename unknown> but that's not very useful for debugging
-                       // OTOH we do not want to share any details about the original file system (even if they
-                       // are likely available in the debugging symbols files) from the browser's plugin (but
-                       // compiling stuff from smcs is fine since it's outside the sandbox)
-                       try {
-                               if (SecurityManager.SecurityEnabled)
-                                       filename = Path.GetFileName (fileName);
-                       }
-                       catch (ArgumentException) {
-                               // e.g. invalid chars in filename
-                       }
-#endif
                        return filename;
                }
                 
@@ -178,6 +167,16 @@ namespace System.Diagnostics {
                         return nativeOffset;                        
                 }
 
+               internal long GetMethodAddress ()
+               {
+                       return methodAddress;
+               }
+
+               internal uint GetMethodIndex ()
+               {
+                       return methodIndex;
+               }
+
                internal string GetInternalMethodName ()
                {
                        return internalMethodName;