Highlighted
Absent Member.
Absent Member.
1446 views

CBL_DEBUGBREAK

Jump to solution

I build my Visual Cobol application in Release mode and when i'm running it from command line the execution stops on a cbl_debugbreak call asking me if i want to start the debugger. Is it possible to disable that call when i'm running a release build?

0 Likes
1 Solution

Accepted Solutions
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: CBL_DEBUGBREAK

Jump to solution

You can also use conditional compilation so that the statement is included in the compile only if a particular constant is set in that configuration.

So if you used:

          display "in test"

      $if DEBUG = 1    

          call "CBL_DEBUGBREAK"

      $end    

          display "after break"

          accept any-key

          goback.

And in your Debug Configuration you added the directive:

CONSTANT DEBUG(1)

And in your Release Configuration you added the directive:

CONSTANT DEBUG(0)

Then the statements between the $if and the $end would only be compiled when the debug configuration was in effect.

View solution in original post

0 Likes
3 Replies
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: CBL_DEBUGBREAK

Jump to solution

Hello,

The only way to disable the prompt to debug is to remove the actual CALL "CBL_DEBUGBREAK" in your program source or the compiler directive INITCALL(CBL_DEBUGBREAK). You will then need to rebuild your application.

Regards,

–Ғɑɳօ
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: CBL_DEBUGBREAK

Jump to solution

Another way to proceed is to execute CBL_DEBUGBREAK based on the value/presence of a environment variable.
Something like IF pgm_DEBUG=Y[es]  then execute CBL_DEBUGBREAK.  

0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: CBL_DEBUGBREAK

Jump to solution

You can also use conditional compilation so that the statement is included in the compile only if a particular constant is set in that configuration.

So if you used:

          display "in test"

      $if DEBUG = 1    

          call "CBL_DEBUGBREAK"

      $end    

          display "after break"

          accept any-key

          goback.

And in your Debug Configuration you added the directive:

CONSTANT DEBUG(1)

And in your Release Configuration you added the directive:

CONSTANT DEBUG(0)

Then the statements between the $if and the $end would only be compiled when the debug configuration was in effect.

View solution in original post

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.