DebuggableAttribute.DebuggingModes Enum

Definition

Specifies the debugging mode for the just-in-time (JIT) compiler.

This enumeration supports a bitwise combination of its member values.

C#
[System.Flags]
public enum DebuggableAttribute.DebuggingModes
C#
[System.Flags]
[System.Runtime.InteropServices.ComVisible(true)]
public enum DebuggableAttribute.DebuggingModes
Inheritance
DebuggableAttribute.DebuggingModes
Attributes

Fields

Name Value Description
None 0

Starting with the .NET Framework version 2.0, JIT tracking information is always generated, and this flag has the same effect as Default, except that it sets the IsJITTrackingEnabled property to false. However, because JIT tracking is always enabled, the property value is ignored in version 2.0 or later.

Note that, unlike the DisableOptimizations flag, the None flag cannot be used to disable JIT optimizations.

Default 1

Instructs the just-in-time (JIT) compiler to use its default behavior, which includes enabling optimizations, disabling Edit and Continue support, and using symbol store sequence points if present. Starting with the .NET Framework version 2.0, JIT tracking information, the Microsoft intermediate language (MSIL) offset to the native-code offset within a method, is always generated.

IgnoreSymbolStoreSequencePoints 2

Use the implicit MSIL sequence points, not the program database (PDB) sequence points. The symbolic information normally includes at least one Microsoft intermediate language (MSIL) offset for each source line. When the just-in-time (JIT) compiler is about to compile a method, it asks the profiling services for a list of MSIL offsets that should be preserved. These MSIL offsets are called sequence points.

EnableEditAndContinue 4

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.

DisableOptimizations 256

Disable optimizations performed by the compiler to make your output file smaller, faster, and more efficient. Optimizations result in code rearrangement in the output file, which can make debugging difficult. Typically optimization should be disabled while debugging. In versions 2.0 or later, combine this value with Default (Default | DisableOptimizations) to enable JIT tracking and disable optimizations.

Remarks

The DebuggableAttribute.DebuggingModes enumeration specifies how the runtime is to track information important to the debugger during code generation. This information helps the debugger provide a rich debugging experience. Unlike the .NET Framework version 1.1, versions 2.0 or later do not allow you to turn off tracking by the just-in-time (JIT) compiler. JIT tracking is always enabled for debuggable files. In version 2.0 and later, the enumeration values have the following effect.

Debugging mode Result
None Tracking on, JIT optimizations enabled
Default Tracking on, JIT optimizations enabled
DisableOptimizations Tracking on, JIT optimizations enabled
Default | DisableOptimizations Tracking on, JIT optimizations disabled

Sequence points are used to indicate locations in the Microsoft intermediate language (MSIL) code that a debugger user expects to be able to refer to uniquely, such as for setting a breakpoint. The JIT compiler ensures it does not compile the MSIL at two different sequence points into a single native instruction. By default, the JIT compiler examines the symbol store in the program database (PDB) file for a list of additional sequence points. However, loading the PDB file requires that the file be available and has a negative performance impact. Starting with version 2.0, compilers can emit "implicit sequence points" in the MSIL code stream through the use of MSIL "nop" instructions. Such compilers should set the IgnoreSymbolStoreSequencePoints flag to notify the common language runtime to not load the PDB file.

Note

This enumeration is primarily used by language developers. It is generally not used in application development. Development environments use DebuggableAttribute.DebuggingModes based on compiler parameters such as /debug and /optimize.

Applies to

Product Versions
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 2.0, 2.1
UWP 10.0