![]() |
Software > OpenVMS Systems > Documentation > 82final > 4538 ![]() HP OpenVMS Systems Documentation |
![]() |
HP OpenVMS Debugger Manual
C.3.2 Constructs in Language and Address ExpressionsSupported constructs in language and address expressions for BASIC follow:
C.3.3 Data TypesSupported BASIC data types follow:
C.3.4 Compiling for DebuggingIf you make changes to a program in the BASIC environment and attempt to compile the program with the /DEBUG qualifier without first saving or replacing the program, BASIC signals the error "Unsaved changes, no source line debugging available." To avoid this problem, save or replace the program, and then recompile the program with the /DEBUG qualifier. C.3.5 ConstantsBASIC constants of the form [radix]"numeric-string"[type] (such as "12.34"GFLOAT) or the form n% (such as 25% for integer 25) are not supported in debugger expressions. C.3.6 Evaluating ExpressionsExpressions that overflow in the BASIC language do not necessarily overflow when evaluated by the debugger. The debugger tries to compute a numerically correct result, even when the BASIC rules call for overflows. This difference is particularly likely to affect DECIMAL computations. C.3.7 Line NumbersThe sequential line numbers that you refer to in a debugging session and that are displayed in a source code display are those generated by the compiler. When a BASIC program includes or appends code from another file, the included lines of code are also numbered in sequence by the compiler. C.3.8 Stepping into RoutinesThe STEP/INTO command is useful for examining external functions. However, if you use this command to stop execution at an internal subroutine or a DEF, the debugger initially steps into run-time library (RTL) routines, providing you with no useful information. In the following example, execution is paused at line 8, at a call to Print_routine:
A STEP/INTO command would cause the debugger to step into the relevant RTL code and would inform you that no source lines are available for display. On the other hand, a STEP command alone would cause the debugger to proceed directly to source line 9, past the call to Print_routine. To examine the source code of subroutines or DEF functions, set a breakpoint on the routine label (for example, enter the SET BREAK PRINT_ROUTINE command). You can then suspend execution exactly at the start of the routine (line 20, in this example) and then step directly into the code. C.3.9 Symbolic ReferencesAll variable and label names within a single BASIC program must be unique. Otherwise the debugger cannot resolve the symbol ambiguity. C.4 BLISSThe following subtopics describe debugger support for BLISS. C.4.1 Operators in Language ExpressionsSupported BLISS operators in language expressions include:
C.4.2 Constructs in Language and Address ExpressionsSupported constructs in language and address expressions for BLISS follow:
C.4.3 Data TypesSupported BLISS data types follow:
C.5 CThe following subtopics describe debugger support for C. C.5.1 Operators in Language ExpressionsSupported C operators in language expressions include:
Because the exclamation point (!) is an operator in C, it cannot be used as the comment delimiter. When the language is set to C, the debugger instead accepts /* as the comment delimiter. The comment continues to the end of the current line. (A matching */ is neither needed nor recognized.) To permit debugger log files to be used as debugger input, the debugger still recognizes an exclamation point (!) as a comment delimiter if it is the first nonspace character on a line. The debugger accepts the prefix asterisk (*) as an indirection operator in both C language expressions and debugger address expressions. In address expressions, prefix "*" is synonymous to prefix "." or "@" when the language is set to C. The debugger does not support any of the assignment operators in C (or any other language) in order to prevent unintended modifications to the program being debugged. Hence such operators as =, +=, -=, ++, and -- are not recognized. To alter the contents of a memory location, you must use an explicit DEPOSIT command. C.5.2 Constructs in Language and Address ExpressionsSupported constructs in language and address expressions for C follow:
C.5.3 Data TypesSupported C data types follow:
Floating-point numbers of type float may be represented by F_Floating or IEEE S_Floating, depending on compiler switches. Floating-point numbers of type double may be represented by IEEE T_Floating, D_Floating, or G_Floating, depending on compiler switches. C.5.4 Case SensitivitySymbol names are case sensitive for language C, meaning that uppercase and lowercase letters are treated as different characters. C.5.5 Static and Nonstatic VariablesVariables of the following storage classes are allocated statically: static, globaldef, globalref, and extern. Variables of the following storage classes are allocated nonstatically (on the stack or in registers): auto and register. Such variables can be accessed only when their defining routine is active (on the call stack). C.5.6 Scalar VariablesYou can specify scalar variables of any C type in debugger commands exactly as you would specify them in the source code of the program. The following paragraphs provide additional information about char variables and pointers. The char variables are interpreted by the debugger as byte integers, not ASCII characters. To display the contents of a char variable ch as a character, you must use the /ASCII qualifier:
You also must use the /ASCII qualifier when depositing into a char variable, to translate the byte integer into its ASCII equivalent. For example:
The following example shows use of pointer syntax with the EXAMINE command. Assume the following declarations and assignments:
C.5.7 ArraysThe debugger handles C arrays as for most other languages. That is, you can examine an entire array aggregate, a slice of an array, or an individual array element, using array syntax (for example EXAMINE arr[3]). And you can deposit into only one array element at a time. C.5.8 Character StringsCharacter strings are implemented in C as null-terminated ASCII strings (ASCIZ strings). To examine and deposit data in an entire string, use the /ASCIZ (or /AZ) qualifier so that the debugger can interpret the end of the string properly. You can examine and deposit individual characters in the string using the C array subscripting operators ([ ]). When you examine and deposit individual characters, use the /ASCII qualifier. Assume the following declarations and assignments:
The EXAMINE/AZ command displays the contents of the character string pointed to by *s and **t:
The DEPOSIT/AZ command deposits a new ASCIZ string in the variable pointed to by *s . The EXAMINE/AZ command displays the new contents of the string:
You can use array subscripting to examine individual characters in the string and deposit new ASCII values at specific locations within the string. When accessing individual members of a string, use the /ASCII qualifier. A subsequent EXAMINE/AZ command shows the entire string containing the deposited value:
|