Skip to content

Commit a675639

Browse files
authored
Fix debugger attributes (#75)
1 parent 8c59a30 commit a675639

File tree

2 files changed

+45
-11
lines changed

2 files changed

+45
-11
lines changed

source/nanoFramework.CoreLibrary/CoreLibrary.nfproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -226,12 +226,12 @@
226226
<NFMDP_PE_ExcludeClassByName Include="System.Diagnostics.DebuggableAttribute">
227227
<InProject>false</InProject>
228228
</NFMDP_PE_ExcludeClassByName>
229-
<!--<NFMDP_PE_ExcludeClassByName Include="System.Diagnostics.DebuggerBrowsableAttribute">
229+
<NFMDP_PE_ExcludeClassByName Include="System.Diagnostics.DebuggerBrowsableAttribute">
230230
<InProject>false</InProject>
231-
</NFMDP_PE_ExcludeClassByName>-->
232-
<!--<NFMDP_PE_ExcludeClassByName Include="System.Diagnostics.DebuggerBrowsableState">
231+
</NFMDP_PE_ExcludeClassByName>
232+
<NFMDP_PE_ExcludeClassByName Include="System.Diagnostics.DebuggerBrowsableState">
233233
<InProject>false</InProject>
234-
</NFMDP_PE_ExcludeClassByName>-->
234+
</NFMDP_PE_ExcludeClassByName>
235235
<NFMDP_PE_ExcludeClassByName Include="System.Diagnostics.DebuggerDisplayAttribute">
236236
<InProject>false</InProject>
237237
</NFMDP_PE_ExcludeClassByName>

source/nanoFramework.CoreLibrary/System/Diagnostics/DebuggerAttributes.cs

Lines changed: 41 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,39 +9,65 @@ namespace System.Diagnostics
99
using System;
1010

1111
/// <summary>
12-
/// Instructs the debugger to step through the code instead of stepping into the code. This class cannot be inherited.
12+
/// Identifies a type or member that is not part of the user code for an application.
1313
/// </summary>
14+
/// <remarks>
15+
/// Designer provided types and members that are not part of the code specifically created by the user can complicate the debugging experience. This attribute suppresses the display of these adjunct types and members in the debugger window and automatically steps through, rather than into, designer provided code. When the debugger encounters this attribute when stepping through user code, the user experience is to not see the designer provided code and to step to the next user-supplied code statement.
16+
/// The debugger behaviour when the <see cref="DebuggerNonUserCodeAttribute"/> is present is similar to using a combination of the <see cref="DebuggerHiddenAttribute"/> attribute, which hides the code from the debugger, and the <see cref="DebuggerStepThroughAttribute"/> attribute, which tells the debugger to step through, rather than into, the code it is applied to.
17+
/// </remarks>
1418
[Serializable, AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Constructor, Inherited = false)]
1519
public sealed class DebuggerStepThroughAttribute : Attribute
1620
{
17-
//public DebuggerStepThroughAttribute() { }
21+
/// <summary>
22+
/// Initializes a new instance of the <see cref="DebuggerNonUserCodeAttribute"/> class.
23+
/// </summary>
24+
public DebuggerStepThroughAttribute() { }
1825
}
1926

2027
/// <summary>
2128
/// Indicates the code following the attribute is to be executed in run, not step, mode.
2229
/// </summary>
30+
/// <remarks>
31+
/// The <see cref="DebuggerStepperBoundaryAttribute"/> attribute is used as an escape from the effect of a <see cref="DebuggerNonUserCodeAttribute"/>. When executing within the boundaries of the <see cref="DebuggerNonUserCodeAttribute"/>, designer-provided code is executed as a step-through until the next user supplied code is encountered. When context switches are made on a thread, the next user-supplied code module stepped into may not relate to the code that was in the process of being debugged. To avoid this debugging experience, use the <see cref="DebuggerStepperBoundaryAttribute"/> to escape from stepping through code to running code. For example, in Visual Studio 2005, encountering a <see cref="DebuggerStepperBoundaryAttribute"/> while stepping through code using the F10 key (or Step Over command) has the same effect as pressing the F5 key or using the Start Debugging command.
32+
/// </remarks>
2333
[Serializable, AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor, Inherited = false)]
2434
public sealed class DebuggerStepperBoundaryAttribute : Attribute
2535
{
26-
//public DebuggerStepperBoundaryAttribute() { }
36+
/// <summary>
37+
/// Initializes a new instance of the <see cref="DebuggerStepperBoundaryAttribute"/> class.
38+
/// </summary>
39+
public DebuggerStepperBoundaryAttribute() { }
2740
}
2841

2942
/// <summary>
3043
/// Specifies the DebuggerHiddenAttribute. This class cannot be inherited.
3144
/// </summary>
45+
/// <remarks>
46+
/// The common language runtime attaches no semantics to this attribute. It is provided for use by source code debuggers. For example, the Visual Studio 2005 debugger does not stop in a method marked with this attribute and does not allow a breakpoint to be set in the method. Other debugger attributes recognized by the Visual Studio 2005 debugger are the <see cref="DebuggerNonUserCodeAttribute"/> and the <see cref="DebuggerStepThroughAttribute"/>.
47+
/// </remarks>
3248
[Serializable, AttributeUsage(AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Constructor, Inherited = false)]
3349
public sealed class DebuggerHiddenAttribute : Attribute
3450
{
35-
//public DebuggerHiddenAttribute() { }
51+
/// <summary>
52+
/// Initializes a new instance of the <see cref="DebuggerHiddenAttribute"/> class.
53+
/// </summary>
54+
public DebuggerHiddenAttribute() { }
3655
}
3756

3857
/// <summary>
3958
/// Identifies a type or member that is not part of the user code for an application.
4059
/// </summary>
60+
/// <remarks>
61+
/// Designer provided types and members that are not part of the code specifically created by the user can complicate the debugging experience. This attribute suppresses the display of these adjunct types and members in the debugger window and automatically steps through, rather than into, designer provided code. When the debugger encounters this attribute when stepping through user code, the user experience is to not see the designer provided code and to step to the next user-supplied code statement.
62+
/// The debugger behaviour when the <see cref="DebuggerNonUserCodeAttribute"/> is present is similar to using a combination of the <see cref="DebuggerHiddenAttribute"/> attribute, which hides the code from the debugger, and the <see cref="DebuggerStepThroughAttribute"/> attribute, which tells the debugger to step through, rather than into, the code it is applied to.
63+
/// </remarks>
4164
[Serializable, AttributeUsage(AttributeTargets.Class | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Constructor | AttributeTargets.Struct, Inherited = false)]
4265
public sealed class DebuggerNonUserCodeAttribute : Attribute
4366
{
44-
//public DebuggerNonUserCodeAttribute() { }
67+
/// <summary>
68+
/// Initializes a new instance of the <see cref="DebuggerNonUserCodeAttribute"/> class.
69+
/// </summary>
70+
public DebuggerNonUserCodeAttribute() { }
4571
}
4672

4773
// Attribute class used by the compiler to mark modules.
@@ -71,24 +97,28 @@ public enum DebuggingModes
7197
/// Note that, unlike the None flag, the None flag cannot be used to disable JIT optimizations.
7298
/// </summary>
7399
None = 0x0,
100+
74101
/// <summary>
75-
/// Instructs the just-in-time (JIT) compiler to use its default behavior, which includes enabling optimizations, disabling Edit and Continue support,
102+
/// Instructs the just-in-time (JIT) compiler to use its default behaviour, which includes enabling optimizations, disabling Edit and Continue support,
76103
/// and using symbol store sequence points if present. Starting with the .NET Framework version 2.0, JIT tracking information, the Microsoft intermediate
77104
/// language (MSIL) offset to the native-code offset within a method, is always generated.
78105
/// </summary>
79106
Default = 0x1,
107+
80108
/// <summary>
81109
/// Disable optimizations performed by the compiler to make your output file smaller, faster, and more efficient. Optimizations result in code rearrangement
82110
/// in the output file, which can make debugging difficult. Typically optimization should be disabled while debugging. In versions 2.0 or later, combine this
83111
/// value with Default (Default | DisableOptimizations) to enable JIT tracking and disable optimizations.
84112
/// </summary>
85113
DisableOptimizations = 0x100,
114+
86115
/// <summary>
87116
/// Use the implicit MSIL sequence points, not the program database (PDB) sequence points. The symbolic information normally includes at least one
88117
/// Microsoft intermediate language (MSIL) offset for each source line. When the just-in-time (JIT) compiler is about to compile a method, it asks
89118
/// the profiling services for a list of MSIL offsets that should be preserved. These MSIL offsets are called sequence points.
90119
/// </summary>
91120
IgnoreSymbolStoreSequencePoints = 0x2,
121+
92122
/// <summary>
93123
/// Enable edit and continue. Edit and continue enables you to make changes to your source code while your program is in break mode. The ability to edit and continue is compiler dependent.
94124
/// </summary>
@@ -173,6 +203,7 @@ public enum DebuggerBrowsableState
173203
public sealed class DebuggerBrowsableAttribute : Attribute
174204
{
175205
private readonly DebuggerBrowsableState _state;
206+
176207
/// <summary>
177208
/// Initializes a new instance of the DebuggerBrowsableAttribute class.
178209
/// </summary>
@@ -246,7 +277,9 @@ public Type Target
246277
{
247278
if (value == null) throw new ArgumentNullException("value");
248279

280+
#pragma warning disable S4275 // Getters and setters should access the expected fields
249281
_targetName = value.FullName + "," + value.Assembly.FullName;
282+
#pragma warning restore S4275 // Getters and setters should access the expected fields
250283
_target = value;
251284
}
252285

@@ -347,7 +380,9 @@ public Type Target
347380
{
348381
if (value == null) throw new ArgumentNullException("value");
349382

383+
#pragma warning disable S4275 // Getters and setters should access the expected fields
350384
_targetName = value.FullName + "," + value.Assembly.FullName;
385+
#pragma warning restore S4275 // Getters and setters should access the expected fields
351386
_target = value;
352387
}
353388

@@ -364,7 +399,6 @@ public string TargetTypeName
364399
{
365400
get { return _targetName; }
366401
set { _targetName = value; }
367-
368402
}
369403
}
370404
}

0 commit comments

Comments
 (0)