Highlighted
Absent Member.
Absent Member.
403 views

[archive] DEBUG Mode

[Migrated content. Thread originally posted on 25 January 2008]

How can I determine if the runtime is in debug mode programmatically.
Wanting to be able to do something like this:

IF DEBUG-MODE
STOP "DEBUGGING"
END-IF.

But how can I determine that the runtime is in debug mode.
0 Likes
3 Replies
Highlighted
Absent Member.
Absent Member.

RE: [archive] DEBUG Mode

I do not think there is an internal runtime setting that will help you with this. You could examine the script that launched the appication to see if a -d was used, you could examine the directory to see if an adb file is being written to, or you could use an environment variable to set -d and inspect the environment variable.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] DEBUG Mode

I have already written a program (Delphi) that will call the compiler and runtime. I have already modified my program to use different ways of letting me in cobol programs if the cobol program is being run in debug mode.
At first i used cobol switches, tried to use -26 and in my cobol program use special-names to say the switch-26 was debug mode. But i soon found out the by running the program with -26 that it thinks that i have turned on switches 2 & 6. Well some of our programs already use switch-2 and switch-6 so i ran into a problem pretty quick. so i then modified my delphi program to set an environment variable "debug-mode=1" seems to work ok. it just everytime i want to use this little feature for debugging purposes I have to add more code to the program than say the switches. Which is why i was really HOPING for some other method of detecting debug-mode on the runtime.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] DEBUG Mode

Instead of "-26" use "-# Z" in the command line to set the switch.
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.