PslDebug--Run-Time Error Checking Variable
The PslDebug built-in local variable provides a run-time error checking and trace facility that detects a variety of common PSL coding errors. You can enable or disable run-time checking and/or tracing by equating PslDebug to a numeric value representing 1 or more of 16 error-checking flag bits. The trace data produced by the PslDebug trace flags is useful in debugging PSL programs during the initial stages of programming or as a pre-debug before calling the more powerful (and hence more time consuming) PSL debugger.
The general arrangement of the flags is as follows:
- error checking: 0-128
- tracing: 256-16384
The format of PslDebug within a PSL script is identical to that of any other PSL variable:
PslDebug = n;
where n is the sum of one or more of the values from the following table:
Value | Definition |
---|---|
PslDebug Enable All Error Checking and Tracing | |
-1 | enable all PSL run-time error checking and tracing functions |
PslDebug Enable/Disable All Error Checking | |
0 | disable all run-time error checking |
1 | enable all PSL run-time error checking |
Numeric Operation Warnings | |
2 | enable warnings when arithmetic operations involve NULL string operands. This check is a stylistic one used to verify that numeric variables are explicitly |
4 | enable warnings for arithmetic operations involving nonnumerical operands |
8 | enable warnings for illegal or undefined arithmetic operations |
Variable Initialization Warnings | |
16 | enable warnings for variables that were not explicitly initialized. This checks for variables that are used before being explicitly equated to a value. Variables are initialized to the NULL string by default. BMC Software recommends that you explicitly initialize all variables to a value (even the NULL string) as a matter of good programming style. |
Built-in Function Warnings | |
32 | enable warnings for PSL Version 2.0 built-in functions |
64 | enable warnings for PSL Version 3.0 built-in functions. This is a new error check for built-in functions that were not in PATROL Version 2.0. The errors detected include passing non-numeric arguments when a numeric value is required, passing a bad argument, or passing the wrong number of arguments to a printf() function. |
128 | not used |
PslDebug Enable All Tracing | |
256 | enable all PSL run-time tracing |
Function Tracing | |
512 | enable function call tracing. Function call tracing reports which functions are called but does not return information about the arguments. Function call tracing traces both user-defined and built-in functions. |
1024 | enable function argument tracing. Function argument tracing reports the arguments passed to all user-defined or built-in functions. Function argument tracing requires that function call tracing (PslDebug = 512) also be enabled; that is, PslDebug = 1536 for function argument tracing. |
2048 | enable function return value tracing. Function return value tracing reports the value returned by calls to all user-defined or built-in functions. |
Variable Tracing | |
4096 | enable variable assignment tracing |
8192 | enable errno tracing |
Lock Tracing | |
16384 | enable PSL lock tracing |
Migration Tracing | |
32768 | enable KM developers to know what features or notations will change in the future and write a forward compatible application. One example of this is pconfig migration tracing. |
You set multiple flag bits by equating PslDebug to the sum of their values. For example, PslDebug = 44 would enable the following flags:
- arithmetic operations involving nonnumeric operands (4)
- illegal or undefined arithmetic operations (8)
- PSL Version 2.0 built-in functions (32)
where the sum (4 + 8 + 32) is 44.
Comments
Log in or register to comment.