Skip to main content

[archive] DEBUG Mode

  • January 25, 2008
  • 5 replies
  • 0 views

[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.

5 replies

[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.
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.

[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.
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.

[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.
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.

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

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