NonDebuggable attribute

Version: Available or changed with runtime version 2.0.

Specifies that the annotated symbol will not be available to the debugger. E.g. methods can't be stepped through and variables can't be inspected.

Applies to

  • Variable
  • Method

Syntax

[NonDebuggable]

Example

Setting the attribute on a method. Each method must be marked with [NonDebuggable].

codeunit 50142 NoDebuggingOfMethod
{
    [NonDebuggable]
    local procedure MyProcedure()
    var
        myInt: Integer;
    begin
        //Make something happen
    end;
}

Setting the attribute on variables. Each variable must be marked as [NonDebuggable].

codeunit 50143 NoDebuggingOfVar 
{
    local procedure MyProcedure()
    var
        [NonDebuggable]
        myInt: Integer;
    begin
        //Make something happen
    end;
}

Remarks

Regardless of the resource exposure policy setting, methods and variables marked with the [NonDebuggable] attribute, will remain non-debuggable.

Note

During snapshot debugging, all frames are collected, also for non-debuggable methods, but no variables are shown in any of the snap points for methods that are decorated as non-debuggable.

For more information, see Resource Exposure Policy Setting.

AL method reference
Debugging