System Debug Reference Manual HP 3000 MPE/iX Computer Systems Edition 3 Manufacturing Part Number: 32650-90888 E0300 U.S.A.
Notice The information contained in this document is subject to change without notice. Hewlett-Packard makes no warranty of any kind with regard to this material, including, but not limited to, the implied warranties of merchantability or fitness for a particular purpose. Hewlett-Packard shall not be liable for errors contained herein or for direct, indirect, special, incidental or consequential damages in connection with the furnishing or use of this material.
Contents 1. INTRODUCTION What Is Debug? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 2. User Interface Command Line Overview. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Data Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Literals . . . . . . . . . . . . . . . . . . . . . . . . .
Contents B (break). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .82 BD. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .92 BL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .95 CLOSEDUMP . . . . . . . . . . . . . . . . . . . . . .
Contents LOG . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196 6. System Debug Command Specifications M-X M (modify). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . MAC[RO]. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . MACD[EL] . . . . . . . . . . . .
Contents W (write). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .288 WHELP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .293 WHILE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .294 XL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Contents wJ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . wK . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . wL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . wM. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Contents func ltolog. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .405 func ltos . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .407 func macbody . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .408 func mapindex . . . . . . . . . . . . . . . . . . . . . . . . . . .
Contents func strrpt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . func strrtrim . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . func strup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . func strwrite . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Contents Operating SAT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .525 Operating Restrictions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .527 SAT Functions and Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .529 Literal Expressions (Match Exactly These Characters) . . . . . . . . . . . . . . . . . . . . . . .
Contents 11
Contents 12
Tables Table 2-1.. Type Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 Table 2-2.. Long Pointers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 Table 2-3.. Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 Table 2-4.. Indirection Operator Syntax. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Tables Table 10-19.. Derivation of the U32 Bit Pattern. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 476 Table 10-20.. Derivation of the USER Bit Pattern . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 478 Table 11-1.. Derivation of the SYS Bit Pattern. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 502 Table 11-2.. Derivation of the TRANS Bit Pattern . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 505 Table 11-3..
Preface The System Debug Reference Manual is written for the experienced programmer. It is a reference manual that provides information about System Debug. System Debug provides a family of low-level assembly language debugging tools for MPE/iX (for both Native and Compatibility Mode code): • Debug • Dump Analysis Tool (DAT) • Standalone Analysis Tool (SAT) A certain level of knowledge is required to utilize System Debug.
Chapter 10 Standalone Analysis Tool (SAT) contains information on the standalone Analysis Tool (SAT). Appendix A Patterns and Regular Expressions presents pattern matching and regular expressions. Appendix B Expression Diagrams contains System Debug expression diagrams. Appendix C Emulated/Translated CM Code describes CM Object Code Translation Appendix D Reserved Variables/Functions contains a full summary of all reserved variables and functions.
INTRODUCTION 1 INTRODUCTION System Debug provides a family of low-level assembly language debugging tools for MPE/iX: • Debug • Dump Analysis Tool (DAT) • Standalone Analysis Tool (SAT) A certain level of knowledge is required to utilize System Debug. Specifically, familiarity with assembly code, procedure calling conventions, parameter passing conventions, and HP 3000 and HP Precision Architecture is assumed.
INTRODUCTION What Is Debug? What Is Debug? Debug provides non-privileged and privileged users with both interactive and programmatic debugging facilities for examining their operating environments. Debug enables you to do the following: • Set, delete, and list breakpoints in a program. The program executes until a breakpoint is reached, then stops and passes control to the user. When you set breakpoints, you can specify a list of commands that automatically are executed when the breakpoint is hit.
INTRODUCTION What Is Debug? Refer to chapter 10 for detailed information regarding SAT. How to Debug This chapter gives a very brief introduction to debugging. For additional information, refer to the Programmer's Guide corresponding to the language compiler you are using. There you will find details and examples specific to your language. How to Debug a CM Program Compile and, using the Segmenter, prepare your program file and optional library files.
INTRODUCTION What Is Debug? ?PROGRAM+0004 etc. Single step a few times to advance the program through the stub and into the main body of the program. In summary, :RUN NMPROG;DEBUG Break at: [0] PROG 31.00022e7c $nmdebug > won $nmdebug > s $nmdebug > s ?PROGRAM You are now ready to debug your program (set breakpoints, define macros, turn on the windows, and so forth).
User Interface Command Line Overview 2 User Interface The System Debug user interface is command oriented. That is, all requests for System Debug to perform some operation must be expressed as commands. Normally, commands are read either from the standard input device ($STDIN) in the case of DAT, or from the session LDEV using low-level I/O routines in the case of Debug. But commands may also be read from command files, sometimes known as use files, stored on disk.
User Interface Command Line Overview Another possibility for this is dat. The prompt can be changed with the ENV command as follows: $10 ($42) nmdebug > env prompt "mode ' > '" nm > Command names can be entered in either upper- or lowercase and may be followed by their parameters, separated from one another by either blanks or commas. The specifications of individual commands may also describe special parameters that are also accepted.
User Interface Data Types {$1} multi > wl "parm is:" p1; {$1} multi > var curbias = p1+bias} $nmdebug > Data Types Several data types are supported by System Debug. This section introduces each of the types by giving the mnemonics by which they are known, along with a description of the data which they represent. Integer Types Three sizes of signed and unsigned integers are supported: S16 Signed 16-bit integer. U16 Unsigned 16-bit integer. S32 Signed 32-bit integer. U32 Unsigned 32-bit integer.
User Interface Data Types The most frequently used pointer types are long pointer (LPTR) and short pointer (SPTR). An LPTR is simply a pair of 32-bit numbers separated by a dot, sometimes called a dotted pair. What the two numbers actually mean is unspecified by the type. Instead, the context in which the LPTR is used determines the meaning. An SPTR is just one 32-bit number, and it is often thought of as being the low-order (rightmost) part of an LPTR.
User Interface Data Types Logical System Library Segments +-------+ | SYS 0 | | | +-------+ | SYS 1 | | | +-------+ | SYS 2 | | | +-------+ | | | | +-------+ | SYS n | | | +-------+ -----> --+ | | | | | +--> Logical Group Library Segments +-------+ | GRP 0 | | | +-------+ | GRP 1 | | | +-------+ | GRP 2 | | | +-------+ | GRP 3 | | | +-------+ +--> | | --+ Absolute CST Segments Absolute CSTX Segments +--------+ | CST 1 | | sys 0 | +--------+ | CST 2 | | sys 5 | +--------+ | CST 3 | | sys 11 | +-----
User Interface Data Types Native Mode Pointers An LPTR in NM is usually a sid.offset virtual address. As such, NM LPTRs are unambiguous, even without some context of use. However, it is still useful to tag NM long pointers to code by using a type that expresses the code's logical origin. Thus, the following logical code pointer types are available for NM code addresses: PROG Program file long pointer. GRP Group library file long pointer. PUB Public library file long pointer.
User Interface Data Types The type tables below give the names of the type classes and show which elementary types belong to them. Table 2-1. Type Table Class Type INT S16 Signed 16-bit integer. INT U16 Unsigned 16-bit integer. INT S32 Signed 32-bit integer. INT U32 Unsigned 32-bit integer. INT S64 Signed 64-bit integer. BOOL BOOL Boolean. STR STR Variable-length character string. PTR SPTR Short pointer (offset). PTR Long pointer subclass. See table below.
User Interface Literals Literals Literals represent specific values of one of the data types supported by System Debug. This section explains how to construct and interpret literals. Numeric Literals Numeric literals are a sequence of digits that are valid in the indicated radix. If the digits are not preceded by one of the base prefix characters, %, #, or $, the current input base is assumed.
User Interface Operators Long pointer literals of type LPTR are entered as a pair of (32-bit) numbers separated by a dot, forming the so-called dotted pair. Long pointer literals are entered in the form sid.offset. When the offset part exceeds 32 bits, the type of the literal becomes EADDR. Examples are: $c0002040 short pointer literal 3f.
User Interface Operators Operators are classified as arithmetic, Boolean, relational, address, and concatenation. A particular operator symbol may occur in more than one class of operators. For example, the symbol '+' is an arithmetic operator representing numeric addition, as well as string concatenation. The table below summarizes the System Debug supported operators by operator class, and lists the possible operand and operator result types. The following subsections discuss the operators in detail.
User Interface Operators 0 <= i MOD j < j. The operation i MOD j, where j <= 0, is illegal. Unary minus is also allowed, but note that the - operator must precede any base prefix character for numeric literals. This means that -#32767 is allowed, but #-32767 is not. Arithmetic operands are restricted to the classes INT and PTR. In general, the types of the operands determine the result type of an arithmetic operation.
User Interface Operators with pointer/integer arithmetic, only the low-order 30 bits of a short pointer's offset contribute to the operation. The result is placed back in the same bits of the larger of the two operands, when they differ in size, which determines the result type. Note that if the two pointers are logical, their types must be identical due to the space ID check mentioned above. Boolean Operators The Boolean operators are AND, OR, and NOT.
User Interface Operators operand type. BAND, BOR, and BNOT These operators perform the indicated logical operation bit-by-bit on their operand(s), which are treated as unsigned integers of the appropriate size. When the sizes of the operands differ, they are aligned at the rightmost bits, with the smaller operand extended on the left with zeros.
User Interface Operators 0.0 = sptr(0) a.0 = sptr(0) TRUE FALSE String comparisons are performed character by character, using the order defined by the ASCII collating sequence. If the two strings are not the same length, but are equal up to the length of the shorter one, the shorter string is considered to be less than the other.
User Interface Operators Table 2-4. Indirection Operator Syntax Indirection Default Alignment Return Type [S[offset]] S16 2 bytes [P[offset]] S16 2 bytes [DST[dst.offset]] S16 2 bytes [CST[cst.offset]] S16 2 bytes [CSTX[cstx.offset]] S16 2 bytes [CMLOG[lcptr]] S16 2 bytes Address specifications for the indirection operator contain an address mode keyword. All address modes can be used in both NM and CM. The default address mode is VIRT (NM virtual address).
User Interface Operators NOTE Nesting of indirection operators uses a significant amount of stack space. A stack overflow could occur if the user's stack is small and a large number of nested indirection operators are used. Table 2-5. Indirection Operator Examples Indirection Operator Examples: 36 $nmdebug > w1 [r25] $400c6bd0 Contents of virtual address, contained in register R25. $nmdebug > w1 [400c6bd0] $3f Contents of virtual address, specified as a short pointer.
User Interface Expressions Table 2-5. Indirection Operator Examples Indirection Operator Examples: $cmdebug > w1 [DST 22.203] %20377 Contents of data segment 22 offset 203. $cmdebug > w1 [S-2] %0 Contents of S-2. $cmdebug > w1 [cmlog fopen+3] %213442 Contents of the instruction found at CM logical code address FOPEN+3. $nmdebug > w1 [cst 12.432] $6 Contents of code segment 12 offset 432. $nmdebug > w1 [cst %12.%432] $6 Same as above but from NM instead of CM. $nmdebug > w1 [virt CSTVA(%12.
User Interface Operator Precedence Expression operands may be literals, variables, functions, macros, and symbolic procedure names, each of which denotes a value of some type. Examples of valid expressions are: $12 Simple numeric literal pc + 4 Predefined variable FOPEN + 12 Symbolic procedure name [dst 2.104] Indirection - contents of DST 2.
User Interface Variables Variables System Debug provides variables in which values may be stored for use as operands in expressions. Variable names must begin with an alphabetic character, which may be followed by any combination of alphanumeric, apostrophe ('), underscore (_), or dollar sign ($) characters. Variable names are case insensitive and may not exceed 32 characters. System Debug supports two levels of variable scoping: global and local.
User Interface Environment Variables Environment Variables System Debug provides a large collection of predefined environment variables, the names of which are reserved and may not be replaced by user-defined variables with the VAR and LOC commands. Several environment variables provide access to the current System Debug execution environment. Examples of these variables include the current input radix and the prompt string.
User Interface Procedure Name: Symbols $nmdebug > mac formattable (entry=1) { ... } Reference to macros as functions in expressions look exactly like references to predefined functions: $nmdebug > wl double (1) $2 $nmdebug > wl double (double (1)) $4 $nmdebug > Macro parameters may be defined as being either required or optional (as indicated by the presence of default parameter values in the macro definition).
User Interface Procedure Name: Symbols $nmdebug > wl FOPEN SYS $a.345498 $nmdebug > In the above example, since no System Debug variable named FOPEN was found, the expression evaluator searched for the symbol in the currently loaded program file and libraries, finding it in NL.PUB.SYS. Procedure name symbols stand for slightly different locations depending on the mode of System Debug. In CM, they stand for the starting address of the code bodies that they name. In NM, they stand for the entry address.
User Interface Operand Lookup Precedence UNIVERSAL Search exported procedures in the SOM symbols. LOCAL Search nonexported procedures in the SOM symbols. NESTED Search nested procedures in the SOM symbols. PROCEDURES Search local or exported procedures in the SOM symbols. ALLPROC Search local/exported/nested procedures in the SOM symbols. EXPORTSTUB Search export stubs in the SOM symbols. DATAANY Search exported or local data SOM symbols. DATAUNIV Search exported data SOM symbols.
User Interface Command Line Substitutions chapter introduced all the possibilities for operand tokens in expressions, thereby answering the question, "What sorts of things can be used as operands?" This section deals with the converse: "Given an operand, what sort of thing is it?" The process of evaluating an operand token can be modeled by a list of possible interpretations of a token.
User Interface Command Line Substitutions fully defined by the W (WRITE) command in chapter 4. The optional closing tilde (~) character is used to terminate the command line substitution string when it appears adjacent to text that is not to participate in the substitution. The tilde is always removed as part of the substitution. During the preprocessing phase, a command line is scanned repeatedly until no command line substitutions are performed.
User Interface Aliases while $1 < $20 do {cmd1;cmd2;cmd3} which will loop infinitely. Next consider the following: $nmdebug > var n "mom" $nmdebug > wl "|n" mom $nmdebug > wl "\|n" |n Note how the presence of the backslash cancels the command line substitution. Aliases Aliases may be established for command names, macros, and even other aliases. By defining an alias for one of these objects, one is merely specifying an alternative name by which the aliased object may be referred.
User Interface Error Handling variable ERROR for detection of errors by control commands. When an internal error is detected, appropriate error messages are pushed onto the error stack and the variable ERROR is set to the error number of the last error generated. While the highest-level error messages are typically displayed on the user's terminal, lower-level (intermediate) errors are usually pushed silently onto the error stack. All errors can be inspected with the ERRLIST command: $nmdebug > dv 1234.
User Interface Control-Y Control-Y System Debug allows the user to prematurely terminate command execution by entering a Control-Y (press and hold the CONTROL key and press Y). Command loops, display loops and modification loops can be interrupted with this mechanism. When Control-Y is entered during window updates, interrupted output lines may disturb portions of the windows. When this occurs, redraw the windows with the RED (redraw) command. NOTE There is only one Control-Y handler per session.
User Interface Automatic DBUGINIT Files • All system process debugging uses the system console. • All job debugging uses the system console. The environment variable JOB_DEBUG allows jobs to enter Debug. • The environment variable CONSOLE_DEBUG can be used to cause all processes that are entering Debug for the first time to use the system console. • The environment variable CONSOLE_IO can be used to cause all debugging for the current process to be directed to the system console.
User Interface Automatic DBUGINIT Files 50 Chapter 2
System Debug Interface Commands and Intrinsics Debug Interfaces 3 System Debug Interface Commands and Intrinsics Debug may be invoked directly through an integrated set of commands and intrinsics. All MPE V intrinsics are supported. In addition, several new intrinsics have been added to enhance the functionality of MPE/iX and take advantage of the new debugger.
System Debug Interface Commands and Intrinsics Debug Interfaces All intrinsics can be called from NM with the exception of STACKDUMP'. This intrinsic is not supported in native mode and is found only in the CM intrinsic file. Only those intrinsics available in MPE V are callable by the CM user.
System Debug Interface Commands and Intrinsics Debug Interfaces Debug may also be invoked with the HPDEBUG/DEBUG intrinsic calls from within any program. Native mode programs enter Debug assuming that the user will be viewing the native mode environment (program, stack, registers); this is referred to as NM Debug. Compatibility mode programs enter Debug assuming that the user will be viewing the compatibility mode environment; this is called CM Debug.
System Debug Interface Commands and Intrinsics Debug Interfaces PROGRAM TERMINATED IN AN ERROR STATE. : (CIERR 976) If the SETDUMP command (or intrinsic) is invoked before running this program, a full dual stack trace and a register dump is produced when the process aborts. Consider the following example: :setdump :run nmbomb **** Integer divide by zero (TRAPS 30) ABORT: NMBOMB.DEMO.TELESUP **** PROCESS ABORT STACKDUMP FACILITY **** PC=191.00006b20 test_arith_trap+$28 NM* 0) SP=40221178 RP=191.
System Debug Interface Commands and Intrinsics Debug Command and Intrinsic Descriptions Notice that the user was not left in Debug after the command string was executed. In order to be left in Debug, several criteria must first be met: • The abort did not occur while in system code, and • The process entered the abort code through a native mode interrupt. Such aborts are typically caused by arithmetic and code-related traps (see the XARITRAP and XCODETRAP intrinsics).
System Debug Interface Commands and Intrinsics :RESETDUMP Command entered, any pending commands are executed before the Debug prompt is displayed. If no commands were specified, Debug displays its prompt and waits for the user to enter interactive commands. This command is ignored in a job. Example The example below calls Debug to produce a stack trace and return to the CI. :debug trace;c DEBUG XL A.00.00 HPDEBUG Intrinsic at: a.006b4104 hxdebug+$130 PC=a.006b4104 hxdebug+$130 * 0) SP=40221c58 RP=a.
System Debug Interface Commands and Intrinsics :SETDUMP Command :SETDUMP Command Arms the Debug call that is made during abnormal process termination. Syntax :SETDUMP [DB [,ST [,QS] ] [;ASCII] [;DEBUG="commands"] ] Parameters A quoted string of system Debug commands, up to 255 characters long. If not specified, this parameter defaults to a command string that produces a dual mode stack trace and a register dump. commands DB, ST, QS, ASCII These parameters are provided for compatibility with MPE V.
System Debug Interface Commands and Intrinsics DEBUG Intrinsic Examples The first example arms the Setdump feature. No parameters are specified, so the default command string is assumed (the default command string produces a stack trace and register dump). :setdump : The following example also arms the Setdump feature but specifies a list of commands to be executed if the process aborts. :setdump ;debug="w 'Process abort at ';w pc; wl ' ' nmpath(pc)" : DEBUG Intrinsic Enters Debug.
System Debug Interface Commands and Intrinsics HPDEBUG Intrinsic debug; END; HPDEBUG Intrinsic Enters Debug and optionally executes a specified set of system Debug commands. Callable from: NM Syntax HPDEBUG (status, cmdstr [,itemnum, item] [...]); Parameters status 32-bit signed integer by reference (optional) The status returned by the HPDEBUG intrinsic call.
System Debug Interface Commands and Intrinsics HPDEBUG Intrinsic Passes an item value indicating if the Debug welcome banner should be printed. An item value of zero (0) keeps the banner from printing. Any other value causes the banner to print. Default: Print the welcome banner (1). Discussion The HPDEBUG intrinsic calls Debug with an optional character array containing Debug commands. If the command list is specified, Debug pushes the commands onto its command stack and executes them.
System Debug Interface Commands and Intrinsics HPRESETDUMP Intrinsic HPRESETDUMP Intrinsic Disarms Debug call which is made during abnormal process terminations. Callable from: NM Syntax HPRESETDUMP (status); Parameters status 32-bit signed integer (optional) The status returned by the HPRESETDUMP intrinsic call. The variable is a record containing two 16-bit fields, with the error number in the high-order 16 bits and the intrinsic subsystem number in the low-order 16 bits.
System Debug Interface Commands and Intrinsics HPSETDUMP Intrinsic HPSETDUMP Intrinsic Arms a call to Debug which takes place during abnormal process termination. Callable from: NM Syntax HPSETDUMP (status, cmdstr); Parameters 32-bit signed integer (optional) status The status returned by the HPSETDUMP intrinsic call. The variable is a record containing two 16-bit fields, with the error number in the high-order 16 bits and the intrinsic subsystem number in the low-order 16-bits.
System Debug Interface Commands and Intrinsics HPSETDUMP Intrinsic user may choose to resume the process or have it terminate (see the CONTINUE command in chapter 4). If the cause of the abort is a stack overflow, the command list is ignored and a stack trace is sent to $STDLIST, after which the process is terminated with no interactive debugging allowed. Refer to the MPE/iX Intrinsics Reference Manual for additional discussion of this intrinsic.
System Debug Interface Commands and Intrinsics RESETDUMP Intrinsic RESETDUMP Intrinsic Disarms the Debug call that is made during abnormal process termination Callable from: NM, CM Syntax RESETDUMP; Discussion The RESETDUMP intrinsic disarms the Debug call that is made during abnormal process termination. If the Setdump feature was not previously armed by one of the Setdump intrinsics or commands, this intrinsic has no effect. Only the current process is affected.
System Debug Interface Commands and Intrinsics SETDUMP Intrinsic Syntax SETDUMP (flags ); Parameters flags 16-bit unsigned integer (required) This parameter is provided for compatibility with MPE V. It is required, but is ignored. Discussion The SETDUMP intrinsic arms a call to Debug which is made during abnormal process terminations (aborts).
System Debug Interface Commands and Intrinsics STACKDUMP Intrinsic CCL Not returned by this intrinsic. Examples The following example is a code fragment from a Pascal program. It declares SETDUMP as an intrinsic and then calls it. The rest of the code in the program is protected by the Setdump facility, unless another routine in the program explicitly turns it off. PROGRAM myprog; TYPE bit16 = 0 .. 65535; flags : bit16; procedure SETDUMP; intrinsic; BEGIN SETDUMP( flags ); . .
System Debug Interface Commands and Intrinsics STACKDUMP Intrinsic number of the failure is returned here. Any value passed into the intrinsic through this parameter is ignored. flags 16-bit unsigned integer (optional) This parameter is provided for compatibility with MPE V. If it is present in the intrinsic call, it is ignored and has no effect. selec 32-bit integer array by reference (optional) This parameter is provided for compatibility with MPE V.
System Debug Interface Commands and Intrinsics STACKDUMP Intrinsic Condition Codes CCE Request granted. CCG Request denied. An invalid address for the location of the filename parameter was detected. CCL Request denied. File system error occurred during opening or closing of the file. The specific file system error number is returned in the idnumber described above. Examples The following example is a code fragment from a Pascal program.
System Debug Interface Commands and Intrinsics STACKDUMP' Intrinsic STACKDUMP' Intrinsic Writes a full stack trace to a previously opened file. Callable from: CM Syntax STACKDUMP' (filename, idnumber, flags, selec); Parameters filename Byte array (required) The first byte of this array contains the file number of a previously opened file. The file is used as the output file. The file must have a record length between 32 and 256 CM words, and write access must be allowed for the file.
System Debug Interface Commands and Intrinsics STACKDUMP' Intrinsic filename parameter. Example The following example is a code fragment from a Pascal/V program. It is a procedure which is passed the file number of an already opened file. The procedure then uses the STACKDUMP' intrinsic to have a stack trace printed to the specified file number. Note the use of the Pascal $ALIAS$ directive in declaring the intrinsic. PROCEDURE dump_stack_to_fnum(fnum : shortint); TYPE bit8 = 0..
System Debug Command Specifications :-Exit 4 System Debug Command Specifications :-Exit Specifications for the System Debug commands are presented in this chapter in alphabetical order. Window command specifications are presented in chapter 7, "System Debug Window Commands." System Debug tools share the same command set. A few commands, however, are inappropriate in either DAT or Debug. These commands are clearly identified as "DAT only" or "Debug only" on the top of the page that defines the command.
System Debug Command Specifications :-Exit : DAT only The following DAT commands cannot be used in Debug: CLOSEDUMP Closes a dump file DEBUG Enters Debug; used to debug DAT DPIB Displays a portion of the Process Information Block DPTREE Displays the process tree DUMPINFO Displays dump file information GETDUMP Reads in a dump tape to create a dump file OPENDUMP Opens a dump file PURGEDUMP Purges a dump file : The CI command - Access to the MPE/iX command interpreter (CI).
System Debug Command Specifications :-Exit = Every time this command is used, Debug assumes ownership of the Control-Y handler (even if it already owns it). = The calculator command. Calculates the value of an expression and displays the result in the specified base. Syntax = expression [base] Parameters expression The expression to evaluate.
System Debug Command Specifications :-Exit = In the second example, the string is coerced into a hexadecimal value. %cmdebug > = [dst 12.100] + [db+4], $ $4820 The sum of the contents of data segment 12.100 plus the contents of DB+4, displayed in hexadecimal. %cmdebug > = fopen SYS %22.4774 What is the start address of the CM procedure FOPEN? The address is returned as logical code address. %cmdebug > = ?fopen SYS %22.
System Debug Command Specifications :-Exit ABORT Limitations, Restrictions none ABORT Aborts/terminates the current System Debug process. Syntax ABORT Parameters none Examples %cmdebug > ABORT END OF PROGRAM : Limitations, Restrictions If Debug is entered using the DEBUG command at the CI, the ABORT command causes the current session to be logged off.Use CONTINUE to exit from Debug in this case.
System Debug Command Specifications :-Exit ALIAS Several predefined aliases (command abbreviations) are automatically generated, and are classified as predefined aliases. Refer to the ALIASLIST and ALIASINIT commands. Parameters name The name of the alias (the new name to be used in place of another). Alias names are restricted to 16 characters. command The command name to be used when the alias name is encountered. This can be any command or macro name. The command name is restricted to 32 characters.
System Debug Command Specifications :-Exit ALIASD[EL] $nmdat > alias showtime "wl time" $nmdat > aliasl showtime alias showtime wl time /* user $nmdat > showtime Unknown command. (error #6105) Command "showtime" was aliased to "wl time". Note that alias command names are restricted to simple command or macro names. In the above example, the command wl time was assumed to be the name of a command or macro. Since no match was found in the command or macro table, an error is generated.
System Debug Command Specifications :-Exit ALIASD[EL] The following wildcards are supported: @ Matches any character(s). ? Matches any alphabetic character. # Matches any numeric character. The following are valid name pattern specifications: @ Matches everything; all names. pib@ Matches all names that start with "pib". log2##4 Matches "log2004", "log2754", and so on. The following regular expressions are equivalent to the patterns with wildcards that are listed above: `.*` `pib.
System Debug Command Specifications :-Exit ALIASINIT ALIASINIT Restores the predefined aliases, in case they have been deleted. Syntax ALIASINIT For a full listing of all predefined aliases, see the example below.
System Debug Command Specifications :-Exit ALIASL[IST] alias showerr alias showfunc alias showloc alias showmac alias showmap alias showset alias showsym alias showvar alias symfiles alias symlist alias trace alias vardel alias varlist $nmdebug > errl funcl locl macl mapl set syml varl symf syml tr vard varl /* /* /* /* /* /* /* /* /* /* /* /* /* predefined predefined predefined predefined predefined predefined predefined predefined predefined predefined predefined predefined predefined Delete all alia
System Debug Command Specifications :-Exit ALIASL[IST] The following are valid name pattern specifications: @ Matches everything; all names. pib@ Matches all names that start with "pib". log2##4 Matches "log2004", "log2754", and so on. The following regular expressions are equivalent to the patterns with wildcards that are listed above: `.*` `pib.*` `log2[0-9][0-9]4` By default, all alias names are listed, subject to the group specification described below.
System Debug Command Specifications :-Exit B (break) Limitations, Restrictions none B (break) Debug only Privileged Mode: BA, BAX, BS Break. Sets a breakpoint.
System Debug Command Specifications :-Exit B (break) Parameters logaddr A full logical code address (LCPTR) specifies three necessary items: • The logical code file (PROG, GRP, SYS,, and so on) • NM: the virtual space ID number (SID) CM: the logical segment number • NM: the virtual byte offset within the space CM: the word offset within the code segment Logical code addresses can be specified in various levels of detail: • As a full logical code pointer (LCPTR): B procname+20 procedure name lookups return
System Debug Command Specifications :-Exit B (break) BLP Search LPUB, the logon account library. BS Search SYS, the system library. BU Search USER, the user library. For a full description of logical code addresses, refer to the section "Logical Code Addresses" in chapter 2. fname The file name of the NM user library. Since multiple NM libraries can be bound with the XL= option on a RUN command, :run nmprog; xl=lib1,lib2.testgrp,lib3 it is necessary to specify the desired NM USER library.
System Debug Command Specifications :-Exit B (break) pin| @ The process identification number (PIN) of the process for which the breakpoint is to be set. If omitted, the breakpoint is set for the current process. The character "@" can be used to set a global breakpoint at which all processes stop. count Count has a twofold meaning: it specifies a break every nth time the breakpoint is encountered, and it is used to set permanent/temporary breakpoints. If count is positive, the breakpoint is permanent.
System Debug Command Specifications :-Exit B (break) as a logical address for this command, the space (SID) for the program file is assumed. A STOLOG conversion (not STOL) with the "prog" selector is used to accomplish this. $nmdebug > b processstudent,,, {wl "Processing #" r26:"d";c} added: NM [3] PROG 115.00005d24 processstudent Set a breakpoint at the procedure called processstudent and provide a command list to be executed each time the breakpoint is encountered.
System Debug Command Specifications :-Exit B (break) The virtual address specified does not exist. (error #1407) $nmdebug > errl $28: The virtual address specified does not exist. (error #1407) $28: The virtual address does not exist. (error #6017) $28: VADDR= 115.15c74 $28: A pointer was referenced that contained a virtual address outside of the bounds of an object. The above example starts by showing that Debug has stopped in the group library in the average procedure.
System Debug Command Specifications :-Exit B (break) $nmdebug > bs ?FREAD,#100,q,{wl "Read another 100 records";c} added: NM |10| SYS a.0074aa34 FREAD Set a breakpoint at the FREAD intrinsic. Every #100 times the routine is called, stop and print out a message. The QUIET option is specified so this operation produces no extra terminal output.
System Debug Command Specifications :-Exit B (break) PROCESSSTUDENT. The expression evaluator found the procedure in the program file in logical segment zero, at an offset of %1665 CM words from the start of the segment procedure. %cmdebug > b 0.1670 added: CM [2] PROG % 0.1670 PROCESSSTUDENT+%263 Set a breakpoint %1670 CM words into the program file's logical segment zero. That address corresponds to the %263rd CM word from the start of the PROCESSSTUDENT procedure.
System Debug Command Specifications :-Exit B (break) added: CM NM |11| SYS % 27.4727 ?FWRITE |1| TRANS 30.00737fb4 SUSER1:?FWRITE The above example sets a breakpoint at the entry point of the FWRITE intrinsic which is located in the system library SL.PUB.SYS. Every #100 times the routine is called, stop and print out a message. The QUIET option is specified so this operation produces no extra terminal output. SL.PUB.
System Debug Command Specifications :-Exit B (break) Set a breakpoint at the current CM program counter. Both the CM emulated and NM translated breakpoints are set. Next, set a breakpoint at the instruction following the current CM program counter. Again, both the CM and NM breakpoints are set. Note that the index number for the NM breakpoint is the same. This is because the two CM breakpoints are contained in the same node. Appendix C provides a description of node points. %cmdebug > nm $nmdebug > b 20.
System Debug Command Specifications :-Exit BD • While on the ICS. • While disabled. • In a "dying" process. (See the DYING_DEBUG variable in the ENV command discussion.) • In a job. (See the JOB_DEBUG variable in the ENV command discussion.) Breakpoints set in CM translated code (which has been optimized) may not always be hit. In some cases, the optimizer saves an instruction by targeting a branch to the delay slot immediately following a node point.
System Debug Command Specifications :-Exit BD YES any_text Yes, remove the breakpoint. N[O] No, do not remove the breakpoint. NO any_text No, do not remove the breakpoint. If any other response is given, the default value NO is assumed. pin | @ The PIN for the process whose breakpoint entry is to be deleted. Typically this is omitted, and pin defaults to the current process. The character "@" can be used to specify that a global breakpoint is to be deleted. Examples $nmdebug > bl NM [1] PROG 115.
System Debug Command Specifications :-Exit BD NM NM NM NM NM [1] PROG 115.00006a8c PROGRAM+$270 T[4] PROG 115.00005b50 processstudent.highscore [5] GRP 118.00015c88 average |10| SYS a.0074aa34 FREAD [QUIET] count: 0/64 cmdlist: {wl "Read another 100 records";c} @[1] SYS a.00668684 trap_handler [QUIET] cmdlist: {trace ,ism} List the remaining breakpoints. $nmdebug > bd 1:@ deleted: NM @[1] SYS a.00668684 trap_handler Delete global breakpoint number 1. $nmdebug > bd @ deleted: NM [1] PROG 115.
System Debug Command Specifications :-Exit BL $nmdebug > cm %cmdebug > bd 2 deleted: NM [2] TRANS 48.0000a610 SEG':?PROCESSSTUDENT CM Ref count = 0 deleted: CM [2] PROG % 0.1665 ?PROCESSSTUDENT Delete CM breakpoint number 2. The corresponding NM breakpoint is also deleted. %cmdebug > bd 3 deleted: NM [3] TRANS 48.0000a66c SEG':PROCESSSTUDENT+%265 CM Ref count = 1 deleted: CM [3] PROG % 0.1672 PROCESSSTUDENT+%265 Delete CM breakpoint number 3.
System Debug Command Specifications :-Exit BL without PM capability may only specify PINs that are descendant processes (any generation) of the current PIN. Parameters number The index number of the breakpoint entry to display. The symbol "@" can be used to display all entries. If omitted, then all entries are displayed. pin The PIN for the process whose breakpoint entries are to be displayed. Typically this is omitted, and pin defaults to the current process.
System Debug Command Specifications :-Exit CLOSEDUMP CM CM [3] PROG % 0.1672 PROCESSSTUDENT+%265 Corresponding NM bp = 3 [4] PROG % 0.1673 PROCESSSTUDENT+%266 Corresponding NM bp = 3 SEG' (CSTX 1) SEG' (CSTX 1) %cmdebug > nm $nmdebug > bl NM [1] TRANS 3d.0016962c SEG':?AVERAGE CM Ref count = 1 NM [2] TRANS 48.0000a610 SEG':?PROCESSSTUDENT CM Ref count = 1 NM [3] TRANS 48.0000a66c SEG':PROCESSSTUDENT+%265 CM Ref count = 2 NM [4] TRANS 20.
System Debug Command Specifications :-Exit CM Limitations, Restrictions none CM Enters compatibility mode (cmdat/cmdebug). See the NM command. Syntax CM The command switches from NM (nmdat/nmdebug) to CM (cmdat/cmdebug). If the windows are on, the screen is cleared and the set of windows enabled for cmdebug is redrawn. The command also sets several environment variables.
System Debug Command Specifications :-Exit CMDL[IST] commands are actually implemented as aliases. Aliases are not displayed with the CMDL command; rather, the ALIASL command must be used to view them. Parameters pattern The command name(s) to be displayed. This parameter can be specified with wildcards or with a full regular expression. Refer to appendix A for additional information about pattern matching and regular expressions. The following wildcards are supported: @ Matches any character(s).
System Debug Command Specifications :-Exit CMDL[IST] options ENV Commands to list/show/alter the environment TRANSLATE Translate CM addresses to NM address CI Command Interpreter-related IO For producing I/O DUMP Open/close/purge/info on dumps ERROR Error management MISC Grab bag WINDOW Window related ALL | @ All groups Any number of the following options can be specified in any order, separated by blanks or commas: NAME Display command name only (default).
System Debug Command Specifications :-Exit CMDL[IST] Type "ALIASL" for a list of the command aliases List all of the commands that deal with error management. $nmdat > cmdl w@ cmd W io cmd WCOL io cmd WHELP window cmd WHILE ci cmd WL io cmd WP io cmd WPAGE io nm nm nm nm nm nm nm cm cm cm cm cm cm cm List all of the commands that start with the letter "W". $nmdat > cmdl w@,ci cmd WHILE ci nm cm List all of the commands that start with the letter "W" and deal with System Debug's command interpreter.
System Debug Command Specifications :-Exit CMG WHILE condition DO command | {cmdlist} PARMS: condition command cmdlist true. A logical expression to be repeatedly evaluated. A single command to be executed while CONDITION is true. A list of commands to be executed while CONDITION is Provide all information available for the WHILE command except examples and description. Limitations, Restrictions none CMG Privileged Mode Displays values in the CMGLOBALS record for a process.
System Debug Command Specifications :-Exit C[ONTINUE] s z stack_base stack_limit cst cstx lstt nrprgmsegs dst bank0 bank0_size debug mcode_adr $nmdat > : : : : : : : : : : : : : 2c4.4001245e 2c4.40014310 2c4.40011cb0 2c4.40015fff 80000700 c6bc8000 0.0 0 81800000 80000000 10000 0 3ee090 Display the CMGLOBALS record for the current PIN. Limitations, Restrictions none C[ONTINUE] Continues/resumes execution of user program.
System Debug Command Specifications :-Exit D (display) process stack as appropriate to enable the process to continue correctly. Examples %cmdebug > c Limitations, Restrictions The CONTINUE command cannot be used from within macro bodies that are invoked as a function. This command resumes execution of your program or the CI if you entered the debugger with a DEBUG command. If you wish to abort your program or session, use the ABORT command.
System Debug Command Specifications :-Exit D (display) The data segment number and CM word offset that specifies the starting location of the area to be displayed. logaddr DC, DCG, DCP, DCLG, DCLP, DCS, DCU only. A full logical code address (LCPTR) specifies three necessary items: • the logical code file (PROG, GRP, SYS, and so on) • NM: the virtual space ID number (SID) CM: the logical segment number • NM: the virtual byte offset within the space. CM: the word offset within the code segment.
System Debug Command Specifications :-Exit D (display) DCLP Search LPUB, the logon account library. DCS Search SYS, the system library. DCU Search USER, the user library. For a full description of logical code addresses, refer to the section "Logical Code Addresses" in chapter 2. fname DCU only. The file name of the NM USER library. Since multiple NM libraries can be bound with the XL= option on a RUN command, :run nmprog; xl=lib1,lib2.
System Debug Command Specifications :-Exit D (display) realaddr DZ only. The real mode HP Precision Architecture memory address to be displayed. ldev.off DSEC only. The logical device number (LDEV) and offset (in bytes) of the data on disk to be displayed. count DA, DC@ (CM), DD, DDB, DS, DQ: The number of CM 16-bit words to be displayed. DC@ (NM), DV, DZ, DSEC: The number of NM 32-bit words to be displayed. If omitted, then a single value is displayed.
System Debug Command Specifications :-Exit D (display) the current mode (CM/NM) and the specified command. This parameter is ignored for display code commands (DC@). Examples %cmdebug > dd 77.0 DST %77.0 % 000655 Display DST 77.0. By default, one word is displayed in the current output base, octal. %cmdebug > dd 77.0,20 DST %77.0 %0 % 000655 000012 000000 000000 000000 000000 000000 000000 %10 % 000000 000000 041515 023511 047111 052111 040514 020040 Display DST 77.0 for %20 words.
System Debug Command Specifications :-Exit D (display) %cmdebug > dd 77.0,20,h,6,1 DST %77.0 %0 $ 01 ad 00 0a 00 00 00 00 00 00 00 00 %6 $ 00 00 00 00 00 00 00 00 43 4d 27 49 %14 $ 4e 49 54 49 41 4c 20 20 %cmdebug > dd 77.0,20,h,6,2 DST %77.0 %0 $ 01ad 000a 0000 0000 0000 0000 %6 $ 0000 0000 0000 0000 434d 2749 %14 $ 4e49 5449 414c 2020 %cmdebug > dd 77.0,20,h,6,4 DST %77.
System Debug Command Specifications :-Exit D (display) is calculated by right-shifting the real address of PC by $b (to determine page number), and then multiplying by $10 since each 4-word PDIR entry is $10=#16 bytes long. Examples of Code Displays $nmdebug > dcs sendio+18,7 SYS $a.
System Debug Command Specifications :-Exit DATAB Command %14 uses the SET DEFAULT command to effectively reset the environment variable term_loud back to TRUE. Debug output once again is displayed on the terminal. Command %15 issues an MPE/iX CI command PRINT CODEDUMP to display the newly created list file with the disassembled code. Note the additional Debug commands that were captured in the list file.
System Debug Command Specifications :-Exit DATAB Data breakpoints "break" when the indicated address is written to. The debugger stops at the instruction that is about to perform the write operation. The DATAB command is used to set process-local and global (system-wide) data breakpoints. Setting a breakpoint for another process is implemented so that it appears the target process set the breakpoint itself.
System Debug Command Specifications :-Exit DATABD Examples $ nmdebug > datab dp+c14,8 added: [1] 49.40150c68 for 8 bytes Set a data breakpoint at DP+c14. (We will assume it's a global variable.) Protect 8 bytes starting at that address. $ nmdebug > datab r24,c4,-1 added: T[2] 49.401515d4 for c4 bytes Set a temporary data breakpoint at the address pointed to by general register 24. For this example we assume that r24 contains a pointer to the user's dynamic heap space.
System Debug Command Specifications :-Exit DATABD Privileged Mode Deletes a data breakpoint entry specified by index number. Syntax DATABD [number | @ [: pin | @] ] The DATABD command is used to delete process-local data breakpoints and global (system-wide) data breakpoints. Parameters number | @ The index number of the data breakpoint entry that is to be deleted. The character "@" can be used to delete all breakpoint entries.
System Debug Command Specifications :-Exit DATABL Delete data breakpoint number 1. $ nmdebug > databl T[2] 49.401515d4 for c4 bytes count 0/1 List the data breakpoints that remain. Limitations, Restrictions none DATABL Debug only Privileged Mode Lists data breakpoint entries, specified by index number. Syntax DATABL [number | @ [: pin | @] ] The DATABL command is used to list process-local and global (system-wide) data breakpoints.
System Debug Command Specifications :-Exit DEBUG $ nmdebug > databl 1 [1] 49.40150c68 for 8 bytes Display data breakpoint number 1. $ nmdebug > databl @:@ @[1] c.c1040480 for 4 bytes cmdlist: {WL "pib data breakpoint was hit"} Display all of the global data breakpoints. Limitations, Restrictions none DEBUG DAT only Privileged Mode DEBUG command—access to DEBUG XL. Syntax DEBUG Parameters none Examples $nmdat > debug DEBUG XL A.00.00 DEBUG Intrinsic at: 401.
System Debug Command Specifications :-Exit DELETExxx DELETExxx Delete various items. These are predefined aliases for other commands. Syntax DELETEB DELETEALIAS DELETEERR DELETEMAC DELETEVAR alias alias alias alias alias for for for for for BD ALIASD ERRD MACD VARD See the ALIASINIT command. DEMO Privileged Mode Adds/deletes/lists terminals used for demonstrating System Debug. Syntax DEMO DEMO LIST DEMO ADD ldevs DEMO DELETE ldevs The DEMO command is used for giving demonstrations of System Debug.
System Debug Command Specifications :-Exit DIS are interpreted using the current input base for System Debug. Examples $nmdat > demo No demonstration terminals are defined $nmdat > demo add #200 #201 #205 #206 $nmdat > demo list DEMO LDEVS (#): 200 201 205 206 First, check to see if any demonstration LDEVs have been specified. Next, add four LDEVs to the list of terminals to receive a copy of DAT's input and output stream.
System Debug Command Specifications :-Exit DIS DIS cmword1 [cmword2] [cmlogaddr] The DCx (display code) commands can be used to display a block of code at a specified address. The program windows also display disassembled code. Parameters nmword The Precision Architecture instruction to disassemble. All disassembled values are in decimal unless otherwise indicated. cmword1 The CM HP 3000 instruction to disassemble. cmword2 A second CM HP 3000 instruction to disassemble for double-word instructions.
System Debug Command Specifications :-Exit DIS This CM example disassembles the single CM word %41101 into the LOAD DB+%101 instruction. %cmdebug > dis 20477 43 LDDW SDEC=1 This CM example disassembles the two CM words, %20477 and %43, into the LDDW SDEC=1 instruction. %cmdat > dis 31163 PCAL %163 %cmdat > dis 31163,,sys(25.0) PCAL ?SWITCH'TO'NM' %cmdat > dis 31163,,sys(1.0) PCAL ?ATTACHIO These CM examples involve the CM PCAL instruction.
System Debug Command Specifications :-Exit DO This example demonstrates how a simple loop can be used to display the targets for each STT entry within the current CM segment. Since we know that %31000 is the PCAL instruction, we simply add the desired STT number and use the DIS command to display the target entry point name. Control-Y is used to terminate the loop. Limitations, Restrictions none DO Reexecutes a command from the command stack.
System Debug Command Specifications :-Exit DPIB DPIB DAT only Display data from the process identification block (PIB) for a process. You can use DPIB in both native mode and compatibility mode. Syntax DPIB [pin] Parameters The process identification number for the process whose PIB values are to be displayed. If no pin is specified, the current pin is used.
System Debug Command Specifications :-Exit DR Examples $nmdat > dptree 1 ( PROGEN.PUB.SYS ) 2 ( LOAD.PUB.SYS ) 3 ( .. ) 4 ( .. ) 5 ( .. ) 6 ( LOG.PUB.SYS ) 7 ( SYSMAIN.PUB.SYS ) 9 ( SESSION.PUB.SYS ) a ( JSMAIN.PUB.SYS ) 15 ( CI.PUB.SYS ) 16 ( JSMAIN.PUB.SYS ) 17 ( CI.PUB.SYS ) 12 ( FCOPY.PUB.SYS ) 8 ( JOB.PUB.SYS ) b ( JSMAIN.PUB.SYS ) c ( DIAGMON.DIAG.SYS ) d ( RUNPROG.DIAG.SYS ) e ( MEMLOGP.DIAG.SYS ) f ( RUNPROG.DIAG.SYS ) 10 ( LOGGER.DIAG.SYS ) $nmdat > Prints out the entire process tree.
System Debug Command Specifications :-Exit DR CIR The current instruction register. CMPC The full logical CM program counter address. MAPDST The CST expansion mapping data segment number. MAPFLAG The CST expansion mapping bit. Q The Q register word offset, DB relative. S The S register word offset, DB relative. SDST The CM stack data segment number. STATUS The CM status register. X The X (index) register. If cm_register is omitted, all of the above CM registers are displayed.
System Debug Command Specifications :-Exit DR Table 4-1.
System Debug Command Specifications :-Exit DR Table 4-3. Space Registers Name Alias Access Description SR4 none dM Process local code space (tracks PC space) SR5 none dM Process local data space SR6 none dM Operating system data space 1 SR7 none dM Operating system data space 2 The following registers are known as the Control Registers. They contain system state information. Table 4-4.
System Debug Command Specifications :-Exit DR Table 4-4. Control Registers Name Alias Access Description CR22 IPSW dM Interrupt processor status word PSW dM Processor status word CR23 EIRR dM External interrupt request register CR24 TR0 dM Temporary register 0 TR7 dM Temporary register 7 [vellip] CR31 NOTE The Precision Architecture and Instruction Reference Manual refers to the PC (program counter) registers as the IA (instruction address) registers.
System Debug Command Specifications :-Exit DR Table 4-5. Floating Point Registers Name Alias Access Description FPE2 none dm FP exception reg 2 (left half of FP1) FPE3 none dm FP exception reg 3 (right half of FP1) FPE4 none dm FP exception reg 4 (left half of FP2) FPE5 none dm FP exception reg 5 (right half of FP2) FPE6 none dm FP exception reg 6 (left half of FP3) FPE7 none dm FP exception reg 7 (right half of FP3) base Specifies the base used to display the register data.
System Debug Command Specifications :-Exit DUMPINFO EIEM=ffffffff EIRR=00000000 CCR=0000 Display all NM registers. $nmdebug > dr pcqb PCQB=0000000a.0021d7b8 Display the contents of "pcq back". $nmdebug > dr pid2 PID2=$0004=0002(W) Display the contents of protection ID register number 2. Limitations, Restrictions Floating-point registers are displayed as 64-bit long pointers. No interpretation of the data is attempted. DUMPINFO DAT only Displays dump file information.
System Debug Command Specifications :-Exit DUMPINFO Dump Title: SA 2559 on KC (8/29/88 9:40) Last PIN : 34 - On ICS -- Dispatcher running $nmdat > Display the dump title (entered by the dump operator) and the machine state at the time the dump was taken. $nmdat> DUMPINFO DIR Dump file set . . . . Dumped OS . . . . . . Dump tape creator . . Dump disc file creator Tape format ID . . . . Tape creation date . . Tape compression . . . Dump disc format ID .
System Debug Command Specifications :-Exit ENV ENV Assigns a new value to one of the predefined environment variables. Syntax ENV var_name [=] var_value The environment variables allow control and inspection of the operation of System Debug. Parameters var_name The name of the environment variable to set. var_value The new value for the variable, which can be an expression.
System Debug Command Specifications :-Exit ENV ARG0 - ARG3 implies the full range: ARG0, ARG1, ARG2, and ARG3. The Environment Variables - Sorted by Group The following table lists all environment variables, arranged by their logical groups. A full alphabetically-sorted listing and description of each variable can be found following this table.
System Debug Command Specifications :-Exit ENV limits limits limits limits rw r rw r VARS VARS_LIMIT VARS_LOC VARS_TABLE : : : : U16 U16 U16 U16 CCODE CHECKPSTATE CPU CSTBASE DATE DISP DSTBASE DUMPALLOC_LZ DUMPALLOC_RLE DUMP_COMP_ALGO ENTRY_MODE ESCAPECODE EXEC_MODE GETDUMP_COMP_ALGO ICSNEST ICSVA ISM_ARCH LASTPIN LOOKUP_ID MODE MONARCHCPU MPEXL_TABLE_VA PHYS_REG_WIDTH PIN PRIV_USER PROGNAME PSEUDOVIRTREAD PSTMT QUIET_MODIFY SYMPATH_UPSHIFT SYSVERSION TIME USER_REG_WIDTH VERSION : : : : : : : : : : :
System Debug Command Specifications :-Exit ENV cmreg - compatibility mode regs cmreg cmreg cmreg cmreg cmreg cmreg cmreg cmreg cmreg cmreg cmreg cmreg r r r r r r r r r r r r dm dm dm dm dm d d dm dm dm dm dm CIR CMPC DB DBDST DL MAPDST MAPFLAG Q S SDST STATUS X : : : : : : : : : : : : S16 LCPTR S16 S16 S16 S16 S16 S16 S16 S16 S16 S16 : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : U32 U16 U32 U32 U32 U32 U32 U32 U32 U32 U32 U32 U32 LPTR U32 U32 LPTR LPTR U32 U32 U16 BOOL U32 U
System Debug Command Specifications :-Exit ENV system system system rW rW rW CONSOLE_DEBUG DYING_DEBUG JOB_DEBUG : BOOL : BOOL : BOOL (Debug only) (Debug only) (Debug only) state - process state The state variables consist of all NMREG, CMREG, and FPREG variables. The Environment Variables - Sorted Alphabetically The following table lists all predefined environment variables.
System Debug Command Specifications :-Exit ENV since the last command. The following string literals are valid: "INVERSE", "HALFINV", "BLINK", "ULINE", and "FEABLE". Note that this is a string variable; thus, literals must be quoted. The default value is "HALFINV". CHECKPSTATE BOOL (misc) rw If FALSE, inhibits validation of the process state when performing the following functions: PIB, PIBX, PCB, PCBX, CMG, CMSTACKBASE, CMSTACKDST, CMSTACKLIMIT, NMSTACKBASE and NMSTACKLIMIT.
System Debug Command Specifications :-Exit ENV # or DECIMAL $ or HEXADECIMAL The names may be abbreviated to a single character. The default value is % (octal). Refer to the SET command for an alternate method of setting this variable. COLUMN U16 (io) rw The current character position in the user's output buffer. The position is advanced by the W and WCOL commands (or by the C directive in a format specification). Refer to the W command for details.
System Debug Command Specifications :-Exit ENV Set Reference Manual): Table 4-6.
System Debug Command Specifications :-Exit ENV The CM DB register. DBDST U16 (cmreg) r dm The CM DB DST number. DISP BOOL (misc) r A Boolean value that indicates whether or not the dispatcher is currently running. This value is always FALSE in Debug. DL U16 (cmreg) r dm The CM DL register. DP U32 (nmreg) r dm NM global data pointer register. (Alias for R27) DSTBASE LPTR (misc) rW The virtual address of the CM DST table.
System Debug Command Specifications :-Exit ENV When ECHO_CMDS is set, each command (other than those executed within macros) is echoed just prior to its execution. The default value for this variable is FALSE. ECHO_SUBS BOOL (cmd) rw * When ECHO_SUBS is set, and CMDLINESUBS is enabled, command line substitutions are displayed as they are performed.
System Debug Command Specifications :-Exit ENV the ENTRY_MODE variable. FALSE BOOL (const) r The constant FALSE. FILL STR (io) rw * This variable determines how leading zeros in right-justified data (refer to JUSTIFY variable) are output from the Display commands and in the windows. This variable may take on one of two quoted literal values: "BLANK" (show leading zeros as blanks) or "ZERO" (show leading zeros as zeros). The default value is "ZERO".
System Debug Command Specifications :-Exit ENV NM floating-point registers 0-15. The 64 bits of these registers are presented as long pointers until System Debug supports 64-bit integers. FPE1-FPE7 S32 (fpreg) r dm NM floating-point exception registers 1-7. These registers are extracted from FP0-FP3. That is, FPE1 is an alias for the right 32 bits of FP0, FPE2 is an alias for the left 32 bits of FP1, and so on. (Refer to the Precision Architecture and Instruction Reference Manual (09740-90014).
System Debug Command Specifications :-Exit ENV The names may be abbreviated to 1 character. The default is based on the current mode (NM or CM). Refer to the SET command for an alternate method of setting this variable. IOR U32 (nmreg) r dM NM interrupt offset register. (Alias for CR21) IPSW U32 (nmreg) r dM NM interrupt processor status word (alias for CR22 and PSW). Debug may set or alter the "R" bit while single stepping, as well as the "T" bit if the TRAP BRANCH ARM command has been issued.
System Debug Command Specifications :-Exit ENV letter means the bit is ON while a lowercase letter indicates the bit is OFF. ISM_ARCH S32 (misc) r dM Returns the software interrupt stack marker architecture as 32 or 64. The two architectures currently in use differ in their abilities to hold either a 32 or 64-bit state, and are associated with the operating system version. Note that this is NOT the same as the hardware register size, which may be determined by ENV CPU_ARCH.
System Debug Command Specifications :-Exit ENV set, a page eject is placed in the list after every LIST_PAGELEN lines. LIST_PAGENUM U16 (io) r The current page number of the list file (refer to the LIST command). When a list file is opened, this variable is reset to 1. The default LIST_TITLE uses this value as part of the page title written to each page. LIST_PAGING BOOL (io) r * When LIST_PAGING is set, output to the list file (refer to the LIST command) is paged (based on LIST_PAGELEN).
System Debug Command Specifications :-Exit ENV DATAANY Search exported or local data System Object Module symbols. DATAUNIV Search exported data System Object Module symbols. DATALOCAL Search local data System Object Module symbols. LSTPROC Search exported level 1 procedures in the LST. LSTEXPORTSTUB Search export stubs in the LST. ANY Search for any type of symbol in the System Object Module symbols. The default is LSTPROC.
System Debug Command Specifications :-Exit ENV MODE STR (misc) r This variable contains either "NM" if you are in NMDebug, or "CM" if in cmdebug. MONARCHCPU U16 (misc) r d This variable contains the number of the Monarch processor. MPEXL_TABLE_VA U16 (misc) rw This variable contains the address of the table used by the MPEXL command. Initially the address is set to NIL (0.0). The first invocation of the MPEXL command will correctly replace the NIL value with the actual table address.
System Debug Command Specifications :-Exit ENV % or OCTAL # or DECIMAL $ or HEXADECIMAL The names may be abbreviated to as little as a single character. The default value is $ (hex). Refer to the SET command for an alternate method of setting this variable. NONLOCALVARS BOOL (cmd) rw When NONLOCALVARS is FALSE (default), macro bodies can only reference local variables that are declared locally within the current macro.
System Debug Command Specifications :-Exit ENV PCSB U32 (nmreg) r dm NM program counter sid (next in pipeline queue). PCSF U32 (nmreg) r dm NM program counter sid (first in pipeline queue). PHYS_REG_WIDTH S32 (misc) r Returns the physical width of the registers in the machine, as 32 or 64. Note that 64 is returned only when the machine has HP-PA 2.0 64-bit hardware AND the OS supports it with 64-bit ISMs. PID1 - PID4 U16 (nmreg) r dM NM protection ID registers. (Alias for CR8, CR9, CR12, CR13.
System Debug Command Specifications :-Exit ENV This variable contains the name of the tool that is being run. It is either 'dat' or 'debug'. PROMPT STR (io) rw Current user prompt. It is defined as a quoted string with the same syntax and options as the WL command. The default prompt is: 'cmdnum " (" pin ") " mode progname " " filter "> "' The variables in the prompt are evaluated each time the prompt is displayed.
System Debug Command Specifications :-Exit ENV R1 - R31 U32 (nmreg) rwdm NM general registers. Many of these registers have aliases. Refer to the DR command for a complete list. RCTR U32 (nmreg) r dM NM recovery counter register. (Alias for CR0) RET0 U32 (nmreg) r dm NM return register 0 (alias for R28). This register is used by the language compilers to return function results. RET1 U32 (nmreg) r dm NM return register 1 (alias for R29).
System Debug Command Specifications :-Exit ENV I bit 1 if external Interrupts are enabled 0 if not T bit 1 if user Traps are enabled 0 if not R bit 1 if right stack operation pending 0 if left stack operation pending O bit 1 if Overflow bit set (not set if user traps enabled) 0 if not C bit 1 if Carry bit set 0 if not CC bits 01 if CCL (This is the condition code value) 10 if CCE 00 if CCG System Debug display this register with two formats: STATUS=%100030=(Mitroc CCG 030) The first value is th
System Debug Command Specifications :-Exit ENV TERM_LDEV U16 (io) rW This variable contains the logical device number (LDEV) to use for I/O. Debug determines this value by looking up the LDEV for the session. If the ENV command is used to alter this value, Debug attempts to allocate the indicated LDEV. If the LDEV is already allocated (that is, in use by another session), an error status is returned.
System Debug Command Specifications :-Exit ENV amounts of data to a list file so that you do not see it on your screen. The default for this variable is TRUE. TERM_PAGING BOOL (io) rw * If this variable is set, all output is paged. That is, after each full screen of output, System Debug pauses. At that point the user is prompted with the question "MORE?".
System Debug Command Specifications :-Exit ENV VARS_LIMIT U16 (limits) r VARS_LIMIT is the compile time constant that defines the absolute maximum size of the variable table. The product must be recompiled and redistributed to increase this absolute capacity. The combined sum of the VARS and VARS_LOC limits must be less than or equal to the value VARS_LIMIT. VARS_LOC U16 (limits) rw The VARS_LOC limit determines the maximum number of local variables that can be defined.
System Debug Command Specifications :-Exit ENVL[IST] Examples %cmdebug > env autoignore true Set the environment variable AUTOIGNORE to TRUE. $nmdebug > env cmdlinesubs true Set the variable CMDLINESUBS to TRUE. This enables command line substitutions, that may have been disabled while macros were being read in from a file. Limitations, Restrictions none ENVL[IST] Displays the current values for environment variables.
System Debug Command Specifications :-Exit ENVL[IST] By default, all variables are listed. group The environment variables are logically organized in groups. When listed, the variables can be filtered by group; that is, only those variables in the specified group is displayed.
System Debug Command Specifications :-Exit ERR win win win win win win win win win win rw r r r r rw r r r r MARKERS NMPW PW PWO PWS SHOW_CCTL VW VWO VWS ZW : : : : : : : : : : STR LCPTR LCPTR SPTR U32 BOOL LPTR SPTR U32 U32 = = = = = = = = = = 'ULINE' SYS $a.702d6c SYS $a.702d6c $00702d6c $a FALSE $0.0 $00000000 $0 $0 Display all window-related environment variables.
System Debug Command Specifications :-Exit ERRD[EL] Parameters errmsg The error message that is to be pushed onto the error stack. This message must be entered as a string expression (that is, a quoted string literal, a string function or macro result). Examples $nmdat > err "Illegal negative parameter value" Push a custom user error message onto the error stack. Limitations, Restrictions The error stack is implemented as a ring, with a total of 10 elements.
System Debug Command Specifications :-Exit ERRL[IST] Syntax ERRL[IST] [ALL] Parameters By default, only the most recent (set) of errors are displayed. If the special option ALL is specified, all sets of errors are displayed. ALL Examples $nmdat > dv a.234e0 Display error. Check ERRLIST for details. (error #3800) $nmdat > errl $47: Display error. Check ERRLIST for details. (error #3800) $47: data read access error (error #805) $47: READ_CMWORD bad address: $ VIRT a.
System Debug Command Specifications :-Exit E[XIT] E[XIT] Exits/resumes execution of user program. Syntax E[XIT] E[XIT] Same as CONTINUE (in Debug) Exit program (in DAT) Same as the C[ONTINUE] command in Debug. For DAT, this command exits the DAT program.
System Debug Command Specifications :-Exit E[XIT] 162 Chapter 4
System Debug Command Specifications Fx-LOG 5 System Debug Command Specifications Fx-LOG Specifications for the System Debug commands continue to be presented in this chapter in alphabetical order. Window command specifications are presented in chapter 7, "System Debug Window Commands." System Debug tools share the same command set. A few commands, however, are inappropriate in either DAT or Debug.
System Debug Command Specifications Fx-LOG Fx (format) DAT only The following DAT commands cannot be used in Debug: CLOSEDUMP Closes a dump file DEBUG Enters Debug; used to debug DAT DPIB Displays a portion of the Process Information Block DPTREE Displays the process tree DUMPINFO Displays dump file information GETDUMP Reads in a dump tape to create a dump file OPENDUMP Opens a dump file PURGEDUMP Purges a dump file Fx (format) Formats a specified data structure.
System Debug Command Specifications Fx-LOG Fx (format) the element value. PAB Print packed array of boolean as a bit string. NOPAB Print packed array of boolean as an array index followed by the element value. ARCH For selected MPE/XL architect types, print the data in the "expected" fashion. NOARCH Do no special formatting for MPE/XL architected types.
System Debug Command Specifications Fx-LOG Fx (format) $nmdebug > FT "StudentRecord" MAP RECORD NAME : NAMESTR ; ( 0.0 @ 10.0 ) ID : INTEGER ; ( 10.0 @ 4.0 ) YEAR : CLASS ; ( 14.0 @ 1.0 ) NUMGRADES: GRADERANGE ; ( 15.0 @ 1.0 ) GRADES : GRADESARRAY ; ( 18.0 @ 28.0 ) END ; RECORD Size: 40 bytes Display the structure of StudentRecord and print a component map. $nmdebug > FT "StudentRecord.grades" ARRAY [ GRADERANGE ] OF INTEGER $nmdebug > FT "graderange" 1 ..
System Debug Command Specifications Fx-LOG Fx (format) [ 9 ]: 0 [ a ]: 0 END This is what the first element of the StudentArray data looks like when formatted as if it were a StudentRecord. $nmdebug > fv data "StudentRecord.Name" 'Bill' $nmdebug > fv data "StudentRecord.Year" SENIOR $nmdebug > fv data "StudentRecord.Grades[3]" 4e MPE XL Operating System Examples We can also look at individual items of a data structure as the above examples depict. $nmdebug > symopen symos.pub.
System Debug Command Specifications Fx-LOG Fmm (freeze) CM_RESVD4 CM_RESVD3 CM_RESVD2 CM_RESVD1 END : : : : 0 0 0 0 Format the data in the cm_global field of the PIB for the current PIN. That is, format what the pointer points to. $nmdebug > fv pib(pin) "pib_type.cm_global^.cm_info" CRUNCHED RECORD CM_INFO_INT : c END Format the data in the cm_info record of the cm_global record. $nmdebug > ft "pib_type.cm_global^.
System Debug Command Specifications Fx-LOG Fmm (freeze) Syntax FC FCG FCP FCLG FCLP FCS FCU logaddr [bytelength] logaddr [bytelength] logaddr [bytelength] logaddr [bytelength] logaddr [bytelength] logaddr [bytelength] fname logaddr [bytelength] FCA FCAX cmabsaddr cmabsaddr FDA dstoff FVA virtaddr Program file Group library Account library Logon group library Logon account library System library User library CM absolute CST CM absolute CST CM data segment [bytelength] Virtual address Parameters l
System Debug Command Specifications Fx-LOG Fmm (freeze) For CM, the current executing logical segment number and the current executing logical file are used to build a LCPTR. The search path used for procedure name lookups is based on the command suffix letter: Full search path: FC NM: PROG, GRP, PUB, USER(s), SYS. CM: PROG, ``GRP, PUB, LGRP, LPUB, SYS. FCG Search GRP, the group library. FCP Search PUB, the account library. FCLG Search LGRP, the logon group library.
System Debug Command Specifications Fx-LOG FINDPROC FCU lib1 204c FCU lib2.testgrp test20+1c0 If the file name is not fully qualified, the following defaults are used: Default account: the account of the program file. Default group: the group of the program file. dstoff A data segment address (specified as DST.OFFSET) of the data segment to be frozen in memory. The segment remains frozen until it is explicitly unfrozen (see UDA command).
System Debug Command Specifications Fx-LOG FOREACH This command dynamically loads a NM procedure from any NM library. The complete executable System Object Module containing the named procedure is loaded. This command is implemented by calling the HPGETPROCPLABEL intrinsic. (Refer to the MPE/iX Intrinsics Reference Manual for additional information.) If no error message is printed, the user can assume the command succeeded. The LOADINFO command may be used to verify that the library was loaded.
System Debug Command Specifications Fx-LOG FOREACH order to restrict/convert the values in the list to a specific desired type: foreach j:S16 '1 2 3+4 5' {wl j } If the type specification is omitted, the type ANY is assumed. value_list This is a quoted string (or string variable) that contains a list of values (expressions). The cmdlist is evaluated once for every expression in the list. The list may contain string and or numeric expressions.
System Debug Command Specifications Fx-LOG FPMAP FPMAP Reinitializes CM FPMAP symbolic procedure name access. Syntax FPMAP Initialization of CM FPMAP symbolic procedure names is automatic in System Debug. The FPMAP command is typically used to "pick up" new libraries that have been dynamically loaded (through LOADPROC or SWITCH intrinsics) since the original program execution.
System Debug Command Specifications Fx-LOG FUNCL[IST] ? Matches any alphabetic character. # Matches any numeric character. The following are valid name pattern specifications: @ Matches everything; all names. pib@ Matches all names that start with "pib". log2##4 Matches "log2004", "log2754", and so on. The following regular expressions are equivalent to the patterns with wildcards that are listed above: `.*` `pib.*` `log2[0-9][0-9]4` By default, all functions are displayed.
System Debug Command Specifications Fx-LOG GETDUMP NAME USE PARMS DESC EXAMPLE PAGE Page eject after each function definition. Useful for paged (listfile) output. NOPAGE No special page ejects. If none of the options above are specified, the NAME is displayed by default. If any options are specified, they are accumulated to describe which fields are printed. Examples %cmdebug > funcl List all functions.
System Debug Command Specifications Fx-LOG GETDUMP Syntax GETDUMP dumpfile [ ldevlist ] GETDUMP dumpfile [ DIR ] This command is used to restore the contents of a tape created by the DUMP utility onto disk. Once restored, the dump must be opened by the OPENDUMP command for access by the DAT program. A tape request for dumptape is generated; a message appears on the system console informing the operator of the request.
System Debug Command Specifications Fx-LOG GETDUMP Dump Tape Contents -----------------PIM00 MEMDUMP VM001 VM002 VM003 VM004 VM014 4.0 48.0 39.1 0.6 0.1 16.4 0.6 Kbytes Mbytes Mbytes Mbytes Mbytes Mbytes Mbytes This dump will require approximately 62.1 Mbytes (#257913 sectors) of disc space. $nmdat > The above example displays the directory of a dump tape and an estimate of the amount of disk space required to restore the dump. $nmdat > getdump examp Please mount dump volume #1.
System Debug Command Specifications Fx-LOG H[ELP] much of the dump has been read in by printing a dot every time it transfers 10% of each file in the dump file from tape to disk. When the dump has been fully restored, the amount of disk space saved due to data compression is displayed. Limitations, Restrictions DUMP stores data on dump tapes in compressed form. Prior to DAT A.01.18, dumps were restored on disk in expanded form, possibly resulting in extremely large dump files. As of DAT A.01.
System Debug Command Specifications Fx-LOG H[ELP] listed above. The options available depend upon the class of the topic. In general, the following options are available: options USE/NOUSE Short summary of usage. PARMS/NOPARMS Information about parameters. DESC/NODESC General description. EXAMPLE/NOEXAMPLE Examples. ACCESS/NOACCESS Access rights information. Everything. ALL The following table indicates which combination of topics/options are valid (invalid options are ignored).
System Debug Command Specifications Fx-LOG H[ELP] recw bytew STRING Continuous character output. The number of words to be displayed per line when the code is not disassembled. Defaults are 4 (CM) and 8 (NM). The width in bytes of the displayed values when the code is not disassembled. Used to determine the output spacing, and may be 1, 2 (CM default) or 4 (NM default). DESC: The DC (Display Code) command displays CM or NM program file code.
System Debug Command Specifications Fx-LOG HIST[ORY] HIST[ORY] Displays the history command stack. Syntax HIST[ORY] option Parameters option The history stack can be displayed three ways: ABS With absolute command numbers. Default. REL With relative command numbers. UNN Without command numbers. Examples %nmdebug > hist $1 = 1836/4 + 12 $2 ddb+224,20 $3 = [s-12] $4 c $5 ss $6 while [s] <> 0 do ss $7 dr status $8 ss By default, the history stack is displayed with absolute command numbers.
System Debug Command Specifications Fx-LOG IF IF If condition evaluates to TRUE, then execute all commands in cmdlist, else execute all commands in cmdlist2. Syntax IF condition THEN command IF condition THEN { cmdlist } IF condition THEN command1 ELSE command2 IF condition THEN { cmdlist } ELSE command2 IF condition THEN command1 ELSE { cmdlist2 } IF condition THEN { cmdlist } ELSE { cmdlist2 } Parameters condition A logical expression to be evaluated.
System Debug Command Specifications Fx-LOG IGNORE the other clause disregarded. This implies that the clauses may be syntactically illegal, but the errors are not discovered until they are executed. Note that in the following examples, entire clauses are bogus, but not detected: $nmdebug > if TRUE then wl "good" else XXXXXXXXXXXXXXXXXX good $nmdebug > if FALSE then XXXXXXXXXXXXXXXX else wl "good" good IGNORE Protects the next command (list) from error bailout.
System Debug Command Specifications Fx-LOG INITxx %nmdebug > ignore; {wl 111; wl 22q; wl 333; wl 444} $111 Expected a number, variable,function, or procedure (error #3720) undefined operator is:"22q" $333 $444 In this example, the IGNORE command is used to protect the entire command list that follows it. Even though the second command in the list produces an error, execution of the rest of the list continues. By default, the option LOUD is assumed, and all resulting error messages are displayed.
System Debug Command Specifications Fx-LOG INITxx DAT when a dump is corrupted. The command is also provided for the experienced Debug user. For the INITNM command, the NM register set is loaded from the specified location. It is assumed that the location contains data in the form of an interrupt stack marker (ISM) which is the default, or in the form of processor internal memory (PIM). Not all of the machine's registers are found in an ISM.
System Debug Command Specifications Fx-LOG KILL on the current NM regs. The NM regs are interpreted as containing values used by the emulator/translator. Examples $ nmdebug > initnm 0.tcb(20) Initialize the native mode registers from the indicated virtual address. % cmdebug > initcm 40153014 Initialize the CM registers from the interrupt marker that starts at address 40153014. The process was most likely in the emulator (or else the CM state would be stored in the CMGLOBALS area of the PIB).
System Debug Command Specifications Fx-LOG LEV LEV Sets the current environment to the specified stack level in the stack markers. Syntax LEV [number] LEV [number] [interrupt_level] The LEV command changes the current environment to the environment at the specified stack level. All commands accurately reflect the register values that are in effect a level change. Windows also reflect the new level values.
System Debug Command Specifications Fx-LOG LEV Parameters number The stack level number at which the environment should be set. interrupt_level The interrupt level number at which the environment should be set. If this parameter is omitted, the current interrupt level is assumed. This parameter is valid only for NM. Examples %cmdebug > PROG * 0) PROG 1) PROG 2) SYS tr % 0.1421 % 0.2004 % 0.253 % 25.
System Debug Command Specifications Fx-LOG LIST 0) SP=402211e8 RP=25d.00015d38 * 1) SP=402211e8 RP=25d.00015c74 export stub: 25c.00005d98 2) SP=40221180 RP=25c.00006b1c 3) SP=40221100 RP=25c.00000000 (end of NM stack) average+$b0 ?average+$8 processstudent+$74 PROGRAM+$300 Use the LEV command to set the environment to stack level 1, interrupt level 1. A stack trace confirms that the environment has been correctly changed.
System Debug Command Specifications Fx-LOG LISTREDO Parameters filename The file name for the list file that is to be opened. If the file already exists, it is automatically purged (without warning), and reopened new. If omitted, the status of the current list file is displayed. Examples %cmdebug > list junk1 Open a new list file named junk1 and activate it (ON). All Debug input/output is automatically recorded in this file until it is explicitly deactivated (LIST OFF) or closed (LIST CLOSE).
System Debug Command Specifications Fx-LOG LOADINFO Lists information about the currently loaded program and libraries. Syntax LOADINFO For Debug, this command displays the list of files that are loaded by the current process. Both CM and NM libraries and program files are included in the list. This list is automatically updated as the process dynamically loads NM and CM libraries. For DAT and SAT, this command displays the list of files for which symbol name and address information is available.
System Debug Command Specifications Fx-LOG LOADPROC LOADPROC Debug only Dynamically loads a specified CM procedure from a logically specified CM library selector. Syntax LOADPROC procedurename libselect Parameters procedurename The name of the procedure to be loaded. libselect The logical library from which the procedure is to be loaded.
System Debug Command Specifications Fx-LOG LOC variable NONLOCALVARS may be changed so that local variables are accessible to any macro called after a local variable has been defined. (Refer to the ENV command). Local variables are automatically deleted when the macro in which the variable was defined finishes execution. Parameters var_name The name of the local variable being defined.
System Debug Command Specifications Fx-LOG LOCL[IST] Examples $nmdat > loc temp a.c000243c Define local variable temp to be the address a.c000243c. By default, this variable is of type LPTR (long pointer), based on the value. $nmdebug > loc count=1c Define local variable count to be the value 1c. $nmdebug > loc s1:str="this is a string" Define local variable s1 to be of type STR (string) and assign the value "this is a string".
System Debug Command Specifications Fx-LOG LOG Matches any numeric character. # The following are valid name pattern specifications: @ Matches everything; all names. pib@ Matches all names that start with "pib". log2##4 Matches "log2004", "log2754", and so on. The following regular expressions are equivalent to the patterns with wildcards that are listed above: `.*` `pib.*` `log2[0-9][0-9]4` By default, all local variables are listed.
System Debug Command Specifications Fx-LOG LOG LOG, entered alone, displays the state of the log file, including the file name, if open, and the current status (ON/OFF). LOG filename opens the specified file and activates (turns on) the log file. If another log file is already opened, it is first closed (saved) before the new file is opened. This command does an implicit LOG ON LOG ON and LOG OFF can be used to activate/deactivate-activate the currently opened log file.
System Debug Command Specifications Fx-LOG LOG 198 Chapter 5
System Debug Command Specifications M-X 6 System Debug Command Specifications M-X Specifications for the System Debug commands continue to be presented in this chapter in alphabetical order. Window command specifications are presented in chapter 7, "System Debug Window Commands." System Debug tools share the same command set. A few commands, however, are inappropriate in either DAT or Debug. These commands are clearly identified as "DAT only" or "Debug only" on the top of the page that defines the command.
System Debug Command Specifications M-X M (modify) DAT only The following DAT commands cannot be used in Debug: CLOSEDUMP Closes a dump file DEBUG Enters Debug; used to debug DAT DPIB Displays a portion of the Process Information Block DPTREE Displays the process tree DUMPINFO Displays dump file information GETDUMP Reads in a dump tape to create a dump file OPENDUMP Opens a dump file PURGEDUMP Purges a dump file M (modify) Debug only Privileged Mode: MA, MD, MCS, MZ, MSEC Modifies the conte
System Debug Command Specifications M-X M (modify) Parameters offset MA, MDB, MQ, MS only. The CM word offset that specifies the relative starting location of the area to be modified. logaddr MC, MCG, MCP, MCLG, MCLP, MS, MCU only. A full logical code address (LCPTR) specifies three necessary items: • The logical code file (PROG, GRP, SYS, and so on.). • NM: the virtual space ID number (SID). CM: the logical segment number. • NM: the virtual byte offset within the space.
System Debug Command Specifications M-X M (modify) MCP Search PUB, the account library. MCLG Search LGRP, the logon group library. MCLP Search LPUB, the logon account library. MCS Search SYS, the system library. MCU Search USER, the user library. For a full description of logical code addresses, refer to the section "Logical Code Addresses" in Chapter 2. fname MCU only. The file name of the NM user library.
System Debug Command Specifications M-X M (modify) pointer. realaddr MZ only. The real mode memory address to be modified. ldev.off MSEC only. The logical device number (LDEV) and byte offset of the data on disk to be displayed. This address is entered in the form ldev.byteoffset. count MA, MC, MD, MDB, MS, MQ: The number of CM 16-bit words to be modified. MC, MV, MZ: The number of NM 32-bit words to be modified. If omitted, a single line of values is modified.
System Debug Command Specifications M-X MAC[RO] Dot "." terminates modifications. The modifications for DST 1.34 through 1.37 have been successfully completed. %cmdebug > mq-30,6 % Q-30 = ".P" % Q-27 = "UB" % Q-26 = ".S" % Q-25 = "YS" % Q-24 = ".." % Q-23 = ".." %27120 %52502 %27123 %54523 %177772 %7 := := := := := := "AB" 'CD' u16("EF") [q-2] !s + (1000-[db+22]/2) Modify 6 words starting at Q-%30. The current values are displayed in ASCII and octal (current output base).
System Debug Command Specifications M-X MAC[RO] (MACVER), a help string (MACHELP), and a keyword string (MACKEY). See the MACLIST command. Reference counts are maintained for macros. Each time a macro is invoked, the reference count for the macro is incremental. (Refer to the MACREF and MACLIST commands.) Two special commands are provided to assist with the debugging and support of macros. See the MACECHO and MACTRACE commands.
System Debug Command Specifications M-X MAC[RO] ( parm1def parm2def, parm3def, parm4def parm5def ) Parameter names have the same restrictions as macro names. Names must begin with an alphabetic character and are restricted to thirty-two (32) characters, that must be alphanumeric, or an underscore (_), a single quotation (`or'), or a dollar sign ($). Longer names are truncated (with a warning). Names are case insensitive.
System Debug Command Specifications M-X MAC[RO] declarations that precede the macro body. Any number of these options can be specified in any order. Each option is specified as a keyword, followed by a (case sensitive) string value: MACVER = version_string MACKEY = keyword_string MACHELP = help_string The following are typical valid declarations for macro options: MACVER = 'A.00.
System Debug Command Specifications M-X MAC[RO] The macro is entered interactively across several lines. The unterminated left curly brace causes the interpreter to enter multi-line mode. The prompt changes to indicate that the interpreter is waiting for additional input. The nesting level, or depth of unterminated curly braces, is displayed as part of the prompt. The macro starline is called with the parameter 5, and a line of five stars is printed.
System Debug Command Specifications M-X MAC[RO] to return the functional result of twice the input parameter. Note how the macro is used as a function, as an operand in an expression. %nmdat > mac triple (p1:INT) { return p1*3 } %nmdat > wl triple(2) $6 %nmdat > wl triple (double (1+2)) $12 Macro function triple is similar to macro function double defined above. Note that macros (used as functions) can be nested within expressions.
System Debug Command Specifications M-X MAC[RO] $nmdat > This macro has two optional parameters: num that defaults to the value 123, and loud that defaults to TRUE. The macro is written in a manner that allows it to be invoked as a function to return a value that is the double of the input parameter. The second parameter controls the display of an output line, and therefore this macro might also be used as a command to calculate a value and display the result.
System Debug Command Specifications M-X MACD[EL] $nmdat > double 3 true the double of $3 = $6 $nmdat > double ( (1+2)*3 ) the double of $9 = $12 $nmdat > double the double of $123 = $246 $nmdat > double 6,false $nmdat > Limitations, Restrictions Refer to ENV MACROS and ENV MACROS_LIMIT. These environment variables determine the number of macros that can be created. Current limit of 32 characters in a macro name or macro parameter name. Current limit of five parameters per macro.
System Debug Command Specifications M-X MACECHO matching and regular expressions. The following wildcards are supported: @ Matches any character(s). ? Matches any alphabetic character. # Matches any numeric character. The following are valid name pattern specifications: @ Matches everything; all names. pib@ Matches all names that start with "pib". log2##4 Matches "log2004", "log2754", and so on.
System Debug Command Specifications M-X MACECHO The following wildcards are supported: @ Matches any character(s). ? Matches any alphabetic character. # Matches any numeric character. The following are valid name pattern specifications: @ Matches everything; all names. pib@ Matches all names that start with "pib". log2##4 Matches "log2004", "log2754", and so on. The following regular expressions are equivalent to the patterns with wildcards that are listed above: `.*` `pib.
System Debug Command Specifications M-X MACECHO machelp = 'triples the parameter "input"' { return input *3 } Assume that the macros listed above have been defined. A few of the macros use local variables inefficiently, for the purpose of demonstration. $nmdat > driver $2 When a macro is called, the commands in the macro body are typically executed silently. They are not displayed as they are being executed. In this example, macro driver executes silently, and only the expected macro output is displayed.
System Debug Command Specifications M-X MACL[IST] In this example, echoing is disabled for all macros. Since the level parameter is not specified, the default of disabled is assumed. Execution of the macro driver is silent once again. $nmdat > macecho min 1 $nmdat > driver min > if parm1 < parm2 then return parm1 else return parm2 min > return parm2 $2 $nmdat > macl @ echo macro min echo In this example, echoing is enabled for macro min. The command lines for macro min are displayed, indented.
System Debug Command Specifications M-X MACL[IST] log2##4 Matches "log2004", "log2754", and so on. The following regular expressions are equivalent to the patterns with wildcards that are listed above: `.*` `pib.*` `log2[0-9][0-9]4` By default, all macros are listed. options Display Options Special options can be specified to control the level of detail that is presented for each macro definition.
System Debug Command Specifications M-X MACL[IST] VER=version Display only those macros that contain the specified version in their MACVER version string. The parameters keyword and version are entered as a single word, or a quoted text string. The interpreter will search for an exact occurrence of the pattern within the specified string. Keyword and version comparisons are case sensitive. REF Display the macro reference counts. ECHO Display only macros that have ECHO set.
System Debug Command Specifications M-X MACL[IST] fnum : INT , [detail : INT / U16 = $5] , [error_parm : STR = 'pad'] ) Display the PARMS (parameters) for macro fs_disc_alloc_parms $nmdat > macl fs_table all nobody macro fs_table : UNKN/U16 = $0 ( entry_ptr : PTR , table : STR , [detail : INT / U16 = $1] , [field_name : STR = ] ) machelp = 'Print the table and optionally returns the field value' mackey = 'MXFS HP Q_FS_X_NM EL FS TABLE PLFD GDPD GUFD LACB PACB MVT' +^S 'FMAVT AFT FLAB' macver = 'A.00.
System Debug Command Specifications M-X MACL[IST] macro io_timer_list machelp = 'Formats the timer request list.' macro start_timer machelp = 'Sets variable cpustart to current value of HPCPUSECS CI' + 'variable.' macro stop_timer machelp = 'Sets variable cputime to current value of HPCPUSECS CI' + 'variable - variable cpustart.' macro timer machelp = 'Times events and then prints elapsed cpu time.' List all macros that match the pattern "@timer@", and display the MACHELP string for each macro.
System Debug Command Specifications M-X MACL[IST] macro fs_ufid_str : STR/STR = mackey = 'MXFS HP Q_FS_X_NM EL FS GUFD UFID STR' macro fs_ufid_to_gufd : PTR/LPTR = $0.0 mackey = 'MXFS HP Q_FS_X_NM EL FS UFID TO GUFD' List all macros, but only those that contain the keyword GUFD within the macro's keyword string, defined with the MACKEY option. List the names and the keyword string for those macros. $nmdat > macl fs_fname_to_gufd all macro fs_fname_to_gufd : PTR/LPTR = $0.
System Debug Command Specifications M-X MACL[IST] $nmdat > macl format@ ref macro format ref macro format_job ref macro format_raw_table ref macro format_timer ref = = = = 0 1 0 3 Display the REF (reference counts) for all macros that match the pattern "format@". Macro format_job has been called one time, and macro format_timer has been called three times.
System Debug Command Specifications M-X MACREF • Command %11 sets the environment variable term_loud to FALSE. This prevents subsequent System Debug output from being displayed on the terminal. We capture the output in the list file (macros), but we do not want to watch all of the output on the terminal. • Command %12 contains the MACLIST command. All attributes of all currently defined macros are displayed. The PAGE option causes each macro to start on a new page.
System Debug Command Specifications M-X MACREF matching and regular expressions. The following wildcards are supported: @ Matches any character(s). ? Matches any alphabetic character. # Matches any numeric character. The following are valid name pattern specifications: @ Matches everything; all names. pib@ Matches all names that start with "pib". log2##4 Matches "log2004", "log2754", and so on.
System Debug Command Specifications M-X MACREF Assume that the macros listed above have been defined. A few of the macros use local variables inefficiently, for the purpose of demonstration. $nmdat > macl macro driver macro inc macro min macro triple @ ref ref = ref = ref = ref = #0 #0 #0 #0 The MACLIST command is used to display the current reference counts for all macros. At this point, the reference counts for all macros are zero.
System Debug Command Specifications M-X MACTRACE Limitations, Restrictions The macro reference count is incremental at macro entry, after parameter type checking, but before actual execution of the macro body. The actual macro execution may result in errors and be terminated. Reference counts, therefore, indicate the number of times the macro has been called (not the number of times that the macro has been successfully executed to completion). MACTRACE Controls the "tracing" of macro execution.
System Debug Command Specifications M-X MACTRACE 1 All tracing is disabled. (Default) 2 Macro entry is displayed. 3 Macro entry and exit are displayed. 4 Macro entry, input parameter values, macro exit, and functional return values are displayed.
System Debug Command Specifications M-X MAP ( num : ANY = $1 ) <-- exit macro: inc $2 : U16 = $2 The MACTRACE command is used to enable macro tracing for macro inc at trace level 3. Now, every time macro inc is invoked, trace information is displayed. Since the trace level for this macro is set to level 3, entry into the macro is displayed, along with the parameter value(s) at entry, and exit from the macro is displayed, along with the function return value.
System Debug Command Specifications M-X MAP Syntax MAP filename [option] The MAP command allows a file to be accessed (displayed or modified) in virtual space by other System Debug commands. This command is useful for analyzing dump files generated by subsystems that are not part of the dump created by the DUMP utility. Parameters filename The file name of the file to map into usable address space.
System Debug Command Specifications M-X MAPL[IST] MAPL[IST] Lists the specified file(s) that have been opened with the MAP command. Syntax MAPL[IST] [pattern] Parameters pattern The file name(s) of the mapped files to be listed. If no file name is given, all currently mapped files are displayed. This parameter can be specified with wildcards or with a full regular expression. Refer to appendix A for additional information about pattern matching and regular expressions.
System Debug Command Specifications M-X MODD MODD DAT ONLY Modification delete. Deletes a modification entry specified by index number. Syntax MODD [index @ ] The MODD command is used to delete a modification which has been applied to an opened dump. Parameters index The index number of the modification entry which is to be deleted. @ @, the wildcard character, can be used to delete all currently defined entries. Examples $nmdat > modl Current TEMPORARY dump modification(s): 1) VIRT $b.
System Debug Command Specifications M-X MODL Syntax MODL [index @ ] The MODL command is used to list all current modifications which have been applied to an opened dump. Parameters index The index number of the modification entry to display. @ The wildcard symbol "@" can be used to display all entries. If no parameter is entered, the default is that all entries are displayed.
System Debug Command Specifications M-X MPSW MPSW Privileged Mode Modifies the NM processor status word (PSW). Exercise a bit of care with this command. Syntax MPSW bit_string Parameters bit_string A string of characters that indicates which bits in the PSW are to be modified. The letters listed below represent individual fields: lower case implies turn the bit off, and uppercase implies turn the bit on. All unreferenced bits remain unchanged.
System Debug Command Specifications M-X MR I External, power failure, & low-priority machine check interruption enable System Debug displays this register in two formats: IPSW=$6ff0b=jthlnxbCVmrQpDI The first value is a full 32-bit integer representation of the register. The second format shows the value of the special named bits. An uppercase letter means that the bit is on while a lowercase letter indicates that the bit is off.
System Debug Command Specifications M-X MR DB The stack base relative word offset of DB. DBDST The DB data segment number. CIR The current instruction register. CMPC The full logical CM program counter address. • Only the offset part can be modified. • CIR will also be modified. Q The Q register word offset, DB relative. S The S register word offset, DB relative. SDST The stack data segment number. STATUS The CM status register. • The segment number portion cannot be modified.
System Debug Command Specifications M-X MR The following registers are known as the General Registers. Table 6-1.
System Debug Command Specifications M-X MR The following registers are known as the Space Registers. They are used for short pointer addressing: Table 6-3.
System Debug Command Specifications M-X MR Table 6-4. Control Registers Name Alias Access Description none PCQF dM PC queue (PCOF.PCSF) front none PCQB dM PC queue (PCOB.PCSB) back none PC dM PCQF with priv bits set to zero none PRIV dM Low two order bits (30,31) of PCOF.
System Debug Command Specifications M-X MR Table 6-5.
System Debug Command Specifications M-X NM Examples %cmdebug > mr cmpc CMPC=PROG %0.01754 := prog(0.1762) Modify the contents of the CM program counter. Only the offset portion of the CM logical address can be modified. It is not possible to change the logical segment number portion. Note that this also modifies CIR, the current instruction register. %cmdebug > mr x 0 X=000123 := 0 Zero the X register. $nmdebug > mr pc pc + 4 pc=0021d7b4 := 0021d7b8 Advance the PC (this changes pcq front and pcq back).
System Debug Command Specifications M-X OPENDUMP Parameters none Examples %cmdebug > nm $nmdebug > Switch from cmdebug to nmdebug. Limitations, Restrictions none OPENDUMP DAT only Opens a dump file. Syntax OPENDUMP file This command opens the specified dump file previously restored to disk by the GETDUMP command. An implicit DUMPINFO STATE command is then performed to show the user the state of the dump.
System Debug Command Specifications M-X PAUSE Limitations, Restrictions none PAUSE Pauses (puts to sleep) a process for the specified number of seconds. Syntax PAUSE n Parameters The number of seconds the process is to be suspended. Negative values are treated the same as positive ones. n Examples $nmdebug > pause #10 Suspend the process for (decimal) 10 seconds.
System Debug Command Specifications M-X PROCLIST time, a PIN of zero is used (A PIN of 0 refers to the dispatcher). If the keyword ANYSTATE is specified, the current state of the process for pin is not verified before the process switch occurs. If this keyword is absent, the current state of the process for pin must be "alive" for the command to succeed. ANYSTATE Examples $nmdat > pin 8 Switches the process pointers and the registers to PIN 8.
System Debug Command Specifications M-X PROCLIST For procedure symbols, only the procedure part is used (file name and module are excluded from the pattern match). This parameter can be specified with wildcards or with a full regular expression. Refer to appendix A for additional information about pattern matching and regular expressions. The following wildcards are supported: @ Matches any character(s). ? Matches any alphabetic character. # Matches any numeric character.
System Debug Command Specifications M-X PROCLIST DATALOCAL List local data in the System Object Module. LSTPROC List exported level 1 procedures in the LST. LSTEXPORTSTUB List export stubs in the LST. ANY detail List for any type of symbol in the System Object Module. This parameter specifies the level of detail given when listing the symbols. The default value is 0 which lists the address and name of the symbol. Negative values are converted to positive ones.
System Debug Command Specifications M-X PROCLIST The following values determine the parameter check level (CHECK): 0 No checking. 1 Check symbol type descriptor only. 2 Level 1, plus check number of arguments passed. 3 Level 2, plus check type of each argument. The following values determine the execution level required to call this entry point (XLEAST): 0,1,2,3 The minimum execution level needed. The following letters indicate the value of various bits associated with each symbol.
System Debug Command Specifications M-X PROCLIST $nmdebug > The above example lists all of the symbols for the current program file (GRADES.DEMO.TELESUP). The file contains many symbols, including millicode routines added to the program file by the Link Editor. The output was interrupted by striking the Control-Y key. $nmdebug > proclist processstudent@,,allproc 4d5.5b53 processstudent.highscore 4d5.5c3f processstudent.lowscore 4d5.
System Debug Command Specifications M-X PSEUDOMAP a.3f8140 a.374428 a.2ea29b FOPEN HPFOPEN P__FOPENERR The final example requests a list of all procedures in the system NL that have the uppercase letters "FOPEN" in their name. Limitations, Restrictions Unless a file equation is used, the size of the output file defaults to 20000 records of 80 bytes each. The LSTPROC and LSTEXPORTSTUB options are not implemented. A PROCLIST for CM procedures and symbols is not implemented.
System Debug Command Specifications M-X PSEUDOMAP information. space_id Associate symbols from local_file with this space. Any attempt to convert a symbol address in this space to an address uses the local file for symbol name lookups. loaded_fname Bind this file name to all symbols from space space_id. All of the commands and functions that deal with file names (for example, the NMPATH function and NM program window) use this file name any time a file name is to be associated with a space ID.
System Debug Command Specifications M-X PSEUDOMAP export stub: a.0061575c arg_regs+$28 9) SP=40224050 RP=a.005984bc nm_switch_code+$9b4 a) SP=40223f20 RP=a.0042a5bc SWT_RETURN (switch marker frame) b) SP=40223bc0 RP=a.00597274 switch_to_cm+$8c4 c) SP=402239d0 RP=a.007499b8 tm_cms_type_mgr+$8bc d) SP=40223668 RP=a.0072ee44 FREAD+$3c8 e) SP=40221780 RP=a.006ac858 readcmd+$1dc f) SP=40221560 RP=a.006abcc8 ?readcmd+$8 export stub: 74.00006274 10) SP=402211d8 RP=74.000068e0 11) SP=40221178 RP=74.
System Debug Command Specifications M-X PURGEDUMP (switch marker frame) SP=40223bc0 RP=a.00597274 switch_to_cm+$8c4 SP=402239d0 RP=a.007499b8 tm_cms_type_mgr+$8bc SP=40223668 RP=a.0072ee44 FREAD+$3c8 SP=40221780 RP=a.006ac858 readcmd+$1dc SP=40221560 RP=a.006abcc8 ?readcmd+$8 export stub: 74.00006274 ci_cmd_io+$34 10) SP=402211d8 RP=74.000068e0 main_ci+$a0 11) SP=40221178 RP=74.00007450 PROGRAM+$218 12) SP=40221130 RP=74.
System Debug Command Specifications M-X REDO Parameters dumpfile The name of the dump file to be deleted. Examples %cmdat > purgedump EXAMP Purge dump file EXAMP. Limitations, Restrictions none REDO Reexecutes a command from the history command stack after optionally editing the command. Syntax REDO [cmd_string ] REDO [history_index] System Debug uses the same REDO editing commands as the REDO command supported by the MPE XL Command Interpreter.
System Debug Command Specifications M-X REGLIST Limitations, Restrictions Upon initial entry into System Debug, the command stack is empty, since no prior command has been executed. If the REDO command is entered as the command, a blank command is provided for editing. The MPE XL Command Interpreter allows an edit string to be specified on the REDO command line. This feature is not supported in System Debug. REGLIST Lists the registers into a file in USE file format.
System Debug Command Specifications M-X RET[URN] was created by the STORE command. Based on the selector (MACROS or VARIABLES), all currently defined macros or variables are immediately discarded, and are replaced entirely by the contents of the STORE file. The current limits (as set by ENV MACROS or ENV VARS and ENV VARS_LOC) are automatically changed to the limits that were in effect at the time the STORE file was created.
System Debug Command Specifications M-X SET When the RETURN command is encountered, a value is returned, and the macro execution is immediately terminated. Additional commands within the macro that follows an executed RETURN command are never executed. Parameters value The value to be returned by the macro. If value is not specified, the default macro return value is returned.
System Debug Command Specifications M-X SET SET [ MOREON MOREOFF ] SET [ DEF[AULT] ] The SET command allows a simplified method of setting a few of the many environment variables. See the ENV command for more information. The SET command entered alone, without parameters, displays all current settings. Parameters O[CT] | % Set the current default input conversion base and the current output display base to octal.
System Debug Command Specifications M-X SET env echo_subs FALSE env echo_use FALSE env fill "zero" env filter '' env hexupshift FALSE env justify "right" env list_paging TRUE env list_pagelen #60 env list_title & '"Page: " list_pagenum:"d" " " version " " date " " time' env list_width #80 env lookup_id "LSTPROC" env markers "uline" env multi_line_errs 2 env nm_inbase $ env nm_outbase $ env pstmt TRUE env term_loud TRUE env term_paging FALSE env term_width #79 Examples $nmdat > SET Display all curren
System Debug Command Specifications M-X SETxxx SETxxx The SETxxx commands are predefined aliases for other commands. Syntax SETALIAS SETENV SETERR SETLOC SETMAC SETVAR alias alias alias alias alias alias for for for for for for ALIAS ENV ERR LOC MAC VAR SHOWxxx The SHOWxxx commands are predefined aliases for other commands.
System Debug Command Specifications M-X STORE single step into the system NL or SL (or any portion of code he/she does not have access to view), Debug stops single stepping and free-runs the process (for example, proceed as if the CONTINUE command had been issued). For native mode processes, Debug stops processing as soon as it returns from the inaccessible code. For compatibility mode processes, the process continues to run until it encounters a breakpoint.
System Debug Command Specifications M-X SYMCLOSE automatically saved in the STORE file, and is reestablished when this file is restored with the RESTORE command. Parameters MACROS Specifies that macros are to be stored. This keyword can be abbreviated and entered in uppercase or lowercase. VARIABLES Specifies that variables are to be stored. This keyword can be abbreviated and entered in uppercase or lowercase. filename The file name where the macros or variables are to be stored.
System Debug Command Specifications M-X SYMF[ILES] Examples $ nmdat > symfiles OS SYMOS.PUB.SYS GRADTYP GRADTYPE.DEMO.TELESUP $nmdat > symclose SYMOS $nmdat > Closes the file SYMOS. Limitations, Restrictions none SYMF[ILES] Lists all open symbolic data type files and their symbolic names. Syntax SYMF[ILES] Parameters none Examples $ nmdat > symf OS SYMOS.PUB.SYS GRADTYP GRADTYPE.DEMO.TELESUP List all the symbolic data type files currently opened by the program.
System Debug Command Specifications M-X SYMINFO Syntax SYMINFO [symname] [option] [offset] [length] This command is generally only useful to System Debug developers and people debugging the contents of the symbolic data type files. Parameters symname The symbolic name under which the symbolic data type file is referenced. If the symbolic name is omitted, then the last file which was opened with SYMOPEN is selected. option One of the following options can be specified.
System Debug Command Specifications M-X SYML[IST] Limitations, Restrictions none SYML[IST] Lists information for the specified symbol name in an opened symbolic data type file. Syntax SYML[IST] [pattern] [symname] [option] Parameters pattern The symbol names that are to be listed. This parameter can be specified with wildcards or with a full regular expression. Refer to appendix A for additional information about pattern matching and regular expressions.
System Debug Command Specifications M-X SYMOPEN ALL Display both type and constant names (default). Examples $nmdebug > SYMLIST @,GRADTYP CLASS GRADERANGE GRADESARRAY NAMESTR STUDENTRECORD MAXGRADES MAXSTUDENTS MINGRADES MINSTUDENTS TYPE TYPE TYPE TYPE TYPE CONST CONST CONST CONST ENUMERATED TYPE SUBRANGE ARRAY STRING RECORD INTEGER $a INTEGER $5 INTEGER $1 INTEGER $1 Print out the all type and constant declarations for the symfile GRADTYP.
System Debug Command Specifications M-X SYMPREP Parameters filename The file name of the symbolic data type file. The file must contain symbolic debug records. symname The symbolic name under which the symbolic data type file is referenced in the formatter commands. If this parameter is omitted, the file name will be used as the symbolic name. Examples $nmdat > symopen SYMOS.PUB.SYS OS $nmdat > Open the symbolic file SYMOS.PUB.SYS and assign the symbolic name OS to it.
System Debug Command Specifications M-X T (translate) Limitations, Restrictions Before a program file is ready to be prepared with SYMPREP, be sure that the following steps have been followed: 1. The types must be compiled with the $SYMDEBUG 'xdb'$ option. 2. The program containing the types must have at least one statement. 3. The relocatable library generated by the compiler must be run through LINKEDIT.
System Debug Command Specifications M-X T (translate) TCS cmlogaddr System library TCA TCAX cmabsaddr cmabsaddr Absolute CST Absolute CSTX Parameters offset TA, TDB, TQ, TS only. The CM word offset that specifies the relative CM address to be translated. dseg.off TC, TD only. The data segment and word offset to be translated. cmlogaddr TC, TCG, TCP, TCLG, TCLP, TCS only. A full logical code address (LCPTR) specifies three necessary items: • The CM logical code file (PROG, GRP, SYS, and so on).
System Debug Command Specifications M-X T (translate) TCLG Search LGRP, the logon group library. TCLP Search LPUB, the logon account library. TCS Search SYS, the system library. TCU Search USER, the user library. For a full description of logical code addresses, refer to the section "Logical Code Addresses", in chapter 2. cmabsaddr TCA, TCAX only. A full CM absolute code address specifies three necessary items: • Either the CST or the CSTX. • The absolute code segment number.
System Debug Command Specifications M-X TERM Translate CM logical address SYS %22.5007. %cmdebug > tc fgetkeyinfo+1146 SYS % 32.2031 = CST % 33.2031 = VIRT $21.a4c32 FGETKEYINFO+%1146 (KSAMSEG1) start: %663 entry: %702 proclen: %2145 seglen: %37204 Translator Node Addresses: CM prev: SYS %32.2030 NM prev: TRANS $21.7da7a0 CM next: SYS %32.2034 NM next: TRANS $21.7da7c4 Translate CM logical address fgetkeyinfo+1146.
System Debug Command Specifications M-X TR[ACE] TERM NEXT If we own the terminal semaphore, release it and allow the next process waiting for it to enter the debugger. Our process is then queued at the end of the list for the semaphore. Related environment variables: TERM_LOCKING. Examples $(3b) nmdebug > = 2 + 2 $4 PIN 4c is waiting to enter Debug $(3b) nmdebug > term list Current term owner: 3b Next pin: 1a # Waiting pins: 2 A processes has just notified us that it is waiting to enter Debug.
System Debug Command Specifications M-X TR[ACE] reached, System Debug automatically switches to the stack of the last running process and continues the stack trace. This feature in no way implies that the routines on the ICS were invoked on behalf of the last running process. If the dispatcher is currently running, there is no last running process, so the stack trace stops when the base of the ICS is found. Parameters level The desired maximum depth for the stack trace.
System Debug Command Specifications M-X TR[ACE] * 0) SP=40221180 RP=115.
System Debug Command Specifications M-X TR[ACE] 2) SP=40221200 RP=f4.00139630 P_WRITELN+$9c Display only stack level 2. $nmdebug > tr PC=a.006777fc trap_handler * 0) SP=40221338 RP=a.002a1fec conditional+$ac 1) SP=40221338 RP=a.000a5040 hpe_interrupt_marker_stub --- Interrupt Marker $nmdebug > tr,ism PC=a.006777fc trap_handler * 0) SP=40221338 RP=a.002a1fec conditional+$ac 1) SP=40221338 RP=a.000a5040 hpe_interrupt_marker_stub --- Interrupt Marker 2) SP=402211e8 RP=25d.
System Debug Command Specifications M-X TR[ACE] The above examples specifies the FULL option to display the value of the X, P, and status registers, and the DELTA-Q value. Translated Code Examples Break at: NM [1] TRANS 24.00854ea4 PASCAL'LIBRARY2:?P'WRITESTR $nmdebug > tr ,dual PC=24.00854ea4 PASCAL'LIBRARY2:?P'WRITESTR NM* 0) SP=40221290 RP=a.0067320c outer_block+$e8 NM 1) SP=402210a0 RP=a.00000000 inx_A0000+$14 (end of NM stack) The above example shows Debug stopping at a breakpoint.
System Debug Command Specifications M-X TRAP CM * 0) SYS % 27.253 SWITCH'TO'NM'+%4 (Mitroc CM 1) SYS % 25.7765 ATTACHIO+%325 (Mitroc CM 2) SYS % 22.17700 DEALLOCATE+%30 (Mitroc CM 3) SYS % 3.5540 F'CLOSE'+%4321 (MitroC CM 4) switch marker (Mitroc NM d) SP=40201208 RP=a.000a07bc ?CM_SWITCH+$30 export stub: a.0044c3e4 switch_to_cm+$c30 NM e) SP=40201018 RP=a.006f3c84 fclose_nm+$74c NM f) SP=40200db0 RP=a.006e62a8 FCLOSE+$368 NM 10) SP=40200aa8 RP=a.0036a0b0 fs_proc_term+$a4 NM 11) SP=40200a00 RP=a.
System Debug Command Specifications M-X TRAP Arms/disarms/lists various traps that are monitored by Debug. Syntax TRAP [LIST] TRAP [trap-name] [option] Parameters trap-name Traps can be classified into several classes. The trap names for each class are presented together. In general, this parameter specifies which trap to arm, disarm, or list. Only enough characters to make the name recognizable are required.
System Debug Command Specifications M-X TRAP Trace Traps The currently defined trace events are based on compiler generated breakpoints. These breakpoints are inserted into the code by the compilers only if the symbolic debug compiler option is used. If the debugger arms any of these events, it stops at the indicated event. BEGIN_PROCEDURE Stop at the entry to procedure. END_PROCEDURE Stop at the exit from procedure. LABELS Stop at all labels.
System Debug Command Specifications M-X TRAP $nmdebug > trap XLIBRARY XARITHMETIC XSYSTEM XCODE BRANCH BEGIN_PROCEDURE END_PROCEDURE LABELS STATEMENTS ENTER_PROGRAM EXIT_PROGRAM DISABLED DISABLED DISABLED DISABLED DISABLED DISABLED ARMED DISABLED DISABLED DISABLED DISABLED Show the status of the traps. $nmdebug > c Branch Taken at: 6a8.00005d84 processstudent+$60 to: 6a8.000056b8 lr_wa_10 $nmdebug > c Branch Taken at: 6a8.00005708 lr_wa_1+$8 to: 6a8.
System Debug Command Specifications M-X UF 00015d30 00015d34 00015d38 00015d3c 00015d40 00015d44 average+$a8 average+$ac average+$b0 average+$b4 average+$b8 average+$bc ebff0595 4bda3f89 4bdf3ed9 6bfd0000 e840c000 37de3f31 BL LDW LDW STW BV LDO divoI,31 -60(0,30),26 -148(0,30),31 29,0(0,31) 0(2) -104(30),30 /* <-- this routine. /* <-- PC is here $nmdebug > dr r29 R29=$0 $nmdebug > mr r29 4 R29=$0 := $4 $nmdebug > c ignore The above example starts by arming the XARI trap.
System Debug Command Specifications M-X UF UFCAX cmabsaddr Absolute CSTX UFDA dst.off UFVA virtaddr [bytelength] CM data segment Virtual address These unfreeze commands actually decrement a system freeze count. The segment or pages may remain frozen if their freeze count is still positive. Parameters logaddr A full logical code address (LCPTR) specifies three necessary items: • The logical code file (PROG, GRP, SYS, and so on). • NM: the virtual space ID number (SID).
System Debug Command Specifications M-X UF UFC Full search path: NM: PROG, GRP, PUB, USER(s), SYS. CM: PROG, GRP, PUB, LGRP, LPUB, SYS. UFCG Search GRP, the group library. UFCP Search PUB, the account library. UFCLG Search LGRP, the logon group library. UFCLP Search LPUB, the logon account library. UFCS Search SYS, the system library. UFCU Search USER, the user library. For a full description of logical code addresses, refer to the section "Logical Code Addresses" in chapter 2.
System Debug Command Specifications M-X UNMAP UCA GRP, PUB, LGRP, LPUB, SYS UCAX PROG dst.off A data segment address (specified as dst.offset) of the data segment to be unfrozen in memory (see the FDA command). virtaddr The starting virtual address of the page(s) that are to be unfrozen in memory. (Refer to the FVA command.) Virtaddr can be a short pointer, a long pointer, or a full logical code pointer. bytelength This parameter is valid only for nmdebug.
System Debug Command Specifications M-X UPD 2 3 DTCDUMP2.DUMPUSER.SUPPORT MYFILE.MYGROUP.MYACCT 1001.0 1005.0 Bytes = c84 Bytes = 1004 $nmdebug > unmap 2 $nmdebug > unmap mapindex("dtcdump.dumpuser.support") $nmdebug > mapl 1 DTCDUMP.DUMPUSER.SUPPORT 3 MYFILE.MYGROUP.MYACCT 1000.0 1005.0 Bytes = 43dc Bytes = 1004 Close the file DTCDUMP2.DUMPUSER.SUPPORT. Also, close the file DTCDUMP.DUMPUSER.SUPPORT (by calling the MAPINDEX function that returns the file index number 1).
System Debug Command Specifications M-X USE Syntax USE USE [filename] [count] USENEXT count USE [CLOSE][ALL | @] USE, entered alone, displays the current open command file(s) and the current line position within the file (current-record/total records). USE filename opens the specified file, executes all commands from that file, and then closes the file. An optional count parameter is used to read a particular number of lines from the file before returning to interactive user input.
System Debug Command Specifications M-X VAR Opens the file macros and executes the first 10 lines from the file, then returns to normal interactive input. %cmdebug > usenext 5 Use the next five lines from the current USE file. %cmdebug > use USE file "macros" OPEN: 15/76 Displays the current status of open command files. The file macros is opened and positioned at line 15 out of 76 lines. %cmdebug > use close Closes the current open USE file. Note that other nested USE files may still be left open.
System Debug Command Specifications M-X VAR S16 Signed 16-bit U32 Unsigned 32-bit S32 Signed 32-bit S64 Signed 64-bit SPTR Short pointer LPTR Long pointer PROG Program logical address GRP Group library logical address PUB Account library logical address LGRP Logon group library logical address LPUB Logon account library logical address SYS System library logical address USER User library logical address TRANS Translated CM code virtual address EADDR Extended address SADDR Sec
System Debug Command Specifications M-X VARD[EL] var s1:str this is a string Display all currently defined user variables. Limitations, Restrictions Refer to ENV VARS, ENV VARS_LOC, and ENV VARS_LIMIT. These environment variables determine the maximum number of variables that can be defined. VARD[EL] Variable delete. Deletes the specified user-defined variable(s). Syntax VARD[EL] pattern Parameters pattern The name of the variable(s) to be deleted.
System Debug Command Specifications M-X VARL[IST] Limitations, Restrictions none VARL[IST] Variable list. Lists the value(s) for the specified user-defined variable(s). Syntax VARL[IST] [pattern] Variables are always listed in alphabetical order. Parameters pattern The name of the variable(s) to be listed. This parameter can be specified with wildcards or with a full regular expression. Refer to appendix A for additional information about pattern matching and regular expressions.
System Debug Command Specifications M-X W (write) Display all currently defined user variables. %nmdebug > varl sl@ var save : 1ptr = %302.120 var s1 : str = this is a string Display all variables that begin with the letter "s". Limitations, Restrictions Variables are not currently listed in sorted alphabetical order. W (write) Writes a list of values, with optional formatting, to output.
System Debug Command Specifications M-X W (write) zero fill, and field width for that value. value1[:fmtspec1] value2[:fmtspec2] ... A format specification is a string list of selected format directives, with individual directives separated by commas or blanks: "directive1,directive2 directive3 ..." The following table lists the supported format directives; they can be entered in uppercase or lowercase: + Current output base ($, #, or % prefix displayed). -< Current output base (no prefix).
System Debug Command Specifications M-X W (write) string inputs). The F directive (fixed field width) selects a fixed field width based on type of the value and the selected output base. Fixed field widths are listed in the following table: Table 6-6. Fixed Field Widths hex($,H) dec(#,D) oct(%,0) ascii(A,N) S16,U16 4 6 6 2 $32,U32 8 10 11 4 S64 16 20 22 8 SPTR 8 10 11 4 LPTR Class 8.8 10.10 11.11 8 EADDR Class 8.16 10.20 11.22 12 STR field width = length of the string.
System Debug Command Specifications M-X W (write) LPUB, SYS, USER, TRANS). For example: pc:"+.-, w4.8, r.l, b.z" The following default values are used for omitted format directives. Note that the default format directives depend on the type of value to be formatted: value type default format ---------- -------------- STR, BOOL U16,S16,U32,S32,S64 SPTR LPTR ACPTR LCPTR CST PROG CSTX GRP PUB LGRP LPUB SYS USER TRANS EADDR SADDR - R B M U + R B M U + R Z F U +.- R.L B.Z +.- R.L B.Z +.- R.L B.Z +.- R.L B.
System Debug Command Specifications M-X W (write) $nmdat > var number:u32=123 $nmdat > wl $123 $nmdat > wl 123 $nmdat > wl #291 $nmdat > wl 291 $nmdat > wl $123 $nmdat > wl $nmdat > wl U32 000123 number number:"-" number:"#" number:"d" number:"f,r" number:"r,w6,- z" number:"r,w6,- z t" Several examples of formatting an unsigned 32-bit value.
System Debug Command Specifications M-X WHELP Several examples of formatting a long pointer. $nmdat > wcol 6 $nmdat > wcol 3 $nmdat > wcol 6; w 12345; wcol 2; wl 2 2 $12345 $nmdat > wl '2':'c2' '6':"c6" "4":'c4' "<-- column control":"c8" 2 4 6 <-- column control $nmdat > w "123456 <-- column control";wl " ":"c1", " ":"c3", " ":"c5" 2 4 6 <-- column control These examples demonstrate how the output buffer can be positioned to a specific column number.
System Debug Command Specifications M-X WHILE WHILE While condition evaluates to TRUE, executes all commands in cmdlist. Syntax WHILE condition DO cmdlist Parameters condition A logical expression to be evaluated. cmdlist A command list (or a single command) executed while condition evaluates to TRUE. Examples $nmdebug > var n 7 $nmdebug > while n > 0 do {wl n; var n n-1} 7 6 5 4 3 2 1 A simple while loop example.
System Debug Command Specifications M-X XLD XLD Closes files opened with the PSEUDOMAP command. Syntax XLD localfile The XLD command removes the specified file previously mapped with the PSEUDOMAP command. The file name given is that of the local disk file, not the loaded file name that was associated with it. File names must be fully qualified. Related commands: PSEUDOMAP, MAPLIST Parameters The fully qualified name of the file to be unmapped. localfile Examples $nmdat> xld store.abuild00.
System Debug Command Specifications M-X XLD 296 Chapter 6
Symbolic Formatting Symbolic Access 7 Symbolic Formatting Symbolic Access Most of the time spent in the debugging of programs and the analysis of system dumps is in the interpretation of data found in memory images. The symbolic formatter provides a powerful and efficient way of referencing this data symbolically and displaying it using its declared type(s). Regardless of the source language, all data are formatted using a Pascal-style syntax.
Symbolic Formatting Symbolic Access $ VIRT 7b8.40200040 $ 00000000 00000000 00000000 00000000 $nmdebug > dv addr1,6,a $ VIRT 7b8.40200010 A .... Bill .... .... .... .... This leaves to the user the task of matching the displayed data to the declared types. When more complicated data structures are involved, it is easy to see that the process of matching the raw data to the corresponding high-level declarations could become exceedingly cumbersome.
Symbolic Formatting Symbolic Access Creating and Accessing Symbol Definitions Creating and Accessing Symbol Definitions Before data structures can be accessed symbolically, their definitions must be made known to System Debug. This subsection describes how the symbolic definitions are generated and how they are subsequently made known to System Debug. The final result is a program file containing symbolic type information. Such files are referred to as symbolic data type files or simply symbolic files.
Symbolic Formatting Symbolic Access Creating and Accessing Symbol Definitions HPLinkEditor/XL (HP32650-xx.yy.zz) (c) Hewlett-Packard Co 1986 LinkEd> link from=ygradtyp.demo.telesup;to=gradtyp.demo.telesup LinkEd> exit : Preprocess the Program File with PXDB The program file produced by LINKEDIT must be run through a utility called PXDB. This program preprocesses the symbolic debug information for more efficient access during symbolic debugging. :PXDB.PUB.SYS gradtyp.demo.telesup Copying gradetyp.demo.
Symbolic Formatting Symbolic Access The Path Specification $nmdat > SYMFILES GRADTYP GRADTYP.DEMO.TELESUP $nmdat > In summary the following steps must be performed before a symbolic data type file is ready for use by System Debug: 1. Construct a small program which contains all type declarations to be made available to System Debug. The program must have at least one executable statement, and the type declarations must all appear at the level of the outer block. 2.
Symbolic Formatting Symbolic Access The Path Specification to override the stored tag field if alternate variants are to be displayed. Multiple tag values are specified as a simple list: vartagvalue [ ,... ] For each variant after the typename [selector] specification, a vartagvalue can be given to specify the desired variant. Multiple tag values may be given, separated by commas, to specify tags for nested variants. The order of the tags should match the order of the variants in the type declaration.
Symbolic Formatting Symbolic Access Using the Symbolic Formatter The next two sections contain a variety of examples illustrating the use of path specifications. Using the Symbolic Formatter This section gives several examples of how to use the symbolic formatting facility. Formatting Types Refer to the beginning of this chapter to review the type declarations used in this section.
Symbolic Formatting Symbolic Access Using the Symbolic Formatter $nmdebug > FT "maxgrades" INTEGER $nmdebug > FT "class" ( SENIOR, JUNIOR, SOPHOMORE, FRESHMAN ) Display various types. Notice that path specification is not limited to a simple type or constant name, but rather it may consist of any composite path specification. The examples in the following pages include variant records and pointers.
Symbolic Formatting Symbolic Access Using the Symbolic Formatter A variable map is required to find the location of a variable at any given time. These maps are generated as part of the program listing by the language compilers. Each compiler has a unique compiler option, which must be specified in order for the variable map to be included in the listing. For Pascal, the option is $TABLES ON$.
Symbolic Formatting Symbolic Access Using the Symbolic Formatter $nmdebug > fv addr1 "StudentRecord.Year" SENIOR $nmdebug > fv dp+8 "Person.sex" FEMALE The above examples show how any field within a record may be formatted. Note that the address supplied is always the address for the beginning of the record, not the address of the field of interest. As with field selection, array elements can also be selected. The command $nmdebug > fv addr1 "StudentRecord.
Symbolic Formatting Symbolic Access Using the Symbolic Formatter RECORD INT : 4a554e4b END We assume the first variant for the CoerceRec and print out the data as an integer value. We now ask for an explicit variant: $nmdat > FV addr2 "CoerceRec,1" RECORD CH : 'JUNK' END We may explicitly ask for the data to be formatted in any of the possible variants. In the above example we asked for variant 1 (as characters).
Symbolic Formatting Symbolic Access Using Symbolic Access Using Symbolic Access Symbolic access references data through the use of symbolic names declared at the source code level, rather than through addresses and offsets to specific memory locations. This facility allows users to access stored information in a more natural way, leaving the drudgery of translating symbolic names to storage locations up to System Debug. The chart below summarizes the symbolic functions currently available.
System Debug Windows 8 System Debug Windows System Debug offers a powerful and efficient set of screen-oriented "windows," which allow dynamic visual monitoring of the program environment. The System Debug windows are initially disabled, but can be easily toggled on (WON) and off (WOFF). Users can continue to use all normal interactive commands while the windows are displayed.
System Debug Windows A Typical Screen Display of CM Windows • The command window provides space for the user to type interactive commands. Each mode (CM and NM) may have a different set of windows enabled. When one switches from mode to mode, the windows change to reflect the current mode. Note that there is only one set of windows; the user may easily specify which windows are enabled in a given mode. This means that virtual window #1 in CM is the same window as virtual window #1 in NM.
System Debug Windows A Typical Screen Display of NM Windows A Typical Screen Display of NM Windows The following is a typical System Debug screen display with activated NM windows: GR$ ipsw=0004000f=jthlnxbCvmrQPDI priv=3 pc=000000f9.
System Debug Windows Window Updates VJ,and UJ commands.) • Windows can be returned to the "home" position. This is defined as the location displayed in the window when it was created. Some windows (virtual, real, ldev) allow the user to redefine the "home" location of the window. (Refer to the wH command.) • Window values can be displayed in several output bases. Individual windows can be displayed in any selected radix, such as octal, decimal, hex, or ASCII. (Refer to the wR command.
System Debug Windows Window Real/Virtual Modes command.) Window Real/Virtual Modes System Debug automatically tracks the translation bits in the processor status word (IPSW). There are two IPSW bits of interest, the C and D bits. These bits indicate if the machine performs "code" and "data" translation, respectively. If the C bit is off, the machine interprets all code addresses as REAL addresses rather than virtual addresses.
System Debug Windows Gr - The NM General Registers Window • Q - The current Q value (stack frame), expressed in CM words, relative to DB. • S - The current S value (TOS), expressed in CM words, relative to DB. • CMPC - The current CM program location, expressed as a logical code address. This includes the library (PROG, GRP, PUB, LGRP, LPUB, SYS), logical segment number, and program counter in CM words, relative to the base of the current code segment. • CIR - The current instruction register.
System Debug Windows P (cmP) - The CM Program Window SR$ isr=0000000a ior=00000000 iir=0000400e eiem=ffffffff rctr=00000000 sar=02 sr0=0000000a 0000000a 000000f8 00000000 sr4=00000101 000000f8 0000000b 0000000a pcq=00000101.00005d27 00000101.00005d2b tr0=005e5200 00615200 eirr=00000000 pid1=0077(W) 007c(W) 007d(W) 0000(W) iva=00090000 itmr=5d801c34 ccr=80 window banner line • SR$ - Abbreviation for the window and the current output display. This window is always displayed in hexadecimal.
System Debug Windows P (nmP) - The NM Program Window window. • PROG 0.1667 - The logical code address for the CM program counter. If the window does not contain the CM program counter, then the value is the logical code address of the first line in the window. In our example, the CM program counter is currently at a program file, logical segment number 0, at an offset of 1667 words. Other possible logical segment types are GRP, PUB, LPUB, LGRP, SYS. • (E) - The segment is (E) emulated or (T) translated.
System Debug Windows Program Windows for Object Code Translation window banner line • nmP $ - Abbreviation for the window and the current output display radix for the window. • PROG f9.5d18 - The logical code address for the first line in the window. The program window is aimed at the PROGram file, space: $f9, offset: $5d18. • GRADES.DEMO.TELESUP/ - The name of the file which contains the displayed code. • processstudent - The name of the level 1 procedure that appears in the first line of the window. • .
System Debug Windows Q - The CM Stack Frame Window 005210:N [2] FOPEN+%6 000600 .. ZERO, 005211: [3] FOPEN+%7 051451 S) STOR 005212:N FOPEN+%10 140060 .0 BR 005213: FOPEN+%11 140003 .. BR 005214:N [1] ?FSOPEN 170412 .. LRA nmP$ TRANS 24.
System Debug Windows S - The CM Stack Window address shown at the left side of the window is relative to the indicated base. (Refer to the QM command.) • QDST - QDST is the data segment for the Q window. In most cases, this is the same as the stack DST. This window may be aimed away from the stack, in which case this value indicates the DST being viewed. • Level 0 - The current stack level. (Refer to the LEV command).
System Debug Windows G - The Group (of User) Window • - Indicates the location of Q. The stack marker (at Q-3, Q-2, Q-1, Q) is typically underlined. (Refer to the ENV MARKER command.
System Debug Windows U - The User Windows • $d ($29) nmdebug > - The System Debug prompt appears in the command window. U - The User Windows User-defined windows are custom named pointers. G Group:1 U1 count U2 students U3 *currnum % DB+5 DB+2 Q-5 % 000004 A ".." % 000002 000000 "Bi" 000132 000000 "ll" 000253 000000 ".." 060301 window banner line • Refer to the G (Group) window discussion for a description of the banner line.
System Debug Windows Z - The Memory Window • V0, V1, V2 $ - Abbreviation for the virtual window, the virtual window number, and the current output display radix for offsets. At present, up to eight virtual windows may be defined. The current virtual window is indicated by flagging the window abbreviation in half-bright inverse video. In this display, V2 is the current virtual window. • STUDENTS, Virtual, NUM - The name which was supplied when the window was created (or with the VN command).
System Debug Windows TX- The Text Windows 00000020:00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 window banner line • LDEV $ - Name of the LDEV window and the current output display radix. • DISP - The full address of the current position of the LDEV window. (Byte offsets in the window itself contain only the low-order 32 bits.) • HOME - The home address which was originally specified in the LW command when the window was defined.
System Debug Windows TX- The Text Windows "shifted" to view data that would otherwise be off the end of the screen. • LINE - The line number (file record number) at which the window is aimed. • FNAME - The name of the file at which the text window is aimed. window body line(s) • text - The ASCII contents of the text file(s). • "." - Dots signify lines past the end-of-file count. • "x" - X's signify an error while reading the data for that line.
System Debug Window Commands 9 System Debug Window Commands System Debug window commands are most easily understood when they are grouped into two types of commands. The commands in this chapter are ordered as follows: • General Window Operations: RED Redraw the entire screen display. WDEF Restore default window sizes. WGRP Switch to the specified group of user windows. WOFF Turn the windows off. WON Turn the windows on. • Window Operations: B Backwards - scroll window backwards.
System Debug Window Commands L Ldev window. NMP NM program window (from CM). P Program window (current mode). Q CM frame window, Q relative. R CM registers window. S CM stack window, S relative. SR NM special registers window. TX Text file window. U User-defined window. V Virtual address window. Z Real memory window. Put window abbreviations and window operations together to form the desired command. For example: PB Program Backward - scroll program window backward.
System Debug Window Commands RED w represents the window abbreviation and X represents the command or operation. For example, the window forward command is wF. The syntax diagram for wF lists all the window types for which the command is applicable. If a window abbreviation is omitted, then the command does not apply to that window. RED Redraws the entire screen display of windows. Syntax RED Parameters none Examples %cmdebug > red Redraws the screen.
System Debug Window Commands WGRP Limitations, Restrictions Virtual and real window sizes default to 0 lines, so that they are effectively killed (VK, ZK) by this command. WGRP Changes to the specified group of user-defined windows. Syntax WGRP [group_number] Parameters group_number The number of the group which is to be displayed in the group window. If no value is entered, group 1 is assumed. Examples %cmdebug > wgrp 2 Switch the group window to display group number 2.
System Debug Window Commands WON Limitations, Restrictions none WON Windows ON. Turns on the windows. If windows are already on, redraws them. Syntax WON Parameters none Examples %cmdebug > won Limitations, Restrictions none wB Window back. Scrolls the specified window backwards.
System Debug Window Commands wB Parameters The number of words or lines to scroll backwards. If omitted, the window is scrolled back the default amount based on the following table: amount Table 9-1.
System Debug Window Commands wC wC Window current. Marks the specified window as the current window. Many user window (U), text window (TX), and virtual window (V) commands operate on the current window. Syntax UC [win_number] VC [win_number] TXC [win_number] Parameters win_number The window number for a specific user window (U), text window (TX), or virtual window (V). If win_number is omitted, then the current window remains flagged as the current window.
System Debug Window Commands wE GD UD VD ZD LD TXD [win_number] [win_number] [win_number] Group window User window Virtual window Real memory window LDEV window Text window This command causes the window to be removed from the screen temporarily until the window is enabled again (see the wE command). Current window attributes (such as size, address, contents, and so on) are retained between disable/enable calls.
System Debug Window Commands wF ZE LE TXE [win_number] Real memory window LDEV window Text window This command enables a window that was previously disabled with the wD command. The original attributes of the window are retained between disable/enable calls. Parameters win_number The window number for a specific user window (U), text window (TX), or virtual window (V). If win_number is omitted, then the current window is used.
System Debug Window Commands wF TXF [amount] [win_number] Text window Parameters amount The number of words or lines to scroll forward. If win_number is omitted, then the window is scrolled forward the default amount based on the following table: Table 9-2.
System Debug Window Commands wH Limitations, Restrictions none wH Window home. Returns a window to its original location. Syntax RH GRH SRH CM registers window NM general registers window NM special registers window PH CMPH NMPH QH SH Program window, current mode CM program window NM program window CM frame window - Q relative CM stack window - S relative GH UH [win_number] Group window User window VH ZH LH TXH [virtaddr] [win_number] [realaddr] [ldev.
System Debug Window Commands wI Examples %cmdebug > PH Home the program window. $nmdebug > VH PSP-40 4 Change the home address for virtual window 4 to be the value of PSP-40. Jump the window to the new home address. %cmdebug > UH 3 Home user window 3. Limitations, Restrictions none wI Window information. Prints information about the indicated windows. This command is defined for the virtual (V) and text (TX) windows.
System Debug Window Commands wJ Examples $nmdebug > vi 2 V2: HOME= a.00040017 CURR= a.00040017 Lines=3 Display information about virtual window number 2. $nmdebug > txi TX0: TDEBUG.CMDEBUG.OFFICIAL REC=50 COL=1 EOF=534d LINE=34c FLIMIT=534d TX1: LIST.DEBUG.WORK REC=85 CCTL COL=a1 EOF=1000 LINE=1 FLIMIT=1000 Display information about all of the text windows. Limitations, Restrictions The format of output may be changed without notice. wJ Window jump. Jumps window to the specified address.
System Debug Window Commands wJ QJ SJ [dst.off] [dst.off] CM Frame, CM Stack, VJ ZJ LJ TXJ [virtaddr] [win_number] [realaddr] [Ldev.off] [record_number] Virtual window Real memory window LDEV window Text window Q relative S relative Parameters logaddr PJ, PJG, PJP, PJLG, PJLP, PJS, PJU, and PJV control the current program window, which is based on the current mode (CM or NM). CMPJ, CMPJG, CMPJP, CMPJLG, CMPJLP, and CMPJS control the CM program window.
System Debug Window Commands wJ which is based on the current space registers (SRs). For CM, the current executing logical segment number and the current executing logical file are used to build an LCPTR. The search path used for procedure name lookups is based on the command suffix letter: Full search path: PJ NM: PROG, GRP, PUB, USER(s), SYS CM: PROG, GRP, PUB, LGRP, LPUB, SYS PJG Search GRP, the group library. PJP Search PUB, the account library. PJLG Search LGRP, the logon group library.
System Debug Window Commands wJ PJA 23.2644 Implicit CST 23.2644 PJAX 5.3204 Implicit CSTX 5.3204 • As a full absolute code pointer (ACPTR) PJA CST(2.200) Explicit CST coercion PJAX CSTX(2.200) Explicit CSTX coercion PJAX logtoabs(prog(1.20)) Explicit absolute conversion The search path used for procedure name lookups is based on the command suffix letter: PJA GRP, PUB, LGRP, LPUB, SYS PJAX PROG dst.off The stack frame (Q) and top of stack (S) windows can be aimed at any data segment and offset.
System Debug Window Commands wK Jump the CM program window to the entry point for the fopen procedure. Note that since we are in native mode, the CMADDR function must be used to look up the address of CM procedures. %cmdebug > nmpj cmtonmnode(?fopen) Jump the NM program window to the nearest translated code node point associated with the CM procedure fopen. Refer to appendix C for a discussion of CM object code translation, node points, and breakpoints in translated CM code. %cmdebug > SJ 12.
System Debug Window Commands wL Parameters win_number The window number for a specific user window (U), text window (TX), or virtual window (V). If win_number is omitted, then the current window is used. The current user window is marked by an asterisk, and the current virtual and text windows are marked in inverse video. Examples %cmdebug > PK Kill the (current mode) program window. %cmdebug > PL 6 Bring back the program window. Remember, killing a window sets its length to zero.
System Debug Window Commands wL Parameters numlines Set the window size to this number of lines. If no value is given, the default is the initial size for the specified window. win_number The window number for a specific user window (U), text window (TX), or virtual window (V). If win_number is omitted, then the current window is used. The current user window is marked by an asterisk, and the current virtual and text windows are marked in inverse video.
System Debug Window Commands wM wM Window mode. Changes the mode for the Q or S window. Syntax QM SM [addressmode] [signed] [addressmode] [signed] Parameters addressmode This parameter specifies the mode in which addresses are to be displayed. If no value is specified, DB is the default. The following values are allowed: DB Display address as DB-relative values (initial mode). DL Display address as DL-relative values. DST Display address as DST-base-relative values.
System Debug Window Commands wN wN Renames a virtual window or a user-defined window. Syntax UN VN [name] [win_number] [name] [win_number] User window Virtual window Parameters The name for this user window. Names are restricted to eight alphanumeric characters. name If the name is omitted, the following default names are used: Window Default Name USER (U) VIRTUAL (V) Virtual win_number The window number for a specific user window (U) or virtual window (V).
System Debug Window Commands wS CMPR NMPR QR SR GR UR VR ZR LR base base base base base base [win_number] base [win_number] base base CM program NM program CM frame, Q relative CM stack, S relative Group window User window Virtual window Real memory window Ldev window Parameters The desired representation mode for output values: base % or OCTAL Octal representation Decimal representation # or DECIMAL $ or HEXADECIMAL Hexadecimal representation ASCII ASCII representation This parameter can be abbre
System Debug Window Commands UWm Parameters amount This is the number of columns to shift the window. A positive value shifts the window right (view data past the right end of the screen). A negative value shifts the window left (view data past the left end of the screen). If no value is given, the window is shifted to column 1. win_number The window number for a specific text window (TX). If win_number is omitted, then the current window is used.
System Debug Window Commands UWm cmabsaddr UWCA, UWCAX only. A full CM absolute code address. This code address specifies three necessary items: Either the CST or the CSTX The absolute code segment number The CM word offset within the code segment Absolute code addresses can be specified in two ways: • As a long pointer (LPTR): UWCA 23.2644 Implicit CST 23.2644 UWCAX 5.3204 Implicit CSTX 5.3204 • As a full absolute code pointer (ACPTR): UWCA CST(2.200) Explicit CST coercion UWCAX CSTX(2.
System Debug Window Commands wW The search path used for procedure name lookups is based on the command suffix letter: UWCA GRP, PUB, LGRP, LPUB, SYS UWCAX PROG virtaddr UWV only. A Precision Architecture virtual address. Virtaddr can be a short pointer, a long pointer, or a full logical code pointer. realaddr UWZ only. A Precision Architecture real memory address. name The name for this user window. Names are restricted to eight alphanumeric characters.
System Debug Window Commands wW and two data lines). The size of the windows may be changed once they are created (Refer to the wL command.) Parameters virtaddr The virtual window can be aimed at any Precision Architecture space and offset address. Virtaddr can be a short pointer, a long pointer, or a full logical code pointer. name This is the name with which to label the virtual window being defined. If no name is specified, "Virtual" is used as a default.
System Debug Standard Functions 10 System Debug Standard Functions This chapter presents the full formal declaration for each of the standard functions which are defined in System Debug. All functions are callable from both DAT and Debug. All functions can be called from both Native Mode (NM) and Compatibility Mode (CM). Some functions, however, deal specifically with NM or CM attributes.
System Debug Standard Functions Name Type Description U16 : U16 Coerces an expression to unsigned 16-bit INT U32 : U32 Coerces an expression to unsigned 32-bit INT UTILITY Functions Name Type Description ASC : STR Converts an expression to an ASCII string BIN : INT Converts an ASCII string to binary value BITD : ANY Bit deposit BITX : ANY Bit extract BOUND : STR Tests for current definition of an operand CISETVAR : BOOL Sets a new value for a CI variable CIVAR : ANY Returns
System Debug Standard Functions Name Type Description NMNODE : TRANS NM Address of closest NM node point NMTOCMNODE : LCPTR CM address of closest NM node point OFF : U32 Extracts offset part of a virtual address PHYSTOLOG : LCPTR CM physical segment/map bit to logical RTOV : LPTR real to virtual SID : U32 Extracts the SID (space) part of a long pointer STOL : LPTR Short pointer to long pointer STOLOG : LCPTR Short pointer to logical code address VTOR : U32 Virtual to real VTOS
System Debug Standard Functions Name Type Description CMBPADDR : LCPTR Logical address of a CM breakpoint index CMBPINDEX : S16 Index number of a CM breakpoint address CMBPINSTR : S16CM Instruction at a CM breakpoint address CMENTRY : LCPTR Logical entry address of a CM procedure CMPROC : STR Returns the name of a CM procedure CMPROCLEN : U16 Returns the length of CM procedure CMSEG : STR Returns the CM segment name at logical address CMSTART : LCPTR Logical start address of CM pr
System Debug Standard Functions func abstolog Name Type Description STRPOS : U16 Locates a substring within a string STRRPT : STR String repeat STRRTRIM : STR Removes trailing blanks from a string STRUP : STR Upshifts a string STRWRITE : STR Builds a string from a value list SYMBOLIC Functions Name Type Description SYMADDR : U32 Returns the offset within a type to the specified symbolic field SYMCONST : ANY Returns the value of a declared constant SYMINSET : BOOL Tests for set
System Debug Standard Functions func asc Cmabsaddr must be a full CM absolute code address (ACPTR). For Example: CST(2.102) CST segment 2 offset 102 CSTX(1.330) CSTX segment 1 offset 330 LOGTOABS(cmpc) Explicit absolute conversion Examples %cmdebug > wl cmpc PROG %0.1273 %cmdebug > wl logtoabs(cmpc) CSTX %1.1273 %cmdebug > wl abstolog(cstx(1.1273)) PROG %0.1273 Absolute CM address CSTX 1.1273 is converted into logical address PROG %0.1273. %cmdebug > wl abstolog(cst(43.304)) SYS %32.
System Debug Standard Functions func asc specific output base, left or right justification, blank or zero fill, and field width. A format specification string is a list of selected format directives, optionally separated by blanks or commas in order to avoid ambiguity. "directive1 directive2, directive3 directive4 ...
System Debug Standard Functions func asc The F directive (fixed field width) selects a fixed field width based on the type of the value and the selected output base. Fixed field widths are listed in the following table: Types hex($,H) dec(#,D) oct(%,O) ascii(A,N) S16,U16 4 6 6 2 S32,U32 8 10 11 4 S64 16 20 22 8 SPTR 8 10 11 4 LPTR Class 8.8 10.10 11.11 8 EADDR Class 8.16 10.20 11.
System Debug Standard Functions func asc SYS, USER, TRANS). For example: pc:"+.-, w4.8, r.l, b.z" The following default values are used for omitted format directives. Note that the default format directives depend on the type of value to be formatted: value type ---------- default format -------------- STR, BOOL U16,S16,U32,S32,S64 SPTR LPTR ACPTR LCPTR CST PROG CSTX GRP PUB LGRP LPUB SYS USER TRANS EADDR SADDR - R B M U + R B M U + R Z F U +.- R.L B.Z +.- R.L B.Z +.- R.L B.Z +.- R.L B.Z +.- R.L B.Z +.
System Debug Standard Functions func asc $nmdat > wl asc(number, "r,w6,-,z") 000123 Several examples of formatting an unsigned 32-bit value. $nmdat > var s1="test" $nmdat > wl asc(s1) test $nmdat > wl asc(s1, "QS") 'test' $nmdat > wl asc(s1 "QO") "test" $nmdat > wl asc(s1 "t") STR test $nmdat > wl asc(s1 "w2") test $nmdat > wl asc(s1, "w2*4,r") test $nmdat > var curwidth 8 $nmdat > wl asc(s1 'wcurwidth, r QD') " test" Several examples of formatting a string. $nmdat > var long 2f.
System Debug Standard Functions func ascc func ascc Coerces an expression into a string value. Syntax ascc (value) Formal Declaration ascc:str (value:any) Parameters value An expression to be coerced. Its type can be anything except BOOL. This function takes the internal bit pattern for value and treats it as a sequence of ASCII characters.
System Debug Standard Functions func bin Limitations, Restrictions none func bin Converts a string expression to return a binary value. Syntax bin (strexp) Formal Declaration bin:any (strexp:str) Parameters strexp A string expression to be converted from ASCII into binary. Examples %cmdebug > wl bin("1+2") %3 The contents of the string "1+2" are evaluated as an expression, and the result (3) is converted into a binary value.
System Debug Standard Functions func bitd Syntax bitd (value position length target) Formal Declaration bitd:any (value:any position:s16 length:u16 target:any) Parameters value The value to deposit into the target. Its type is restricted to the INT and PTR classes. position This parameter specifies the starting bit position (positive value) or the ending bit position (negative value) of the deposit. Regardless of the size of the target, bit positions are always numbered from left to right.
System Debug Standard Functions func bitx Deposit the value 0 into the last two bits of XX. $nmdebug > wl bitd(3,-#1,2,xx) $c015381f Deposit the value 3 (11) into XX, ENDING at bit position 1. $nmdebug > wl bitd(2d,-#9,6,xx) $4b55381f Deposit the value 2d (101101) into XX, ending at bit position 9 with a length of 6 (start position would be 4). Limitations, Restrictions The value to be deposited is truncated as necessary on the left to fit within the field width of length.
System Debug Standard Functions func bool +---------------------------------------------------------------+ | | +---------------------------------------------------------------+ If a S16 or U16 value is passed, the format of the word (start/end positions) is as follows: 1 1 1 1 1 1 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 +-------------------------------+ | | +-------------------------------+ Examples This is a 32-bit word containing the bit pattern for the hex value 4015381c: 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2
System Debug Standard Functions func bound Parameters value An expression to be coerced. Its type can be anything except STR. The coercion will evaluate to FALSE if the value of the expression is 0; otherwise, the value of the coercion will be TRUE. Examples $nmdebug > wl bool(0) FALSE $nmdebug > wl bool(1) TRUE $nmdebug > wl bool(123) TRUE $nmdebug > wl bool(a.c00023c4) TRUE $nmdebug > wl bool(0.
System Debug Standard Functions func bound COMMAND A command name WINDOW_COMMAND A window command name UNDEFINED No definition is currently bound The table is searched in order from top to bottom. The first type which matches is returned. Additional matches may be possible but are not tested. Formal Declaration bound:str (operand:str) Parameters operand A string expression naming the operand for which the definition type is returned.
System Debug Standard Functions func btow func btow Byte to word. Converts a CM DB-relative byte address to a CM DB-relative word address. Syntax btow (byteaddress [splitstack]) Formal Declaration btow:I16 (byteaddress:I16 [splitstack:bool=FALSE]) Parameters byteaddress splitstack The CM DB-relative byte address which is to be converted into a CM DB-relative word address. If splitstack is FALSE, then byteaddress is assumed to be within the current process's CM stack.
System Debug Standard Functions func cisetvar %cmdebug > wl btow (40002) %120001 These examples assume the current CM registers displayed above. Note the huge DL area. Limitations, Restrictions none func cisetvar Sets a new value for the specified CI (MPE XL Command Interpreter) variable. Syntax cisetvar (civarname newvalue) This function is implemented by calling the HPCIPUTVAR intrinsic. String variables are stored as strings. They are not interpreted numerically.
System Debug Standard Functions func civar func civar Returns the current value of a CI (MPE XL Command Interpreter) variable. Syntax civar (civarname [stropt]) This function is implemented by calling the HPCIGETVAR intrinsic. Formal Declaration civar:any (civarname:str [stropt:str="NOEV"]) Parameters civarname The name of the CI variable. stropt A string that determines whether the CI should attempt to evaluate the named variable.
System Debug Standard Functions func cmaddr The first use of the function CIVAR defaults to NOEVALUATE, and as a result the value of one is returned as !TWO. In the second use of the function CIVAR, the stropt is explicitly specified as EVALUATE, and so the MPE XL CI evaluates the value of one, which indirectly references the variable two, and the final result of 2 is returned.
System Debug Standard Functions func cmbpaddr PUB Search the account library LGRP Search the logon group library LPUB Search the logon account library SYS Search the system library Examples $nmdebug > wl cmaddr( "my'lib'proc" "pub") PUB $2.124 Look up the start address of my'lib'proc in the CM group library. $nmdebug > wl cmaddr( "?fopen" ):"%.o" SYS %22.5000 Look up the entry point address of fopen and display the address in octal.
System Debug Standard Functions func cmbpindex Examples %cmdebug > bl CM [1] PROG % 2.3401 CM [2] PROG % 0.347 CM @[1] SYS % 161.5274 TEST'SCREEN+%26 TEST'FILES+%0 FOPEN+%0 First, list the existing breakpoints. %cmdebug > wl cmbpaddr(1) PROG %2.3401 %cmdebug > wl cmbpaddr(1, -1) SYS %161.5274 Now use the function to return the address associated with process local breakpoint number one and then with system breakpoint number one.
System Debug Standard Functions func cmbpinstr Examples %cmdebug > bl CM [1] PROG % 2.3401 CM [2] PROG % 0.347 CM @[1] SYS % 161.5274 TEST'SCREEN+%26 TEST'FILES+%0 FOPEN+%0 First, list the existing breakpoints. %cmdebug > wl cmbpindex(TEST'FILES) %2 Go find the CM breakpoint index associated with the address TEST'FILES. %cmdebug > wl cmbpindex(FOPEN) No breakpoint exists in the breakpoint tables with that address. #1080) Error evaluating a predefined function.
System Debug Standard Functions func cmentry Formal Declaration cmbpinstr:s16 (cmaddr:cptr [pin:s16=0]) Parameters cmaddr Look for this address in the CM breakpoint table. Both logical and absolute code addresses are supported. pin Look for breakpoints set by this PIN. Default is the caller's PIN (a pin of 0 implies this). To specify system (global) breakpoints, use a -1 (or 32762) as the PIN. Examples %cmdebug > dc FOPEN,1 %005274: FOPEN+%0 004300 ..
System Debug Standard Functions func cmentry Formal Declaration cmentry:lcptr (cmlogaddr:lcptr) Parameters cmlogaddr A CM logical code address. The entry point of the surrounding level one CM procedure is returned as a CM logical code address. Cmlogaddr must be a full CM logical code address (LCPTR). For example: CMPC Current CM program counter CMPW+4 Top of CM program window + 4 PROG(2.
System Debug Standard Functions func cmg P'RESET P'REWRITE P'CLOSEIO P'INITHEAP'3000 TWO P'WRITELN P'WRITESTR ONE SEGMENT LENGTH PRIMARY DB SECONDARY DB TOTAL DB ELAPSED TIME 6 7 10 11 2 12 13 3 ? ? ? ? 71 123 ? ? 142 210 155 2 INITIAL STACK 430 INITIAL DL 432 MAXIMUM DATA 00:00:01.365 10240 CAPABILITY 600 0 TOTAL CODE 210 ? TOTAL RECORDS 11 PROCESSOR TIME 00:00.740 END OF PREPARE %cmdebug > wl ob' PROG %0.0 %cmdebug > wl cmstart(ob') PROG %0.
System Debug Standard Functions func cmnode Syntax cmg (pin) Formal Declaration cmg:sptr (pin:u16) Parameters pin The process identification number (PIN) for which the address of the CMGLOBALS record is to be returned. Examples $nmdebug > wl cmg($8) $c4680000 Limitations, Restrictions If the PIN does not exist, the function result is undefined and an error status is set. func cmnode Returns the address of the closest CM node point corresponding to the specified CM logical code address.
System Debug Standard Functions func cmproc fopen+102 CM procedure fopen + %102 (assumes CM mode) cmaddr('fopen')+%102 CM procedure fopen + %102 (NM or CM mode) node The desired node point, either PREV (closest previous node) or NEXT (closest next node). If unspecified, then PREV is assumed. Examples %cmdebug > wl cmnode(sys(2.226)) SYS %2.224 Print the CM address of the closest CM previous (by default) node point. %cnmdebug > wl cmnode(sys(2.226), "next") SYS %2.
System Debug Standard Functions func cmproc name. The offset is formatted based on the current fill, justification, and output base values. Formal Declaration cmproc:str (cmlogaddr:lcptr) Parameters cmlogaddr The CM logical code address for which the CM symbolic procedure name/offset is to be returned. Cmlogaddr must be a full CM logical code address (LCPTR). For example: CMPC Current CM program counter CMPW+4 Top of CM program window + 4 PROG(2.
System Debug Standard Functions func cmproc PROGRAM FILE PTEST.DEMO.TELESUP SEG' 0 NAME STT OB' 1 TERMINATE' 5 P'RESET 6 P'REWRITE 7 P'CLOSEIO 10 P'INITHEAP'3000 11 TWO 2 P'WRITELN 12 P'WRITESTR 13 ONE 3 SEGMENT LENGTH PRIMARY DB SECONDARY DB TOTAL DB ELAPSED TIME CODE ENTRY SEG 0 13 ? ? ? ? ? 71 123 ? ? 142 155 210 2 INITIAL STACK 430 INITIAL DL 432 MAXIMUM DATA 00:00:01.365 10240 CAPABILITY 600 0 TOTAL CODE 210 ? TOTAL RECORDS 11 PROCESSOR TIME 00:00.740 END OF PREPARE %cmdebug > wl cmproc(prog(0.
System Debug Standard Functions func cmproclen Limitations, Restrictions The names and addresses of nested CM procedures, such as procedure three, are not available within the CM FPMAP records. Addresses which fall within nested procedures (three) are returned as offsets relative to the parent procedure (two). func cmproclen Returns the length of the CM procedure which contains the specified CM logical code address.
System Debug Standard Functions func cmproclen PROGRAM test (input,output); PROCEDURE one; begin {one} writeln('ONE'); end; {one} PROCEDURE two; PROCEDURE three; begin {three} writeln('THREE'); end; {three} begin {two} writeln('TWO'); three; end; {two} begin {main body} one; two; end. {main body} { Outer block is named "ob'" by the compiler } PROGRAM FILE PTEST.DEMO.
System Debug Standard Functions func cmseg %cmdebug > wl cmstart(ob') PROG %0.0 %cmdebug > wl cmstart(two) PROG %0.71 %cmdebug > wl cmstart(one) PROG %0.142 %cmdebug > wl cmproclen(ob') %71 %cmdebug > wl cmstart(two) - cmstart(ob') %71 %cmdebug > wl cmproclen(two) %51 %cmdebug > wl cmstart(one)-cmstart(two) %51 %cmdebug > wl cmproclen(one) %30 Limitations, Restrictions The names and addresses of nested CM procedures, such as procedure three, are not available within the CM FPMAP records.
System Debug Standard Functions func cmstackbase fopen+102 CM procedure fopen + %102 (assumes CM mode) cmaddr('fopen')+%102 CM procedure fopen + %102 (NM or CM mode) Note that the offset portion of the LCPTR address is required, but ignored. Examples $cmdebug > wl cmseg(prog(0.0)) SEG' $cmdebug > wl cmseg(fopen) XLSEG11 Limitations, Restrictions none func cmstackbase Returns the starting virtual address of a process's compatibility mode stack.
System Debug Standard Functions func cmstackdst Limitations, Restrictions If the PIN does not exist, the function result is undefined and an error status is set. func cmstackdst Returns the DST number for a process's compatibility mode stack. Syntax cmstackdst (pin) Formal Declaration cmstackdst:u16 (pin:u16) Parameters pin The process identification number (PIN) for which the DST number of the CM stack is to be returned.
System Debug Standard Functions func cmstart Parameters pin The process identification number (PIN) for which the virtual address of the CM stack limit is to be returned. Examples $nmdebug > wl cmstacklimit(%10) $2c4.40015fff Display the virtual address of the CM stack limit for pin %10. $nmdat > wl "CM stack size = ", cmstacklimit(pin) - cmstackbase(PIN) +1 CM stack size = $4350 Calculate and display the CM stack length (in bytes) for the current PIN.
System Debug Standard Functions func cmstart cmaddr('fopen')+%102 CM procedure fopen + %102 (NM or CM mode Examples Assume that the following single segment CM program has been compiled, linked with the PMAP and FPMAP options, and is now being executed: PROGRAM test (input,output); PROCEDURE one; begin {one} writeln('ONE'); end; {one} PROCEDURE two; PROCEDURE three; begin {three} writeln('THREE'); end; {three} begin {two} writeln('TWO'); three; end; {two} begin {main body} one; two; end.
System Debug Standard Functions func cmtonmnode PROG %0.0 Two methods of displaying the start address of the procedure ob'. %cmdebug > wl ?ob' PROG %0.13 %cmdebug > wl cmentry(ob') PROG %0.13 Two methods of displaying the entry address of the procedure ob'. %cmdebug > wl cmstart(one) PROG %0.142 %cmdebug > wl cmentry(one) PROG %0.155 %cmdebug > wl cmentry(one+10) PROG %0.155 %cmdebug > wl cmstart(two) PROG %0.71 %cmdebug > wl cmstart(two+5) PROG %0.71 %cmdebug > wl cmentry(two) PROG %0.
System Debug Standard Functions func cmva Parameters cmlogaddr The CM logical code address of translated code for which the closest NM node point is desired. Cmlogaddr must be a full CM logical code address (LCPTR). For example: CMPC Current CM program counter CMPW+4 Top of CM program window + 4 PROG(2.
System Debug Standard Functions func cst additional information. Formal Declaration cmva:lptr (cmaddr:cptr [pin:u16 = 0]) Parameters cmaddr A CM code address to be converted to a virtual address. Both logical and absolute code addresses are supported. pin The process identification number (PIN) to which the code segment belongs. If pin is not specified, it defaults to 0, which is defined to be the current PIN. Examples $nmdebug > wl cmva(cmpc) $26.
System Debug Standard Functions func cst is used for procedure name lookups: GRP, PUB, LGRP, LPUB, SYS Formal Declaration cst:cst (value:any) Parameters An expression to be coerced. All types are valid. value Table 10-2. Derivation of the CST Bit Pattern Parameter Type Action BOOL 0.1 if TRUE, 0.0 if FALSE. U16 S16 Set the high-order 32 bits (SID or segment part) to zero. Right justify the original 16-bit value in the low-order 32 bits (offset part) with zero fill.
System Debug Standard Functions func cstx and the second procedure is located again (within the group library). %cmdebug > wl cst(sys(24.630)) CST %24.630 The coercion simply changes the associated absolute file. Note that no complicated conversion or range checking is performed. Limitations, Restrictions none func cstx Coerces an expression into a CSTX absolute code pointer (ACPTR). Syntax cstx (value) CM program segments are loaded into the CSTX. CM library segments are loaded into the CST.
System Debug Standard Functions func dstva Table 10-3. Derivation of the CSTX Bit Pattern Parameter Type LPTR PROG GRP PUB LGRP LPUB SYS USER TRANS CST CSTX Action Transfer both parts of the address unchanged. EADDR SADDR Transfer both parts of the address, truncating the 32 high-order bits of the offset. STR Transfer the ASCII bit pattern for the last eight characters in the string. Strings shorter than eight characters are treated as if they were extended on the left with nulls.
System Debug Standard Functions func eaddr Formal Declaration dstva:lptr (dstoff:lptr) Parameters dstoff The CM data segment address which is to be converted to a virtual address. This is specified as dst.offset. Examples $nmdebug > = dstva(%20.0) $38.00000000 Convert the data segment address %20.0 to a virtual address and display the result. Limitations, Restrictions none func eaddr Coerces an expression into an extended address.
System Debug Standard Functions func errmsg Table 10-4. Derivation of the EADDR Bit Pattern Parameter Type Action LONG Class Transfer the SID part unchanged. Right justify the original offset part in the low-order 64 bits of the offset part with zero fill. EADDR SADDR Transfer both parts of the address unchanged. STR Transfer the ASCII bit pattern for the last twelve characters in the string. Strings shorter than twelve characters are treated as if they were extended on the left with nulls.
System Debug Standard Functions func grp Formal Declaration errmsg:str (errnum:s16 [subsys:u16=$a9]) Parameters errnum The error number, typically negative for errors, positive for warnings. subsys The subsystem number. By default, the Debug subsystem number ($a9) is used. Examples $nmdebug > wl errmsg (-#1055) Expected a string for a pattern name (error #1105) Display the System Debug error message string for error number 1105.
System Debug Standard Functions func grp Parameters value An expression to be coerced. All types are valid. Table 10-5. Derivation of the GRP Bit Pattern Parameter Type Action BOOL 0.1 if TRUE, 0.0 if FALSE. U16 U32 SPTR Set the SID part to zero. Right justify the original value in the low-order 32 bits of the offset part with zero fill. S16 S32 S64 Set the SID part to zero. Right justify the original value in the low-order 32 bits of the offset part with sign extension.
System Debug Standard Functions func hash $nmdat > wl grp( 1234.5678 ) GRP $1234.5678 $nmdat > wl grp( true ) GRP $0.1 $nmdat > wl grp( "ABCDEFG" ) GRP $414243.44454647 Limitations, Restrictions none func hash Hashes a virtual address into a hash table (real) offset. Syntax hash (virtaddr) The hash value can be added to the Hash table base real address (TR1) to determine the real offset to the first PDIR entry.
System Debug Standard Functions func lgrp Hash the virtual address for PC ($a.d87f8) to get real address $103c4. Add the hash value ($103c4) to the base of the Hash table (TR1) to get the offset of the first PDIR entry ($1b00). Add this offset to the base of the PDIR table (TR0), and display the four-word PDIR entry. Limitations, Restrictions none func lgrp Coerces an expression into a LGRP logical code pointer (LCPTR).
System Debug Standard Functions func logtoabs Examples %cmdebug > wl lgrp(12.304) LGRP %12.304 Coerce the simple long pointer into a LGRP logical code pointer. %cmdebug > wl lgrp( sort ) LGRP %0.6412 Print the address of the procedure named sort. Note that the search path used for procedure name lookups is restricted to the logon group library (LGRP). %cmdebug > wl lgrp(sys(24.630)) LGRP %24.630 The coercion simply changes the associated logical file. The pointer's bit pattern remains unchanged.
System Debug Standard Functions func lptr Syntax logtoabs (cmlogaddr) Formal Declaration logtoabs:acptr (cmlogaddr:lcptr) Parameters cmlogaddr The CM logical code address to be converted into an absolute code pointer. Cmlogaddr must be a full CM logical code address (LCPTR). For example: CMPC Current CM program counter CMPW+4 Top of CM program window + 4 PROG(2.
System Debug Standard Functions func lptr Syntax lptr (value) Formal Declaration lptr:lptr (value:any) Parameters value An expression to be coerced. All types are valid. Table 10-7. Derivation of the LPTR Bit Pattern Parameter Type Action BOOL 0.1 if TRUE, 0.0 if FALSE. U16 U32 SPTR Set the SID part to zero. Right justify the original value in the low-order 32 bits of the offset part with zero fill. S16 S32 S64 Set the SID part to zero.
System Debug Standard Functions func lpub $nmdat > wl lptr( "ABCDEFG" ) $414243.44454647 $nmdat > wl lptr( prog(1.2) ) $1.2 Limitations, Restrictions none func lpub Coerces an expression into a LPUB logical code pointer (LCPTR). Syntax lpub (value) During the evaluation of the parameter to this function, the search path used for procedure name lookups is restricted to the logon account library file (LPUB). Formal Declaration lpub:lpub (value:any) Parameters value An expression to be coerced.
System Debug Standard Functions func ltolog Examples %cmdebug > wl lpub(12.304) LPUB %12.304 Coerce the simple long pointer 12.304 into a LPUB logical code pointer. %cmdebug > wl lpub( sort ) LPUB %2.6632 Print the address of the procedure named sort. Note that the search path used for procedure name lookups is restricted to the logon account library (LPUB). %cmdebug > wl lpub(sys(24.630)) LPUB %24.630 The coercion simply changes the associated logical file. The pointer's bit pattern remains unchanged.
System Debug Standard Functions func ltolog Syntax ltolog (longptr) The SID of the long pointer (input parameter) is compared with the SID of each of the loaded NM executable libraries for a match. If a SID match is found, then the appropriate logical code pointer is returned. If the SID does not match any of the loaded NM files, then the long pointer is tested to see if it points to a NM section of translated CM code produced by the Object Code Translator (OCT).
System Debug Standard Functions func ltos func ltos Long to short. Converts a virtual address to a short pointer. Syntax ltos (virtaddr) The LTOS function converts a virtual address to a short pointer. If the parameter virtaddr is already a short pointer, it is simply returned. If the parameter virtaddr is a long pointer, or a full logical code address, a special additional test is performed to ensure that the offset portion can be returned as the short pointer value.
System Debug Standard Functions func macbody Limitations, Restrictions none func macbody Returns a string that is the macro body for the specified macro name. Syntax macbody (macroname) Formal Declaration macbody:str (macroname:str) Parameters macroname The name of the macro whose body is to be returned. Examples $nmdebug > wl macbody("showtime") wl time Display the macro body for the macro command named showtime.
System Debug Standard Functions func mapsize Formal Declaration pindex:u16 (filename:str) Parameters filename The name of the previously mapped file whose index number is to be returned. Examples $nmdebug > maplist 1 DTCDUMP.DUMPUSER.SUPPORT 2 DTCDUMP2.DUMPUSER.SUPPORT 3 MYFILE.MYGROUP.MYACCT 1000.0 1001.0 1005.0 Bytes = 43dc Bytes = c84 Bytes = 1004 $nmdebug > wl mapindex("DTCDUMP") $1 Limitations, Restrictions none func mapsize Returns the size in bytes of the specified mapped file.
System Debug Standard Functions func mapva Limitations, Restrictions none func mapva Returns the virtual address of the specified mapped file. Syntax mapva (filename) Formal Declaration mapva:lptr (filename:str) Parameters filename The name of the mapped file whose virtual address is to be returned. Examples $nmdebug > maplist 1 DTCDUMP.DUMPUSER.SUPPORT 2 DTCDUMP2.DUMPUSER.SUPPORT 3 MYFILE.MYGROUP.MYACCT 1000.0 1001.0 1005.0 Bytes = 43dc Bytes = c84 Bytes = 1004 $nmdebug > = mapva("DTCDUMP") 1000.
System Debug Standard Functions func nmaddr returned for most data symbols must be relocated relative to DP to be useful. Formal Declaration nmaddr:long (path:str [lookupid:str="PROCEDURE"]) Parameters path The path specification for the NM procedure or data specified in the form: file_name/module_name:procedure/dataname or, for nested procedures: file_name/module_name:parent_procedure.procedure lookupid A keyword indicating where to look for the code path specification given above.
System Debug Standard Functions func nmaddr Examples $nmdebug > wl processstudent PROG $4d5.5d24 $nmdebug > wl nmaddr("processstudent") PROG $4d5.5d24 Write the address for the processstudent procedure. The expression evaluator can locate the procedure since it is an exported universal procedure. The procedure may also be located by using the NMADDR function. The default lookupid PROCEDURES is used. $nmdebug > wl processstudent.
System Debug Standard Functions func nmbpaddr USER $10d.12f3dc The above example prints out the address of one of the Pascal library routines. Notice the module qualifier. $nmdebug > wl FOPEN SYS $a.3f8140 $nmdebug > wl nmaddr("FOPEN") SYS $a.3f8140 $nmdebug > wl nmaddr("nl.pub.sys/FOPEN") SYS $a.3f8140 $nmdebug > wl nmaddr("FOPEN" "LST") SYS $a.3f8140 $nmdebug > wl ?FOPEN SYS $a.3f80e4 $nmdebug > wl nmaddr("FOPEN" "EXPORTSTUB") SYS $a.
System Debug Standard Functions func nmbpindex Formal Declaration nmbpaddr:lptr (bpindex:u32 [pin:s16=0]) Parameters bpindex The index of the breakpoint whose address is to be returned. pin Look for breakpoints set by this PIN. Default is the caller's PIN (a pin of 0 implies this). To specify system (global) breakpoints, use a -1 (or 32762) as the PIN. Examples $nmdebug > bl NM [1] PROG $ c3.56d80 test_screen+$ab3 NM [2] PROG $ c3.4cf18 test_file^ NM @[1] SYS $ a.
System Debug Standard Functions func nmbpinstr Formal Declaration nmbpindex:u32 (virtaddr:ptr [pin:s16=0]) Parameters virtaddr The address of an NM breakpoint whose index is to be returned. Virtaddr can be a short or long pointer. Look for breakpoints set by this PIN. Default is the caller's PIN (a pin of 0 implies this). To specify system (global) breakpoints, use a -1 (or 32762) as the PIN. pin Examples $nmdebug > bl NM [1] PROG $ c3.56d80 test_screen+$ab3 NM [2] PROG $ c3.
System Debug Standard Functions func nmbpinstr breakpoint has been set. Syntax nmbpinstr (virtaddr [pin]) This function accepts the address of an existing NM breakpoint and returns the instruction associated with that breakpoint. The default action is to look for breakpoints set by the current PIN. Breakpoint indices for other PINs (including the global PIN) may be retrieved by using the optional pin parameter.
System Debug Standard Functions func nmcall func nmcall Dynamically calls a procedure/function, passing up to four parameters. Syntax nmcall (path) [parm1] [parm2] [parm3] [parm4] This function is used to perform a dynamic procedure call. It is implemented by calling the HPGETPROCPLABEL intrinsic to ensure the desired routine is loaded, and then uses the FCALL routine in the Pascal/XL compiler to invoke the routine.
System Debug Standard Functions func nmentry are passed in arg0 (r26), arg1 (r25), arg2 (r24), and arg3 (r23). Each may contain any value up to 32 bits in length. The called code must know how to interpret these values. If the called routine has fewer parameters, the zeros passed in the remaining argument registers are harmless. If the called routine has additional parameters, their values are undefined.
System Debug Standard Functions func nmfile Parameters virtaddr The virtual address for which the entry point of the surrounding (level one) NM procedure is to be returned. Virtaddr can be a short pointer, a long pointer, or a full logical code pointer. Examples $nmdebug > wl average GRP $4d8.15c88 $nmdebug > wl nmentry( average+20 ) GRP $4d8.15c88 Print the address for the procedure average. Given any offset within the procedure, the NMENTRY function returns the address of the procedure's entry point.
System Debug Standard Functions func nmmod pointer. length The maximum length of the file name string to be returned. If the name does not fully fit into the space specified, it is truncated and followed by an asterisk (*) to indicate the truncation. Examples $nmdebug > nm PROG parm=0 nm GRP nm USER nm SYS cm SYS loadinfo GRADES.DEMO.TELESUP info="" XL.DEMO.TELESUP XL.PUB.SYS NL.PUB.SYS SL.PUB.SYS SID=$4d5 SID=$4d8 SID=$10d SID=$a Show the files loaded by the current process.
System Debug Standard Functions func nmnode Formal Declaration nmmod:str (virtaddr:ptr [length:u16=$20]) Parameters virtaddr The virtual address for which the symbolic module name is to be returned. Virtaddr can be a short pointer, a long pointer, or a full logical code pointer. length The maximum length of the module name string to be returned. If the name does not fully fit into the space specified, it will be truncated and followed by an asterisk (*) to indicate the truncation.
System Debug Standard Functions func nmpath Parameters virtaddr The NM address of translated code for which the closest NM node point is to be returned. virtaddr can be a short pointer, a long pointer, or a full logical code pointer. node The desired node point, either PREV (closest previous node) or NEXT (closest next node). The default is PREV. Examples $nmdebug > wl nmnode(21.24030) TRANS $21.24024 Print the NM address of the closest previous (by default) NM node point. $nmdebug > wl nmnode(21.
System Debug Standard Functions func nmpath Formal Declaration nmpath:str (virtaddr:ptr [length:u16=$50]) Parameters virtaddr The address for which the symbolic procedure path name is to be returned. Virtaddr can be a short pointer, a long pointer, or a full logical code pointer. length The maximum length of the path name string to be returned. If the path name does not fully fit into the space specified, it is truncated and terminated with an asterisk (*) to indicate the truncation.
System Debug Standard Functions func nmproc func nmproc Returns the NM procedure name and offset corresponding to the specified virtual address. Syntax nmproc (virtaddr [length]) The string returned by NMPROC is one of the following two formats: parent_procname.procedure_name+base offset or procedure_name+base offset Detailed descriptions of each of the above return strings follow: parent_procname The name of the level one procedure containing the nested procedure at the specified address.
System Debug Standard Functions func nmstackbase SYS $a.3f8140 $nmdebug > wl nmproc( a.3f8140 ) OPEN $nmdebug > wl FOPEN+40 SYS $a.3f8180 $nmdebug > wl nmproc( a.3f8180 ) FOPEN+$40 $nmdebug > wl nmproc( pc ) PROGRAM+4c Limitations, Restrictions none func nmstackbase Returns the virtual address of the start of the process's NM stack.
System Debug Standard Functions func nmstacklimit Limitations, Restrictions If the PIN does not exist, the function result is undefined and an error status is set. func nmstacklimit Returns the virtual address of the limit of a process's NM stack. Syntax nmstacklimit (pin) Formal Declaration nmstacklimit:lptr (pin:u16) Parameters pin The process identification number (PIN) for which the virtual address of the NM stack limit is to be returned. Examples $nmdebug > wl nmstacklimit (8) $5e4.
System Debug Standard Functions func off Refer to appendix C for a discussion of CM object code translation, node points, and breakpoints in translated CM code. Formal Declaration nmtocmnode:lcptr (virtaddr:lptr [node:str="PREV"]) Parameters virtaddr The virtual address of NM translated code for which the closest CM node point is to be returned. Virtaddr can be a short pointer, a long pointer, or a full logical code pointer.
System Debug Standard Functions func pcb Virtaddr can be a short pointer, a long pointer, or an extended address. Examples $nmdebug > wl pc PROG $2e.213403 $nmdebug > wl off(pc) $213403 $nmdebug > wl off(a.1234) $1234 Limitations, Restrictions none func pcb Returns the virtual address (SPTR) of a process's process control block (PCB). Syntax pcb (pin) Formal Declaration pcb:sptr (pin:u16) Parameters pin The process identification number (PIN) for which the address of the PCB is to be returned.
System Debug Standard Functions func pcbx func pcbx Returns the virtual address (SPTR) of a process's process control block extension (PCBX). Syntax pcbx (pin) Formal Declaration pcbx:sptr (pin:u16) Parameters pin The process identification number (PIN) for which the address of the PCBX is to be returned. Note that this is a CM data structure. Examples $nmdebug > wl pcbx(8) $40010db0 Limitations, Restrictions If the PIN does not exist, the function result is undefined and an error status is set.
System Debug Standard Functions func pib mappingbit A Boolean that implies that the segment is physically mapped (TRUE = 1) or logically mapped (FALSE = 0). By default, mappingbit is FALSE. Examples %cmdebug > wl phystolog( 303 ) PROG %2.0 Physical segment number %303 is converted into logical code segment PROG 2. %cmdebug > wl phystolog( 122 ) GRP %2.0 Physical segment number %122 is converted into logical code segment GRP %2.
System Debug Standard Functions func pibx func pibx Returns the virtual address (SPTR) of a process's process information block extension (PIBX). Syntax pibx (pin) Formal Declaration pibx:sptr (pin:u16) Parameters pin The process identification number (PIN) for which the address of the PIBX is to be returned. Examples $nmdebug > wl pibx(8) $c4680000 Limitations, Restrictions If the PIN does not exist, the function result is undefined and an error status is set.
System Debug Standard Functions func prog Parameters value An expression to be coerced. All types are valid. Table 10-9. Derivation of PROG LGRP Bit Pattern Parameter Type Action BOOL 0.1 if TRUE, 0.0 if FALSE. U16 U32 SPTR Set the SID part to zero. Right justify the original value in the low-order 32 bits of the offset part with zero fill. S16 S32 S64 Set the SID part to zero. Right justify the original value in the low-order 32 bits of the offset part with sign extension.
System Debug Standard Functions func pstate $nmdat > wl prog( 1234.5678 ) PROG $1234.5678 $nmdat > wl prog( true ) PROG $0.1 $nmdat > wl prog( "ABCDEFG" ) PROG $414243.44454647 $nmdat > wl prog( grp(1.2) ) PROG $1.2 Limitations, Restrictions none func pstate Returns the process state for the specified PIN as a string.
System Debug Standard Functions func pub Examples $nmdebug > wl pstate(8) INITIATE $nmdebug > wl pstate(f) DYING $nmdebug > if pstate(16) = "ALIVE" then formatprocess(16) Limitations, Restrictions none func pub Coerces an expression into a PUB logical code pointer (LCPTR). Syntax pub (value) During the evaluation of the parameter to this function, the search path used for procedure name lookups is limited to the account library file (PUB).
System Debug Standard Functions func pub Table 10-10. Derivation of the PUB Bit Pattern Parameter Type Action EADDR SADDR Transfer the SID part unchanged. Transfer the low-order 32 bits of the offset part. STR Transfer the ASCII bit pattern for the last eight characters in the string. Strings shorter than eight characters are treated as if they were extended on the left with nulls. Examples %cmdebug > wl pub(12.304) PUB %12.304 Coerce the simple long pointer into a PUB logical code pointer.
System Debug Standard Functions func rtov Limitations, Restrictions none func rtov Real to virtual. Converts a real address to a virtual address. Syntax rtov (realaddr) Formal Declaration rtov:lptr (realaddr:u32) Parameters realaddr The real address to be converted to a virtual address. Examples $nmdebug > wl pc PROG $741.5934 Display the current logical code address (LCPTR) of the NM program counter.
System Debug Standard Functions func s16 Syntax s16 (value) Formal Declaration s16:s16 (value:any) Parameters value An expression to be coerced. All types are valid. Table 10-11. Derivation of the S16 Bit Pattern Parameter Type Action BOOL 1 if TRUE, 0 if FALSE. U16 S16 Transfer the original bit pattern unchanged. U32 S32 S64 SPTR Transfer the low-order 16 bits. LONG Class EADDR SADDR Transfer the low-order 16 bits of the offset part.
System Debug Standard Functions func s32 $nmdat > wl s16( true ) $1 $nmdat > wl s16( "ABCDEFG" ) $4647 $nmdat > wl s16( prog(1.2) ) $2 Limitations, Restrictions none func s32 Coerces an expression into a signed 32-bit value. Syntax s32 (value) Formal Declaration s32:s32 (value:any) Parameters value An expression to be coerced. All types are valid. Table 10-12. Derivation of the S32 Bit Pattern Parameter Type Action BOOL 1 if TRUE, 0 if FALSE.
System Debug Standard Functions func s64 Table 10-12. Derivation of the S32 Bit Pattern Parameter Type STR Action Transfer the ASCII bit pattern for the last four characters in the string. Strings shorter than four characters are treated as if they were extended on the left with nulls.
System Debug Standard Functions func saddr Syntax s64 (value) Formal Declaration s64:s64 (value:any) Parameters value An arbitrary expression to be coerced. Table 10-13. Derivation of the S64 Bit Pattern Parameter Type Action BOOL 1 if TRUE, 0 if FALSE. U16 U32 SPTR Right justify the original value in 64 bits with zero fill. S16 S32 S64 Right justify the original value in 64 bits with sign extension. LONG Class Transfer the concatenation of the SID and offset parts.
System Debug Standard Functions func saddr Syntax saddr (value) Formal Declaration saddr:saddr (value:any) Parameters value An expression to be coerced. All types are valid. Table 10-14. Derivation of the EADDR Bit Pattern Parameter Type Action BOOL 0.1 if TRUE, 0.0 if FALSE. U16 U32 SPTR Set the SID (LDEV) part to zero. Right justify the original value in the low-order 64 bits of the offset part with zero fill. S16 S32 S64 Set the SID (LDEV) part to zero.
System Debug Standard Functions func sid $nmdat > wl saddr( prog(1.2) ) SADDR $1.2 Limitations, Restrictions none func sid Returns the space ID (SID) portion of a virtual or extended address. Syntax sid (virtaddr) The SID function returns the space ID portion of a virtual address. If the parameter virtaddr is a short pointer (SPTR) it is internally converted to a long pointer by the STOL function, and the resulting SID portion is returned.
System Debug Standard Functions func sptr Limitations, Restrictions none func sptr Coerces an expression into a short pointer. Syntax sptr (value) Formal Declaration sptr:sptr (value:any) Parameters value An expression to be coerced. All types are valid. Table 10-15. Derivation of the SPTR Bit Pattern Parameter Type Action BOOL 1 if TRUE, 0 if FALSE. U16 S16 Right justify the original 16-bit value in 32 bits with zero fill. U32 S32 SPTR Transfer the original bit pattern unchanged.
System Debug Standard Functions func stol $nmdat > wl sptr( 1234abcd ) $1234abcd $nmdat > wl sptr( -1 ) $ffffffff $nmdat > wl sptr( 1234.5678 ) $5678 $nmdat > wl sptr( true ) $1 $nmdat > wl sptr( "ABCDEFG" ) $44454647 $nmdat > wl sptr( prog(1.2) ) $2 Limitations, Restrictions none func stol Short to long. Converts a virtual address to a long pointer. Syntax stol (virtaddr) If the parameter virtaddr is a short pointer (SPTR), then it is converted based on the space registers for the current PIN.
System Debug Standard Functions func stolog Examples $nmdebug > dr sr4; dr sr5 sr4=$41 sr5=$53 $nmdebug > wl sp $40163088 $nmdebug > wl stol(sp) $53.40163088 $nmdebug > wl stol(1cbb8c) $41.1cbb8c $nmdebug > wl stol(15f.1cbb8c) $15f.1cbb8c Limitations, Restrictions none func stolog Short to logical. Converts a NM short pointer (SPTR) to a NM logical code address (LCPTR).
System Debug Standard Functions func str 'GRP' Group library 'PUB' Account library 'SYS' System library 'USER' User library By default, the selector 'PROG' will be used. userfname The file name of a user library file. Since multiple NM user libraries can be in use simultaneously, the userfname parameter is required when the logical file selector logsel is 'USER' . If userfname is not fully qualified, the program file's group and account are used to fully qualify the file name.
System Debug Standard Functions func strapp Syntax str (source position length) Formal Declaration str:str (source:str position:u16 length:u16) Parameters source The string from which to extract the substring. position The index of the first character to extract. String indices are 1-based. (That is, indices are 1, 2, 3, ... rather than 0, 1, 2, ...) length The number of characters to extract.
System Debug Standard Functions func strdel Parameters source The string to which tail is appended. tail The string to append to the tail of source. Examples $nmdebug > var stuff "Cream" $nmdebug > wl strapp("Ice ", stuff) Ice Cream Append the string contained in the variable stuff to the string "Ice". $nmdebug > = strapp("Hello, ", strapp("How", " Are You?") ) "Hello, How Are You?" Print the result of concatenating the string literals.
System Debug Standard Functions func strdown Examples $nmdebug > = strdel("This is NOT fun", 9, 4) "This is fun" Starting at position 9, delete the next four characters. $nmdebug > wl strdel("Fishy, fishy, in the brook.", 13, 1000) Fishy, fishy Delete characters from position 13 to the end of the string. Limitations, Restrictions none func strdown String downshift. Returns a string that is the result of downshifting all alphabetic characters in the source string.
System Debug Standard Functions func strextract Limitations, Restrictions none func strextract String extract. Returns a string (extracted) from the specified virtual address. Syntax strextract (virtaddr [length]) Formal Declaration strextract:str (virtaddr:ptr [length:u16=$4]) Parameters virtaddr The virtual address of the start of the string. Virtaddr can be a short pointer, a long pointer, or a full logical code pointer. length The number of characters to retrieve starting at virtaddr.
System Debug Standard Functions func strinput func strinput Prompts on the input device for user input and returns the user input line as a string. Syntax strinput (prompt) Formal Declaration strinput:str (prompt:str) Parameters prompt The prompt string to be displayed. Examples $nmdebug > wl strinput("input a number>") input a number > 1234 1234 Prompt the user for a number and write it back.
System Debug Standard Functions func strlen Parameters insert The string to be inserted into source. source The source string into which insert is to be inserted. position The position where insert is to be inserted in source. String indices are 1-based. (That is, indices are 1, 2, 3, ... rather than 0, 1, 2, ...) If position is greater than the string length of source, insert is appended to source. Examples $nmdebug > var name "Smith, " $nmdebug > wl strins(name, "Dear Ms.
System Debug Standard Functions func strltrim Print the length (number of characters) in the empty string. $nmdebug > var company "Hewlett-Packard Co." $nmdebug > = strlen(company),d #19 Limitations, Restrictions none func strltrim String left trim. Deletes leading blanks from the source string. Syntax strltrim (source) Formal Declaration strltrim:str (source:str) Parameters source The string from which all leading blanks are to be deleted.
System Debug Standard Functions func strpos Syntax strmax (source) Formal Declaration strmax:u32 (source:str) Parameters source Any string literal or variable. The result of this function is a constant. All strings have the same maximum length. Examples $nmdebug > wl strmax("date"):"#" #2048 $cmdat > = strmax(""),d #2048 Limitations, Restrictions The maximum number of characters in a string currently is 2048. func strpos String position.
System Debug Standard Functions func strrpt value is greater than the size of the source string, a zero result is returned. Examples $nmdebug $nmdebug $nmdebug $nmdebug $4 > > > > var source "Oh where oh where has my little dog gone" var searchstring "where" var first = strpos(source, searchstring) wl first Look for the string "where" in the source string and print the position where it was found.
System Debug Standard Functions func strrtrim Examples $nmdebug > var digits:str "0123456789" $nmdebug > wl strrpt(digits, 7) 0123456789012345678901234567890123456789012345678901234567890123456789 Print out the string of digits "0 .. 9" repeated seven times. Limitations, Restrictions If the resultant string is larger than the maximum supported string length (see the STRMAX function), it is truncated at the maximum length. func strrtrim String right trim. Deletes trailing blanks from the source string.
System Debug Standard Functions func strup func strup String upshift. Returns a string which is the result of upshifting all alphabetic characters in the source string. Syntax strup (source) Formal Declaration strup:str (source:str) Parameters source The string whose alphabetic characters are to be upshifted. Examples $nmdebug > var cows "brindle and bessie. $nmdebug > wl strup(cows) BRINDLE AND BESSIE. JENNY AND BOSS. jenny and boss." Upshift the string variable and display the results.
System Debug Standard Functions func strwrite Parameters valuelist A list of expressions, in the form of a single string, to be formatted. The expressions can be separated by blanks or commas: value1, value2 value3 ... An optional format specification can be appended to each expression, introduced with a required colon, in order to select one of the following: a specific output base, left or right justification, blank or zero fill, and a field width for the value. value1[:fmtspec1] value2[:fmtspec2] ...
System Debug Standard Functions func strwrite T Typed (display the type of the value) U Untyped (do not display the type of the value) QS Quote single (surround w/ single quotes) QD Quote double (surround w/ double quotes) QO Quote original (surround w/ original quote character) QN Quote none (no quotes) The M directive (minimum field width) selects the minimum possible field width necessary to format all significant digits (or characters in the case of string inputs).
System Debug Standard Functions func strwrite In specifications with quotes, the quotes do not count in the number of positions specified. The string is built such that it appears inside the quotes as it would without the quotes. The T directive (typed) displays the type of the value, preceding the value. The U directive (untyped) suppresses the display of the type. Types are displayed in upper case, with a single trailing blank.
System Debug Standard Functions func symaddr NOTE The Cn directive is ignored by the ASC function but is honored by the W, WL and WP commands. Examples $nmdat > var save = strwrite('1 2 3 "-->" 4:"z w4 r z" $nmdat > wl save $1$2$3-->0004$5 5') The string variable save is used to store the function return value. STRWRITE is equivalent to the W(WRITE) command, but the formatted output is returned in a string. Note the single quotes which surround the value list. These turn the value list into a string.
System Debug Standard Functions func symaddr bits, 8 means bytes, 32 means words. The default is bytes. Symbolic offsets are rounded down to the nearest whole unit. Examples $nmdebug > symopen gradtyp.demo Opens the symbolic data type file gradtyp.demo. It is assumed that the Debug variable addr contains the address of a StudentRecord data structure in virtual memory.
System Debug Standard Functions func symconst func symconst Returns the value of a declared constant. Syntax symconst (pathspec) Formal Declaration symconst:any (pathspec:str) Parameters pathspec A path specification, as described in chapter 5, "Symbolic Formatting/ Symbolic Access." Examples $nmdebug > symopen gradtyp.demo Opens the symbolic data type file gradtyp.demo. It is assumed that the Debug variable addr contains the address of a StudentRecord data structure in virtual memory.
System Debug Standard Functions func syminset func syminset Returns a Boolean value of TRUE if the set member specified by the member parameter is in the set specified by the virtual address and the path specification. Syntax syminset (virtaddr pathspec member) Formal Declaration syminset:bool (virtaddr:ptr pathspec:str member:str) Parameters The virtual address of the start of the set. virtaddr Virtaddr can be a short pointer, a long pointer, or a full logical code pointer.
System Debug Standard Functions func symlen func symlen Returns the length of a data structure in bits or bytes. Syntax symlen (pathspec [units]) Formal Declaration symlen:u32 (pathspec:str [units:u32=$8]) Parameters pathspec A path specification, as described in chapter 5, "Symbolic Formatting/Symbolic Access." units Specifies the units (that is, bit width) in which the result is given. 1 means bits, 8 means bytes, 32 means words. The default is bytes.
System Debug Standard Functions func symtype $nmdebug > wl SYMLEN("StudentRecord") $40 Returns the size of a complete StudentRecord in bytes. $nmdebug > wl SYMLEN("StudentRecord" $200 1) Returns the size of a complete StudentRecord in bits. $nmdebug > wl SYMLEN("StudentRecord.Grades" #32) $a Returns the size of grades field in a StudentRecord in words. Limitations, Restrictions none func symtype Returns the type of a component described by the path specification.
System Debug Standard Functions func symval GradeRange GradesArray = MINGRADES .. MAXGRADES; = ARRAY [ GradeRange ] OF integer; Class NameStr = ( SENIOR, JUNIOR, SOPHOMORE, FRESHMAN ); = string[8]; StudentRecord = RECORD Name Id Year NumGrades Grades END; : : : : : NameStr; Integer; Class; GradeRange; GradesArray; $nmdebug > wl symtype("StudentRecord.NumGrades") GRADERANGE Print out the type name of the NumGrades field of a StudentRecord. Limitations, Restrictions None.
System Debug Standard Functions func sys addr contains the address of a StudentRecord data structure in virtual memory. The following code fragment is from this file: CONST MINGRADES = 1; MINSTUDENTS = 1; TYPE GradeRange GradesArray Class NameStr MAXGRADES = 10; MAXSTUDENTS = 5; = MINGRADES ..
System Debug Standard Functions func sys Formal Declaration sys:sys (value:any) Parameters value An expression to be coerced. All types are valid. Table 10-16. Derivation of the SYS Bit Pattern Parameter Type Action BOOL 0.1 if TRUE, 0.0 if FALSE. U16 U32 SPTR Set the SID part to zero. Right justify the original value in the low-order 32 bits of the offset part with zero fill. S16 S32 S64 Set the SID part to zero.
System Debug Standard Functions func tcb SYS $1234.5678 $nmdat > wl sys( true ) SYS $0.1 $nmdat > wl sys( "ABCDEFG" ) SYS $414243.44454647 $nmdat > wl sys( prog(1.2) ) SYS $1.2 Limitations, Restrictions none func tcb Returns the real address of a process' TCB (task control block). Syntax tcb (pin) Formal Declaration tcb:u32 (pin:u16) Parameters pin The process identification number (PIN) for which the real address of the TCB is to be returned.
System Debug Standard Functions func trans Limitations, Restrictions none func trans Coerces an expression into a TRANS logical code pointer (LCPTR). Syntax trans (value) Formal Declaration trans:trans (value:any) Parameters value An expression to be coerced. All types are acceptable. Table 10-17. Derivation of the TRANS Bit Pattern Parameter Type Action BOOL 0.1 if TRUE, 0.0 if FALSE. U16 Set the SID part to zero.
System Debug Standard Functions func typeof Coerce the simple long pointer into a TRANS logical code pointer. %cmdebug > wl trans(sys(24.630)) TRANS %24.630 The coercion simply changes the type. Note that no complicated conversion or range checking is performed. Limitations, Restrictions none func typeof Returns the type of an evaluated expression as a string. Syntax typeof (expr) Formal Declaration typeof:str (expr:any) Parameters expr Any expression for which the resultant type is desired.
System Debug Standard Functions func typeof $nmdebug > wl typeof("Nellie of Meadow Farm") STR $nmdebug > wl typeof(typeof(123)) STR $nmdebug > wl typeof(pc) SYS Chapter 10 473
System Debug Standard Functions func u16 $nmdebug > wl typeof(cmpc) GRP $nmdebug > wl typeof(cmtonmnode(cmpc)) TRANS $nmdebug > wl typeof(a.c00024c8) LPTR $nmdebug > wl typeof(pib(pin)) SPTR Limitations, Restrictions none func u16 Coerces an expression into an unsigned 16-bit value. Syntax u16 (value) Formal Declaration u16:u16 (value:any) Parameters value An expression to be coerced. All types are valid. Table 10-18.
System Debug Standard Functions func u16 Table 10-18. Derivation of the U16 Bit Pattern Parameter Type LONG Class Action Transfer the low-order 16 bits of the offset part. EADDR SADDR STR Transfer the ASCII bit pattern for the last two characters in the string. Strings shorter than two characters are treated as if they were extended on the left with nulls.
System Debug Standard Functions func u32 func u32 Coerces an expression into an unsigned 32-bit value. Syntax u32 (value) Formal Declaration u32:u32 (value:any) Parameters value An expression to be coerced. All types are valid. Table 10-19. Derivation of the U32 Bit Pattern Parameter Type Action BOOL 1 if TRUE, 0 if FALSE. U16 Right justify the original 16-bit value in 32 bits with zero fill. S16 U32 Transfer the original bit pattern unchanged. S32 SPTR S64 Transfer the low-order 32 bits.
System Debug Standard Functions func user $nmdat > wl u32( 1234abcd ) $1234abcd $nmdat > wl u32( -1 ) $ffff $nmdat > wl u32( ffffffff ):"#" #4294967295 $nmdat > wl u32( 1234.5678 ) $5678 $nmdat > wl u32( true ) $1 $nmdat > wl u32( "ABCDEFG" ) $44454647 $nmdat > wl u32( prog(1.2) ) $2 Limitations, Restrictions none func user Coerces an expression into a USER library logical code pointer (LCPTR).
System Debug Standard Functions func user name string length. value An expression to be coerced. All types are valid. Table 10-20. Derivation of the USER Bit Pattern Parameter Type Action BOOL 0.1 if TRUE, 0.0 if FALSE. U16 Set the SID part to zero. Right justify the original value in the low-order 32 bits of the offset part with zero fill. U32 SPTR S16 S32 Set the SID part to zero. Right justify the original value in the low-order 32 bits of the offset part with sign extension.
System Debug Standard Functions func vainfo func vainfo Returns selected information for the specified virtual address. Syntax vainfo (virtaddr selector) Formal Declaration vainfo:any (virtaddr:ptr selector:str) Parameters virtaddr The virtual address of the object for which the information is desired. Virtaddr can be a short pointer, a long pointer, or a full logical code pointer.
System Debug Standard Functions func vtor $a.c1002ec0 $nmdat > dv c1002ec0,58/4 $ VIRT a.c1002ec0 $ 00000001 $ VIRT a.c1002ed0 $ 00000000 $ VIRT a.c1002ee0 $ 00074807 $ VIRT a.c1002ef0 $ 00000000 $ VIRT a.c1002f00 $ 00000000 $ VIRT a.c1002f10 $ 00000000 08010000 0000000a 50000000 00000000 00000000 ffff0000 7ffd7ffd c3580000 032a0000 00000000 00000000 7ffd0000 c35f4806 00000056 00000000 02000000 Define a variable pibva to be the address of the PIB (process information block) for PIN 1.
System Debug Standard Functions func vtos Parameters virtaddr The virtual address to be converted to a real address. Virtaddr can be either a short or long pointer. Examples $nmdebug > wl pc PROG $741.5934 Display the current logical code address (LCPTR) of the NM program counter. $nmdebug > wl vtor(pc) $1827934 Translate the logical code address (LCPTR) into the corresponding real address. $nmdebug > wl rtov(1827934) $741.5934 Converts the real address back into a virtual address (LPTR).
System Debug Standard Functions func vtos Examples $nmdebug > wl vtos(b.40040200) SADDR $14.e0200 Convert the virtual address b.40040200 to a secondary storage address and display the result. The secondary storage address is LDEV $14 at byte offset $e0200.
System Debug Standard Functions 11 System Debug Standard Functions This chapter presents the full formal declaration for each of the standard functions which are defined in System Debug. All functions are callable from both DAT and Debug. All functions can be called from both Native Mode (NM) and Compatibility Mode (CM). Some functions, however, deal specifically with NM or CM attributes.
System Debug Standard Functions Name Type Description U16 : U16 Coerces an expression to unsigned 16-bit INT U32 : U32 Coerces an expression to unsigned 32-bit INT UTILITY Functions Name Type Description ASC : STR Converts an expression to an ASCII string BIN : INT Converts an ASCII string to binary value BITD : ANY Bit deposit BITX : ANY Bit extract BOUND : STR Tests for current definition of an operand CISETVAR : BOOL Sets a new value for a CI variable CIVAR : ANY Returns
System Debug Standard Functions Name Type Description NMNODE : TRANS NM Address of closest NM node point NMTOCMNODE : LCPTR CM address of closest NM node point OFF : U32 Extracts offset part of a virtual address PHYSTOLOG : LCPTR CM physical segment/map bit to logical RTOV : LPTR real to virtual SID : U32 Extracts the SID (space) part of a long pointer STOL : LPTR Short pointer to long pointer STOLOG : LCPTR Short pointer to logical code address VTOR : U32 Virtual to real VTOS
System Debug Standard Functions Name Type Description CMBPADDR : LCPTR Logical address of a CM breakpoint index CMBPINDEX : S16 Index number of a CM breakpoint address CMBPINSTR : S16CM Instruction at a CM breakpoint address CMENTRY : LCPTR Logical entry address of a CM procedure CMPROC : STR Returns the name of a CM procedure CMPROCLEN : U16 Returns the length of CM procedure CMSEG : STR Returns the CM segment name at logical address CMSTART : LCPTR Logical start address of CM pr
System Debug Standard Functions func civar Name Type Description STRPOS : U16 Locates a substring within a string STRRPT : STR String repeat STRRTRIM : STR Removes trailing blanks from a string STRUP : STR Upshifts a string STRWRITE : STR Builds a string from a value list SYMBOLIC Functions Name Type Description SYMADDR : U32 Returns the offset within a type to the specified symbolic field SYMCONST : ANY Returns the value of a declared constant SYMINSET : BOOL Tests for set inc
System Debug Standard Functions func civar Parameters civarname The name of the CI variable. stropt A string that determines whether the CI should attempt to evaluate the named variable. EVALUATE Evaluate the CI variable NOEVALUATE Do not evaluate the CI variable (Default) This string parameter can be abbreviated. Examples $nmdebug > wl civar ("hpgroup"); DEMO $nmdebug > wl civar ("hpaccount"); TELESUP Display the current value of the CI variables named HPGROUP and HPACCOUNT.
System Debug Standard Functions func strrtrim func strrtrim String right trim. Deletes trailing blanks from the source string. Syntax strrtrim (source) Formal Declaration strrtrim:str (source:str) Parameters source The string from which all trailing blanks are to be deleted. Examples $nmdebug > wl strrtrim(" A string with extra blanks. " A string with extra blanks." %cmdebug > = strltrim(strrtrim(" "ABCD" ABCD "):"qo" ")) Delete both leading and trailing blanks.
System Debug Standard Functions func strwrite Parameters valuelist A list of expressions, in the form of a single string, to be formatted. The expressions can be separated by blanks or commas: value1, value2 value3 ... An optional format specification can be appended to each expression, introduced with a required colon, in order to select one of the following: a specific output base, left or right justification, blank or zero fill, and a field width for the value. value1[:fmtspec1] value2[:fmtspec2] ...
System Debug Standard Functions func strwrite T Typed (display the type of the value) U Untyped (do not display the type of the value) QS Quote single (surround w/ single quotes) QD Quote double (surround w/ double quotes) QO Quote original (surround w/ original quote character) QN Quote none (no quotes) The M directive (minimum field width) selects the minimum possible field width necessary to format all significant digits (or characters in the case of string inputs).
System Debug Standard Functions func strwrite Trailing spaces are always blank filled. In specifications with quotes, the quotes do not count in the number of positions specified. The string is built such that it appears inside the quotes as it would without the quotes. The T directive (typed) displays the type of the value, preceding the value. The U directive (untyped) suppresses the display of the type. Types are displayed in upper case, with a single trailing blank.
System Debug Standard Functions func symaddr number:"c6" NOTE The Cn directive is ignored by the ASC function but is honored by the W, WL and WP commands. Examples $nmdat > var save = strwrite('1 2 3 "-->" 4:"z w4 r z" $nmdat > wl save $1$2$3-->0004$5 5') The string variable save is used to store the function return value. STRWRITE is equivalent to the W(WRITE) command, but the formatted output is returned in a string. Note the single quotes which surround the value list.
System Debug Standard Functions func symaddr Specifies the units (that is, bit width) in which the result is given. 1 means bits, 8 means bytes, 32 means words. The default is bytes. units Symbolic offsets are rounded down to the nearest whole unit. Examples $nmdebug > symopen gradtyp.demo Opens the symbolic data type file gradtyp.demo. It is assumed that the Debug variable addr contains the address of a StudentRecord data structure in virtual memory.
System Debug Standard Functions func symconst func symconst Returns the value of a declared constant. Syntax symconst (pathspec) Formal Declaration symconst:any (pathspec:str) Parameters pathspec A path specification, as described in chapter 5, "Symbolic Formatting/ Symbolic Access." Examples $nmdebug > symopen gradtyp.demo Opens the symbolic data type file gradtyp.demo. It is assumed that the Debug variable addr contains the address of a StudentRecord data structure in virtual memory.
System Debug Standard Functions func syminset func syminset Returns a Boolean value of TRUE if the set member specified by the member parameter is in the set specified by the virtual address and the path specification. Syntax syminset (virtaddr pathspec member) Formal Declaration syminset:bool (virtaddr:ptr pathspec:str member:str) Parameters The virtual address of the start of the set. virtaddr Virtaddr can be a short pointer, a long pointer, or a full logical code pointer.
System Debug Standard Functions func symlen func symlen Returns the length of a data structure in bits or bytes. Syntax symlen (pathspec [units]) Formal Declaration symlen:u32 (pathspec:str [units:u32=$8]) Parameters pathspec A path specification, as described in chapter 5, "Symbolic Formatting/Symbolic Access." units Specifies the units (that is, bit width) in which the result is given. 1 means bits, 8 means bytes, 32 means words. The default is bytes.
System Debug Standard Functions func symtype $nmdebug > wl SYMLEN("StudentRecord") $40 Returns the size of a complete StudentRecord in bytes. $nmdebug > wl SYMLEN("StudentRecord" $200 1) Returns the size of a complete StudentRecord in bits. $nmdebug > wl SYMLEN("StudentRecord.Grades" #32) $a Returns the size of grades field in a StudentRecord in words. Limitations, Restrictions none func symtype Returns the type of a component described by the path specification.
System Debug Standard Functions func symtype TYPE GradeRange GradesArray Class NameStr = MINGRADES ..
System Debug Standard Functions func symval $nmdebug > wl symtype("StudentRecord.NumGrades") GRADERANGE Print out the type name of the NumGrades field of a StudentRecord. Limitations, Restrictions None. func symval Returns the value of a simple data type specified by a virtual address and a path. Syntax symval (virtaddr pathspec) Formal Declaration symval:any (virtaddr:ptr pathspec:str) Parameters virtaddr The virtual address of the data structure.
System Debug Standard Functions func symval StudentRecord = RECORD Name Id Year NumGrades Grades END; Chapter 11 : : : : : NameStr; Integer; Class; GradeRange; GradesArray; 501
System Debug Standard Functions func sys $nmdebug > wl symval(addr "StudentRecord.Name") Bill $nmdebug > wl symval(addr, "StudentRecord.Year") SENIOR $nmdebug > IF symval(addr "StudentRecord.Year") = "SENIOR" THEN wl "GRAD!" GRAD! Refer to the section "Using the Symbolic Formatter" in chapter 5 for more examples including pointers, arrays, and variant/invariant record structures. Limitations, Restrictions The path specification used by the SYMVAL function must evaluate to a simple type or a string.
System Debug Standard Functions func sys Table 11-1. Derivation of the SYS Bit Pattern Parameter Type Action S16 S32 S64 Set the SID part to zero. Right justify the original value in the low-order 32 bits of the offset part with sign extension. LONG Class Transfer both parts of the address unchanged. EADDR SADDR Transfer the SID part unchanged. Transfer the low-order 32 bits of the offset part. STR Transfer the ASCII bit pattern for the last eight characters in the string.
System Debug Standard Functions func tcb SYS $1.2 Limitations, Restrictions none func tcb Returns the real address of a process' TCB (task control block). Syntax tcb (pin) Formal Declaration tcb:u32 (pin:u16) Parameters The process identification number (PIN) for which the real address of the TCB is to be returned. pin Examples $nmdebug > wl tcb(8) $8b5480 Display the real address of the task control block for process 8.
System Debug Standard Functions func trans func trans Coerces an expression into a TRANS logical code pointer (LCPTR). Syntax trans (value) Formal Declaration trans:trans (value:any) Parameters value An expression to be coerced. All types are acceptable. Table 11-2. Derivation of the TRANS Bit Pattern Parameter Type Action BOOL 0.1 if TRUE, 0.0 if FALSE. U16 Set the SID part to zero. Right justify the original value in the low-order 32 bits of the offset part with zero fill.
System Debug Standard Functions func typeof TRANS %24.630 The coercion simply changes the type. Note that no complicated conversion or range checking is performed. Limitations, Restrictions none func typeof Returns the type of an evaluated expression as a string. Syntax typeof (expr) Formal Declaration typeof:str (expr:any) Parameters expr Any expression for which the resultant type is desired.
System Debug Standard Functions func typeof $nmdebug > wl typeof("Nellie of Meadow Farm") STR $nmdebug > wl typeof(typeof(123)) STR $nmdebug > wl typeof(pc) SYS Chapter 11 507
System Debug Standard Functions func u16 $nmdebug > wl typeof(cmpc) GRP $nmdebug > wl typeof(cmtonmnode(cmpc)) TRANS $nmdebug > wl typeof(a.c00024c8) LPTR $nmdebug > wl typeof(pib(pin)) SPTR Limitations, Restrictions none func u16 Coerces an expression into an unsigned 16-bit value. Syntax u16 (value) Formal Declaration u16:u16 (value:any) Parameters value An expression to be coerced. All types are valid. Table 11-3.
System Debug Standard Functions func u16 Table 11-3. Derivation of the U16 Bit Pattern Parameter Type U32 Action Transfer the low-order 16 bits. S32 S64 SPTR LONG Class Transfer the low-order 16 bits of the offset part. EADDR SADDR STR Transfer the ASCII bit pattern for the last two characters in the string. Strings shorter than two characters are treated as if they were extended on the left with nulls.
System Debug Standard Functions func u32 Limitations, Restrictions none func u32 Coerces an expression into an unsigned 32-bit value. Syntax u32 (value) Formal Declaration u32:u32 (value:any) Parameters value An expression to be coerced. All types are valid. Table 11-4. Derivation of the U32 Bit Pattern Parameter Type Action BOOL 1 if TRUE, 0 if FALSE. U16 Right justify the original 16-bit value in 32 bits with zero fill. S16 U32 Transfer the original bit pattern unchanged.
System Debug Standard Functions func user Examples $nmdat > wl u32( 1 ) $1 $nmdat > wl u32( ffff ) $ffff $nmdat > wl u32( ffff ):"#" #65535 $nmdat > wl u32( 1234abcd ) $1234abcd $nmdat > wl u32( -1 ) $ffff $nmdat > wl u32( ffffffff ):"#" #4294967295 $nmdat > wl u32( 1234.5678 ) $5678 $nmdat > wl u32( true ) $1 $nmdat > wl u32( "ABCDEFG" ) $44454647 $nmdat > wl u32( prog(1.2) ) $2 Limitations, Restrictions none func user Coerces an expression into a USER library logical code pointer (LCPTR).
System Debug Standard Functions func user Formal Declaration user:user ([library:str=''] value:any) Parameters library If this value is provided, System Debug restricts procedure name searches to the indicated executable library. This restriction remains in effect until the function's parameters have been completely evaluated. The program file's group and account are used to fully qualify the library file name if needed. The library must have been loaded by the process.
System Debug Standard Functions func vainfo conversion or range checking is performed. $nmdebug > wl user("mylib.test" myproc ) USER $3f.4c04 We asked for the address of the procedure myproc. By providing a library name, we restricted the search for the procedure to the executable library named mylib.test. Limitations, Restrictions none func vainfo Returns selected information for the specified virtual address.
System Debug Standard Functions func vainfo MAX_SIZE OBJECT_CLASS OPTIONS PAGES_IN_MEM PDIR_HASH PID VS_OD_PTR VPN_CACHE_ENTRY_PTR VS_BTREE_HASH VS_VPN_CACHE_HASH Yes Yes Yes Yes No Yes No No No No Yes Yes Yes No Yes Yes Yes Yes Yes Yes Yes Yes Yes No Yes Yes Yes Yes Yes Yes Examples $nmdat > var pibva pib(1) $nmdat > wl vainfo (pibva, "vs_od_ptr") $a.c1002ec0 $nmdat > dv c1002ec0,58/4 $ VIRT a.c1002ec0 $ 00000001 08010000 7ffd7ffd $ VIRT a.c1002ed0 $ 00000000 0000000a c3580000 $ VIRT a.
System Debug Standard Functions func vtor func vtor Virtual to real. Converts a virtual address to a real address. Syntax vtor (virtaddr) In Debug, if the virtual address is not resident, it is brought into memory. In DAT, if the virtual address is not resident, an error is generated. Formal Declaration vtor:u32 (virtaddr:ptr) Parameters virtaddr The virtual address to be converted to a real address. Virtaddr can be either a short or long pointer. Examples $nmdebug > wl pc PROG $741.
System Debug Standard Functions func vtor 516 Chapter 11
Dump Analysis Tool (DAT) How DAT Works 12 Dump Analysis Tool (DAT) The Dump Analysis Tool (DAT) is a program you can use interactively to analyze MPE XL system events such as process hangs, operating system failures, or hardware failures. DAT is used primarily by Hewlett-Packard support and lab personnel. How DAT Works As input the DAT program accepts a snapshot dump generated by the DUMP utility. For output, DAT reads the dump tape into one or more disk files, called the dump file set.
Dump Analysis Tool (DAT) Operating DAT 3. Create the dump. A request will appear on the system console to mount the dump tape. The following example creates the dump EXAMP. $nmdat>GETDUMP examp Please mount dump volume #1. 4. Mount the dump tape when prompted by the message on the system console. Press RETURN. As the dump is being loaded, DAT will display a series of messages about the dump indicating GETDUMP progress: Tape created by SOFTDUMP 99999X A.00.00 MPE-XL B.05.
Dump Analysis Tool (DAT) Operating DAT PURGEDUMP command. $nmdat> PURGEDUMP examp $nmdat> EXIT : NOTE When you use the EXIT command in DAT, the DAT program terminates immediately. Using the info= String DAT automatically executes any commands specified within the info= string on a RUN DAT command. These commands are executed before any commands found in the optional DATINIT file(s).
Dump Analysis Tool (DAT) The DAT Macros • Typically, only NL.PUB.SYS symbols are accessible in NM. This is because NL.PUB.SYS is treated as a special file by the DUMP utility. The complete NL is dumped along with a pre-built symbol table which enables DAT to quickly map back and forth between addresses and symbol names. Additional executable libraries may also be accessible, if they have been marked to be dumped. • NM stack traces will only trace procedures in NL.PUB.SYS.
Dump Analysis Tool (DAT) The DAT Macros data type files (SYMOS, VAMOS)are distributed in the TELESUP account. How to Get Started with the DAT Macros Using the DAT macro package is the simplest way to analyze a dump. Additional documentation is required to make use of the macros. Contact your Response Center for further information. To use this package, log on to the TELESUP account in the USER group.
Dump Analysis Tool (DAT) The DAT Macros SYSTEM ABORT #1019 FROM SUBSYSTEM #101 (Memory Manager) The MEMORY MANAGER was unable to access the I/O notification port. MPE/XL VERSION: A21.
Dump Analysis Tool (DAT) The DAT Macros Total of #8 processes The following example shows all the configured devices on the system. This macro was terminated with a ControlY before it reached normal completion.
Dump Analysis Tool (DAT) The DAT Macros #J28 #J31 #J37 #J40 #J43 #J154 #J155 #J61 #J55 #58 #J157 #S8 EXEC EXEC EXEC EXEC EXEC EXEC EXEC EXEC EXEC EXEC EXEC EXEC 8 8 8 8 8 8 8 8 8 8 8 8 10S 10S 10S 10S 10S 10S 10S 10S 10S 10S 10S 122 12 12 12 12 12 12 12 12 12 12 12 122 135 135 135 135 135 135 135 135 135 135 135 35 13:47 13:47 13:49 13:49 13:50 16:19 16:20 13:54 13:53 13:54 16:20 13:55 PEGASUS,SMGR.TEST,PEGASUS PEGASUS,SMGR.TEST,PEGASUS PEGASUS,SMGR.TEST,PEGASUS PEGASUS,SMGR.
Standalone Analysis Tool (SAT) How SAT Works 13 Standalone Analysis Tool (SAT) The Standalone Analysis Tool (SAT) aids support and lab personnel in analyzing MPE/iX system events such as process hangs, operating system failures, and hardware failures. How SAT Works SAT is implemented as a standalone image. You can boot it from ISL. This means you can analyze system failures as soon as they occur without taking a dump.
Standalone Analysis Tool (SAT) Operating SAT CM>CO Return to Console mode Processor Dependent Code (PDC) Revision 3 Console Path = 8.1.0.0.0.0.0 Primary boot Path = 8.0.0.0.0.0.0 Alternate boot path = 8.2.3.0.0.0.0 Autoboot from primary path enabled. To override, press any key within 10 seconds. 10 seconds expired -- proceeding with autoboot. Booting from primary boot path = 8.0.0.0.0.0.0 Console IO Dependent Code (IODC) revision Boot IO Dependent Code (IODC) revision 3 3 Soft Booted. MMSAVE Version 9.
Standalone Analysis Tool (SAT) Operating Restrictions 00000007 R16/00000000 0000000e 00000003 00678000 8118a000 00000014 c6809880 00000000 R24/00000000 00000000 0004007b c0200008 fba8b500 0000000e 8118a6e0 00d84200 Space Registers --------------S 0/0000000a 0000010d 00000000 00000000 0000000a 0000000a 0000000b 0000000a Control Registers ----------------C 0/00000000 00000000 00000000 C 8/00000102 00000000 ffffffff C16/fd3c3e64 0000000a 00000000 C24/005e4200 00634200 00007ffd Current CPU: 720000 0 00000000
Standalone Analysis Tool (SAT) Operating Restrictions — The FPMAP command is automatic and is executed at boot time. When the most recent process is executing in REAL mode, it may be necessary to switch to another PIN and issue the FPMAP command explicitly. Since only SL.PUB.SYS CM symbols are accessible, no parameters are need with FPMAP. — For standard functions nmaddr and nmfile, only addresses contained in the system library will succeed.
Standalone Analysis Tool (SAT) SAT Functions and Commands MAPL List mapped files. MODD Delete temporary dump modification(s) in DAT. MODL List temporary dump modification(s) in DAT. NMCALL Dynamically invoke the specified routine. OPENDUMP Open a dump file. PAUSE Sleep for a bit. PSEUDOMAP Maps in a local copy of a code file to a virtual address. PURGEDUMP Purge a dump file. REGLIST List registers to a file. RESTORE Restore macros/variables from a binary file. S[S] Single Step.
Standalone Analysis Tool (SAT) SAT Functions and Commands MZ modifies a real address MSEC modifies addresses in secondary (disk drive) storage NOTE Take care when using these commands; modifications can be permanent, such as disk changes. The FPMAP command is automatic and is executed at boot time. When the most recent process is executing in REAL mode, it may be necessary to switch to another PIN and issue the FPMAP command explicitly. Only SL.PUB.
Patterns and Regular Expressions Literal Expressions (Match Exactly These Characters) A Patterns and Regular Expressions Several System Debug commands apply the concept of pattern matching. Commands such as CMDLIST, ENVLIST, FUNCLIST, MACLIST, PROCLIST, SYMLIST, and VARLIST support pattern matching in order to select which commands, functions, macro names, procedure names, symbol names, or variables are to be displayed.
Patterns and Regular Expressions Character Classes (Match Any One of the Following Characters) The "." and other reserved characters are called metacharacters. The special meaning of any metacharacter can be turned off by preceding it with the escape character "\". Thus, "\." matches the literal period character and "\\" matches the literal backslash. Two positional metacharacters exist.
Patterns and Regular Expressions Technical Summary Technical Summary The following list summarizes the expressions discussed above: c Literal character .
Patterns and Regular Expressions Technical Summary ? Matches any alphabetic character (same as `[a-zA-Z]`) # Matches a numeric character (same as `[0-9]`) 534 Appendix A
Expression Diagrams B Expression Diagrams The following diagrams depict valid expressions for DAT/Debug: expression := ---+--> | +<-- simpexpr := simpexpr simpexpr relop [+-] --+--> | +<---| +<---- term + OR ---+--> | --+ --+--> | -----+ add, subtract | -----+ logical OR term := --+--> factor | +<---* / | +<------- MOD | +<------- AND factor := --+--> addrvalue -----+--> | | +<---<< -----+ left shift bits +<--->> -----+ right shift bits | | +<-------- BAND ---------+ bit AND +<-------- BOR -----
Expression Diagrams value := numeric-literal --+--> | +--> | +--> | +--> | +--> | +--> +--> ---+--> string-literal variable [ indirect_addr ( simpexpr ] ) NOT expression BNOT expression -->+ | -->+ | -->+ | -->+ | -->+ -->+ numeric-literal := 123 | %123 | #123 | $123 string-literal := "ABCD" | relop := >= < <= 224 | = > 'ABCD' | "AB", 'ab', `ab` sdst contents of ( 25/3 + 1 ) NOT (n < 6 ) BNOT $FF0F default, oct, dec, hex `abcd` <> indirect-addr := CST seg.offset CSTX seg.
Emulated/Translated CM Code C Emulated/Translated CM Code Compatibility mode code segments are executed in emulation mode, unless they have been translated by the Object Code Translator (OCT). Emulation of an instruction can be described in the following way: 1. Fetch the instruction at the current program counter (CMPC). 2. Emulate that instruction with NM precision architecture instructions. 3. Update the program counter to point at the next instruction.
Emulated/Translated CM Code Debugging Emulated CM Code Debugging Emulated CM Code Debugging emulated CM code is relatively straightforward. Since each CM instruction is fetched and emulated, it is necessary to know only where you wish to set a breakpoint. For emulated CM code you can break at any instruction: $ cmdebug > B PROC+%6 $ cmdebug > B PROC+%10 $ cmdebug > B PROC+%15 The debugger places a special BRKP instruction at the specified addresses.
Emulated/Translated CM Code Object Code Translation Object Code Translation The Object Code Translator (OCT) can be used to analyze CM object code and to translate the CM object code instructions into NM precision architecture instructions. Please refer to MPE V to MPE XL: Getting Started. Translated object code executes significantly faster than the original CM code can be emulated.
Emulated/Translated CM Code Node Points in Translated Code Node Points in Translated Code The following diagram shows adjacent sections of CM object code that have been translated into new sections of NM code. The first instruction of each section is marked as a node point. Each CM node point has a corresponding NM node point.
Emulated/Translated CM Code Executing a Translated Section Executing a Translated Section The following diagram indicates that the NM program counter (pc >) is located at the start (node point) of a NM translated section of code. When all of the instructions in this section are executed, (that is, when pc advances to the next node point at PROC+%6), then the state of the machine is exactly the same as if the four original CM object code instructions had been executed (PROC+%2 through PROC+%6).
Emulated/Translated CM Code The Node Functions The Node Functions Four special functions (CMNODE, CMTONMNODE, NMNODE, NMTOCMNODE) are provided to locate the nearest "previous" and "next" nodes for translated code. The following diagram shows CM object code loaded at %12.0 with its corresponding NM translated code loaded at $1c.34b0. Node points are flagged with an "N". Original CM Object Code Translated Object Code CM Instructions NM Instructions Seg.Off %12.0 %12.1 %12.2 %12.3 %12.4 %12.5 %12.7 %12.
Emulated/Translated CM Code CM Breakpoints in Translated Code CM Breakpoints in Translated Code The following discussion assumes that the current Debug mode is CM (prompt is: %cmdebug > ). When a CM breakpoint is set at a CM address of a segment that has been translated, Debug actually sets two breakpoints simultaneously: 1. A CM breakpoint at the specified CM address in the emulated object code, in case the code runs emulated. 2.
Emulated/Translated CM Code NM Breakpoints in Translated Code NM Breakpoints in Translated Code The following discussion assumes that the current Debug mode is NM (prompt is: $nmdebug > ). NM breakpoints can be set at every instruction within translated code even if the instruction is not at a node point. This allows careful inspection of the actual sections of NM translated code. NOTE Portions of the CM state may be undefined or incorrect when a NM breakpoint is encountered between node points.
Emulated/Translated CM Code Examples: CM Breakpoints in Translated Code Examples: CM Breakpoints in Translated Code The following examples show CM breakpoints being set in a segment that has been translated, and is executing translated: %cmdebug > bs ?LSEARCH added: CM [1] SYS 12.20251 LSEARCH+%0 NM [1] TRAN 21.00530994 XLSEG3:LSEARCH+%0 %cmdebug > bs ?LSEARCH+3 added: CM [2] SYS 12.20254 LSEARCH+%2 NM [2] TRAN 21.0053099c XLSEG3:LSEARCH+%1 %cmdebug > bs 12.20256 added: CM [3] SYS 12.
Emulated/Translated CM Code Examples: Program Windows for Translated Code Examples: Program Windows for Translated Code The following window commands allow inspection of the breakpoints that were just set on the previous page: TIP %cmdebug %cmdebug %cmdebug %cmdebug > > > > rd;qd;sd /* clear some room for NM nmpe /* enable the NM program window cmpj ?LSEARCH /* jump CM to ?LSEARCH nmpj cmtonmnode(?LSEARCH) /* jump NM to nearest node {{cmP % SYS 12.
Reserved Variables/Functions D Reserved Variables/Functions The following lists the reserved names for the predefined environment variables (env) and functions (func). Table D-1. Predefined Environment Variables and Functions Name Type Description abstolog func : lcptr CM absolute address to logical address arg0..
Reserved Variables/Functions Table D-1.
Reserved Variables/Functions Table D-1. Predefined Environment Variables and Functions Name Type Description dp env : sptr data pointer (alias for R27) dstbase env : lptr virtual address of the CM Data Segment Table dstva func : lptr converts CM dst.
Reserved Variables/Functions Table D-1.
Reserved Variables/Functions Table D-1.
Reserved Variables/Functions Table D-1. Predefined Environment Variables and Functions Name Type Description outbase env : str current output base pc env : lptr NM program counter (sid.off) pcb func : sptr process control block pcbx func : sptr process control block extension pcob env : sptr program counter offset back (off) pcof env : sptr program counter offset front (off) pcqb env : lptr program counter queue back (sid.off) pcqf env : lptr program counter queue front (sid.
Reserved Variables/Functions Table D-1. Predefined Environment Variables and Functions Name Type Description q env : u16 CM Q register quiet_modify env : bool skip display of current values for modifies r0 .. r31 env : u32 general registers r0, r1, r2, .. r31 rctr env : u32 recovery counter ret0 ..
Reserved Variables/Functions Table D-1.
Reserved Variables/Functions Table D-1.
Reserved Variables/Functions 556 Appendix D
Command Summary E Command Summary Standard Commands Window Commands : = ABORT ALIAS ALIASD[EL] ALIASINIT ALIASL[IST] B BA BAX BD BG BL BLG BLP BP BS BU BV C[ONTINUE] CLOSEDUMP CM CMDL[IST] CMG CMPB CMPD CMPE CMPF CMPH CMPJ CMPJA CMPJAX CMPJG CMPJLG CMPJLP CMPJP CMPJS CMPK CMPL CMPR DA DATAB DATABD DATABL DC DCA DCAX DCG Appendix E access to the command interpreter calculator, expression evaluation terminate dat/debug session define a user alias delete a command alias restore the pre-defined aliases list
Command Summary DCLG DCLP DCP DCS DCU DD DDB DELETEALIAS DELETEB DELETEERR DELETEMAC DELETEVAR DEMO DIS DO DPIB DPTREE DQ DR DS DSEC DUMPINFO DV DZ E[XIT] display code in the logon group library display code in the logon account library display code in the account library display code in the system library display code in any (user) NM library display data segment display CM DB-relative predefined alias for ALIASD predefined alias for BD predefined alias for ERRD predefined alias for MACD predefined alias
Command Summary GRE GRK GRL H[ELP] HIST[ORY] IF IGNORE INITCM INITNM KILL LB LD LE LEV enable the NM general registers window kill the NM general registers window change the size of the NM general registers window print help print history of command stack IF THEN {cmdlist} ELSE {cmdlist} ignore error test after the following command initialize CM registers from any address initialize NM registers from any address kill the indicated PIN scroll the Ldev window back disable the Ldev window enable
Command Summary MZ modify real memory NM NMPB NMPD NMPE NMPF NMPH NMPJ NMPJG NMPJP NMPJS NMPJU NMPK NMPL NMPR OPENDUMP PAUSE PB PD PE PF PH PIN PJ PJA PJAX PJG PJLG PJLP PJP PJS PJU PJV PK PL PR PROCLIST PSEUDOMAP PURGEDUMP QB QD QE QF QH QJ QK QL QR RD RE RED REDO REGLIST RESTORE RET[URN] RH 560 enter Native Mode (nmdat/nmdebug) scroll the NM program window backwards disable the NM program window enable the NM program window scroll the NM program window forwards home the NM program window jump the NM
Command Summary RK RL RR S[S] kill the CM register window change the size of the CM register window change the radix of the CM register window SET SETALIAS SETENV SETERR SETLOC SETMAC SETVAR SF SH SHOWALIAS SHOWB SHOWCMD SHOWDATAB SHOWENV SHOWERR SHOWFUNC SHOWLOC SHOWMAC SHOWSET SHOWSYM SHOWVAR SJ SK SL STORE SR SRE SRD SRH SRK SRL SYMCLOSE SYMF[ILES] SYMINFO SYML[IST] SYMOPEN SYMPREP single step, same as SS scroll CM stack window back disable the CM stack window enable the CM stack window set user conf
Command Summary TR[ACE] TRAP stack trace arm/disarm/list various catchable traps TS TXB TXC TXD TXE TXF TXH TXI TXJ TXK TXL TXS TXW UB UC UFC UFCA UFCAX UFCG UFCLG UFCLP UFCP UFCS UFCU UFDA UFVA UD UE UF UH UK UL UN UNMAP UNWIND UPD UR USE USENEXT UWA UWCA UWCAX UWD UWDB UWL UWS UWQ UWV UWZ VAR VARD[EL] VARL[IST] VB VC VD 562 translate CM S-relative address to virtual scroll text window backward mark the text window as current disable the text window enable the text window scroll text window forward ho
Command Summary VE VF VH VJ VI VK VL VN VR VW W WCOL WDEF WGRP WHELP WHILE WL WOFF WON WP WPAGE XL XLD XLL ZB ZD ZE ZF ZH ZJ ZK ZL ZR ZW Appendix E enable the virtual window scroll virtual window forward home the virtual window jump the virtual window to a new location information about indicated or all windows kill the virtual window change the size of the virtual window rename the virtual window change the radix of the virtual window allocate a new virtual window write formatted value list set output p
Command Summary 564 Appendix E
Index Symbols !:in variable names, 39 !:use, 43, 44 $SYMDEBUG Option, 299 (CI)Commands, 72 : (CI) Command (access to command interpreter, 72 :DEBUG entry from CI, 55 :SETDUMP Command, 57 << Operator, 33 = (Calculator) Command, 73 >> Operator, 33 ? for entry address, 42 ? Use, 43 ?:use, 44 { }:use, 22 A Abbreviated Stack Trace, 53 Abort Current Process, 75 Absolute Code Pointers, 24 Absolute Code Segment Numbers relation to logical, 25 Absolute CST Segments, 25 Absolute CSTX Segments, 25 Absolute Memory Add
Index B B (Break) Command, 82 BAND Operator, 33 Bank 0 Addresses, 35 Base output display, CM, 136 BD Command, 92 Beginning the DAT program, 517 bin Function, 362 Binary Conversion of string, 362 Bit Deposit Function, 362 Bit Extract Function, 364 bitd Function, 362 bitx Function, 364 BL Command, 95 BNOT Operator, 33 bool Function, 365 Boolean Comparisons, 33 Boolean Data Type, 23 Boolean Operators AND, 32 examples, 32 NOT, 32 OR, 32 Boolean Value Coercion, 365 BOR Operator, 33 bound Function, 366 Breakpoin
Index Code Address virtual address of, 390 Code Path Name for address, 422 Code Segment unfreeze, 278 Coerce Expression to extended address, 395 to GRP pointer, 397 to LGRP pointer, 400 to Long pointer, 402 to LPUB pointer, 404 to PROG pointer, 431 to PUB pointer, 434 to secondary address, 440 to short pointer, 443 to Signed 16-Bit, 436 to Signed 32-Bit, 438 to Signed 64-Bit, 439 to string, 361 to SYS pointer, 468, 502 to TRANS pointer, 471, 505 to unsigned 16-Bit, 474, 508 to unsigned 32-Bit, 476, 510 Coe
Index program window, 136 register window, 313 registers, displaying, 123 search order, 42 segment name, 384 segments, 25 stack frame window, 318 stack limit, 386 stack starting address, 385 stack, DST number, 386 STACKDUMP' intrinsic, 69 status register, 151 to enter, 98 top of stack window, 319 translated code, executing, 541 windows, 310 Component Offset, 461, 493 Component Type, 466, 498 Concatenation Function, 447 Concatenation Operator, 37 Condition Code, 135 CONSOLE_DEBUG Environment Variable, 48, 1
Index string, 23 type classes, 26 DATAB Command, 111 DATE Environment Variable, 138 DATINIT Files, 519 DB DST Number, 139 DB Environment Variable, 138 DB Register DM, 138 DBDST Environment Variable, 139 DBUGINIT Initialization Files, 49 DEBUG DEBUG CI Command, 52 Debug access to, 116 arming a call to, 53 arming calls, 62, 64 bootstrap process, 48 command line overview, 21 command summary, 557 commands and intrinsics, 55 commands for Debug only, 71, 199 direct calls from command interpreter, 52 disarming a
Index Dump file set building, 518 creating, 517 in DAT, 517 opening, 518 opening additional, 518 purging, 518 Dump tape, 517 making, 517 DUMP_COMP_ALGO Environment Variable, 139 DUMPALLOC_LZ Environment Variable, 139 DUMPALLOC_RLE Environment Variable, 139 DYING_DEBUG Environment Variable, 139 Dynamic Loads, 193 Dynamic Procedure Calling, 417 E EADDR (Extended Address), 26 eaddr Function, 395 ECHO_CMDS Environment Variable, 139 ECHO_SUBS Environment Variable, 140 ECHO_USE Environment Variable, 140 Echoing
Index Error Bailout, 184 Error Command Stack, 158 ERROR Environment Variable, 47, 140 Error Handling, 47 Error Message String, 396 Error Messages IGNORE, 135 Error Number most recent, 140 obtaining error message for, 396 Error Output restricting quantity of, 147 Error Stack, 47 delete errors on, 159 list errors on, 159 resetting, 47 Escape Character, 45 ESCAPECODE Environment Variable, 140 Evaluated Expression type of, 472, 506 Exclamation Point, 39, 43, 44 EXEC_MODE Environment Variable, 140 executable li
Index Function Calls tracing, 154 Functions, 351, 483 abstolog, 355 address, 352, 484 asc, 356 ascc, 361 bin, 362 cmnode, 542 cmtonmnode, 542 coercion, 351, 483 displaying, 174 for nodes, 542 listing, 174 nmnode, 542 nmtocmnode, 542 procedure, 353, 485 process, 353, 485 reserved, 547 string, 354, 486 symbolic, 355, 487 table of, 351, 483 utility, 352, 484 functions in SAT, 529 Fx (Format) Command, 164 G G Window, 320 Gateway Page, 91 General Registers, 124, 234 NM, 151 window, 314 GETDUMP_COMP_ALGO Environ
Index SETDUMP, 54 XARITRAP, 55 XCODETRAP, 55 Invocation of Debug, 51 Invoking DAT, 517 ISL, 525 Help Function, see CMDL, 98 ITMR Environment Variable, 144 IVA Environment Variable, 144 J Job Debugging, 48 JOB_DEBUG Environment Variable, 48, 144 Justification windows and display, 144 L LCPTR Type Class, 41 LDEV for I/O, 153 LDEV Window, 322 address where aimed, 146 ldev.
Index Lowercase Hexadecimal Output, 142 LPTR in compatibility mode, 24 LPTR (Long Pointer), 23 lptr Function, 402 LPUB Defined, 24 lpub Function, 404 LST (Loader Symbol Table), 42 ltolog Function, 405 ltos Function, 407 M MAC Command, 40 macbody Function, 408 Machine Characteristics, 129 Macro Bodies, 39 referencing local variables, 148 Macro Body for macro name, 408 Macro Name macro body for, 408 Macro Parameters, 41 Macro Table absolute size of, 146 controlling size of, 146 Macros, 40 aliases, 46 as comm
Index pointers, 26 procedure entry point, 418 procedure name for virtual address, 424 procedure/data path address, 410 procedures names, looking up, 145 process's stack limit address, 426 process's stack starting address, 425 program counter window, 316 program window, where aimed, 147 registers, displaying, 123 return pointer, 151 search order, 42 short pointer to LCPTR, 445 special registers, 314 to enter, 239 windows, 311 Nearest NM Node Point, 389 Nested Call Level macros, 146 Nested IF Commands, 183 N
Index Pattern Matching, 531 PC Register, 126, 236 PCB (Process Control Block), 428 pcb Function, 428 PCBX, 429 pcbx Function, 429 PCOF low two bits of, 149 priv level, 149 PCSF Environment Variable, 149 PDIRidx determining first entry, 399 physical memory addressing, 517 Physical Segment Number, 429 phystolog Function, 429 PIB virtual address, 430 pib Function, 430 PIBX virtual address, 431 pibx Function, 431 PIN display last active, 129 identifying current, 149 last running at dump, 144 process state of,
Index dying, 139 pausing, 241 Processor CPU number, 137 Processor Status Register, 150 Processor Status Word modify, 232 PROG Defined, 24 prog Function, 431 Program Counter CM, 315 NM, 316 Program Counter Offset NM, 148 Program Counter Register, 126, 236 as logical code address, 148 Program Counter SID NM, 149 Program Counter sid.
Index processor status, 150 pseudo, 124, 235 Q (CM), 150 recovery counter (NM), 151 return register 1 (NM), 151 return register zero (NM), 151 S (Stack) for CM, 151 shift amount register (NM), 151 space, 125, 236 space registers (NM), 151 stack pointer (NM), 151 static link (NM), 151 status (CM), 151 temp (NM), 154 X (index, CM), 155 Zero (NM), 150 Regular Expressions, 29 Relocatable Library conversion, 299 Renaming Windows, 345 Repetition of Commands, 135 Reserved Functions, 547 Reserved Variables, 547 Re
Index Shift Amount Register (NM), 151 Shift Operand, 33 Short Pointer coerce expression to, 443 comparisons to other pointers, 33 conversion to LCPTR, 445 SID, 442 defined, 26 sid Function, 442 sid.offset, 26 Sign of Literals, 28 Simple Data Type value of, 467, 500 Single Step Command, 257 Single Stepping, 137 SIR (System Internal Resource), 75 SL.PUB.
Index Substitutions command line, 44, 136 Substring Delete, 448 Substring of Source String, 446 Suppressing Terminal Output, 153 Switch Pointers/Registers, 241 symaddr Function, 461, 493 symbol access in DAT, 519 Symbol Definitions accessing, 299 creating, 299 Symbol information, 247, 295 Symbolic Access, 297, 308 examples, 297 Symbolic Access Facility, 264 Symbolic Data Type File close, 259 debugging, 260 dump data, 260 opening, 263 symbol name, 262 Symbolic Data Type Files, 264, 299 listing, 260 Symbolic
Index Turning off Windows, 328 Turning on Windows, 329 TX Window, 323 TXI Window Information Command, 336 TXS Window Shift Command, 346 Type Classes for Data Types, 26 Type of Component, 466, 498 Type of Evaluated Expression, 472, 506 Type of Variables, 39 typeof Function, 472, 506 U U Window, 321 U16 Defined, 23 u16 Function, 474, 508 U32 Defined, 23 u32 Function, 476, 510 Unary Operator, 28 Unfreeze code segment, 278 data segment, 278 virtual address range, 278 Unmap a File, 281 Update Windows, 282 Upper
Index WDEF Window Default Size Command, 327 WGRP Window Change Group Command, 328 While Loop, 294 Width of List File, 145 Window defaults, 327 reset default sizes, 327 Window Abbreviations, 325 Window Back Command, 329 Window Commands, 325 on-line help, 293 TXC, 331 UC, 331 VC, 331 Window Define New Command, 349 Window Disable Command, 331 Window Enable Command, 332 Window Home Command, 335 Window Jump Command, 337 Window Kill Command, 341 Window Lines Command, 342 Window Modes, 313 Window Operations, 311,