Debugging .NET COBOL Scenarios

Visual COBOL uses the Visual Studio debug engine for debugging .NET COBOL applications.

Microsoft has included an enhanced .NET debug engine in recent versions of Visual Studio. Visual COBOL supports this new engine for .NET COBOL starting with Visual Studio 2017.

Note: You can switch to using the older .NET debug engine as follows:
  1. In Visual Studio, click Debug > Options > General.
  2. Check Use Managed Compatibility Mode.

Switching to the old engine disables some of the features that are only available in the newer Visual Studio debug engine, and queries of object references could fail unless the source code is recompiled.

The enhanced .NET debug engine in Visual Studio provides a number of features to use while debugging .NET COBOL, such as:

Compiler integration
Integrates directly with the COBOL compiler. This enables you to specify any valid COBOL expression when debugging. Visual Studio reports errors just the same as if the expression were coded directly into the COBOL source.
.NET backwards debugging
Records and traces the application's execution with the help of the IntelliTrace feature.
Note: Check the Visual Studio software requirements for this feature.
.NET remote debugging
Enables you to debug .NET COBOL applications deployed on a different machine.
Diagnostics Tools window
Provides more details on performance, IntelliTrace, as well as CPU and memory usage.
An expression evaluator for COBOL
This evaluates:
  • Complex expressions that include object references, object::[Property][Method].

    For example: type System.Environment::GetEnvironmentVariable("PATH")::Split(';').

  • Intrinsic expressions such as $ReturnValue or $exception.
Language integration
Provides improved integration when using other .NET languages such as C# or Visual Basic.
IntelliSense
IntelliSense provides suggestions inside the debugger windows such as Watch, Quick Watch, and Immediate.
Object tracking
Provides object tracking using Make Object Id
Performance tips (PerfTips)
PerfTips provide time-elapsed tips after the execution of every statement.
Enhanced object presentation
COBOL Objects are represented in the same manner as are C# and VisualBasic objects. Any COBOL-specific data format items are listed under an expansion node named COBOL data.
Enhanced HEX view
Provides enhanced hexadecimal viewing.

The following scenarios provide context for some of these features: