[bcl] Remove NET_4_0 defines from class libs.
[mono.git] / mcs / class / corlib / System.Diagnostics / StackFrame.cs
index 38796071e9e90aaabb7bb192b8e1c160120f2e82..b6aa9d2ed3ec6e8ce49863ad12ee196739e5d8de 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,7 @@ 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 MethodBase methodBase;
                private string fileName;
                private int lineNumber;
@@ -140,26 +142,12 @@ namespace System.Diagnostics {
                        string filename = "<filename unknown>";
                        if (fileName == null)
                                return filename;
-#if !NET_2_1 || MONOTOUCH
                        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 +166,11 @@ namespace System.Diagnostics {
                         return nativeOffset;                        
                 }
 
+               internal long GetMethodAddress ()
+               {
+                       return methodAddress;
+               }
+
                internal string GetInternalMethodName ()
                {
                        return internalMethodName;