diff options
author | Miguel de Icaza <miguel@gnome.org> | 2005-02-02 02:04:19 +0300 |
---|---|---|
committer | Miguel de Icaza <miguel@gnome.org> | 2005-02-02 02:04:19 +0300 |
commit | e04c2c9215e74c08ac86ec0b27b0db763cfb1c11 (patch) | |
tree | 0796f6f8aaeb353cb048d726c2f1b8efa514c6fa /mcs | |
parent | 507730706de9318b3200962b6693ea32bdc8428a (diff) |
Patch from Ben S. Stahlhood II (bstahlhood@gmail.com)
svn path=/trunk/mcs/; revision=39955
Diffstat (limited to 'mcs')
-rw-r--r-- | mcs/class/corlib/System.Diagnostics/DebuggableAttribute.cs | 91 |
1 files changed, 62 insertions, 29 deletions
diff --git a/mcs/class/corlib/System.Diagnostics/DebuggableAttribute.cs b/mcs/class/corlib/System.Diagnostics/DebuggableAttribute.cs index e47548a095e..5f88b85111e 100644 --- a/mcs/class/corlib/System.Diagnostics/DebuggableAttribute.cs +++ b/mcs/class/corlib/System.Diagnostics/DebuggableAttribute.cs @@ -1,11 +1,12 @@ -//
-// System.Collections.DebuggableAttribute.cs
-//
-// Author:
-// Nick Drochak II (ndrochak@gol.com)
-//
-// (C) 2001 Nick Drochak II
-//
+// +// System.Collections.DebuggableAttribute.cs +// +// Author: +// Nick Drochak II (ndrochak@gol.com) +// Ben S. Stahlhood II (bstahlhood@gmail.com) +// +// (C) 2001 Nick Drochak II +// // // Copyright (C) 2004 Novell, Inc (http://www.novell.com) @@ -29,24 +30,56 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -
-namespace System.Diagnostics {
-
- [AttributeUsage (AttributeTargets.Assembly | AttributeTargets.Module)]
- public sealed class DebuggableAttribute : System.Attribute {
-
- private bool JITTrackingEnabledFlag;
- private bool JITOptimizerDisabledFlag;
-
- // Public Instance Constructors
- public DebuggableAttribute(bool isJITTrackingEnabled, bool isJITOptimizerDisabled) {
- JITTrackingEnabledFlag = isJITTrackingEnabled;
- JITOptimizerDisabledFlag = isJITOptimizerDisabled;
- }
-
- // Public Instance Properties
- public bool IsJITTrackingEnabled { get { return JITTrackingEnabledFlag; } }
-
- public bool IsJITOptimizerDisabled { get { return JITOptimizerDisabledFlag; } }
- }
-}
+ +namespace System.Diagnostics { + + [AttributeUsage (AttributeTargets.Assembly | AttributeTargets.Module)] + public sealed class DebuggableAttribute : System.Attribute { + + private bool JITTrackingEnabledFlag; + private bool JITOptimizerDisabledFlag; +#if NET_2_0 + [Flags] + public enum DebuggingModes { + // Fields + None = 0, + Default = 1, + IgnoreSymbolStoreSequencePoints = 2, + EnableEditAndContinue = 4, + DisableOptimizations = 256 + } + + private DebuggingModes debuggingModes = DebuggingModes.None; +#endif + + // Public Instance Constructors + public DebuggableAttribute(bool isJITTrackingEnabled, bool isJITOptimizerDisabled) + { + JITTrackingEnabledFlag = isJITTrackingEnabled; + JITOptimizerDisabledFlag = isJITOptimizerDisabled; + +#if NET_2_0 + if (isJITTrackingEnabled) + debuggingModes |= DebuggingModes.Default; + + if (isJITOptimizerDisabled) + debuggingModes |= DebuggingModes.DisableOptimizations; +#endif + } + +#if NET_2_0 + public DebuggableAttribute(DebuggingModes modes) + { + debuggingModes = modes; + JITTrackingEnabledFlag = (debuggingModes & DebuggingModes.Default) != 0; + JITOptimizerDisabledFlag = (debuggingModes & DebuggingModes.DisableOptimizations) != 0; + } +#endif + + + // Public Instance Properties + public bool IsJITTrackingEnabled { get { return JITTrackingEnabledFlag; } } + + public bool IsJITOptimizerDisabled { get { return JITOptimizerDisabledFlag; } } + } +} |