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:
where n is the sum of one or more of the values from the following table:
|PslDebug Enable All Error Checking and Tracing|
enable all PSL run-time error checking and tracing functions
|PslDebug Enable/Disable All Error Checking|
|0||disable all run-time error checking|
enable all PSL run-time error checking
|Numeric Operation Warnings|
enable warnings when arithmetic operations involve NULL string operands. This check is a stylistic one used to verify that numeric variables are explicitly
enable warnings for arithmetic operations involving nonnumerical operands
enable warnings for illegal or undefined arithmetic operations
|Variable Initialization Warnings|
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|
enable warnings for PSL Version 2.0 built-in functions
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.
|PslDebug Enable All Tracing|
enable all PSL run-time tracing
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.
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.
enable function return value tracing. Function return value tracing reports the value returned by calls to all user-defined or built-in functions.
enable variable assignment tracing
enable errno tracing
enable PSL lock tracing
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.