Native Inspect Manual Abstract This manual describes how to use the symbolic command-line debugger Native Inspect for debugging TNS/E native processes and snapshot files on HP NonStop™ Series TNS/E systems. Product Version Native Inspect H01 Supported Release Version Updates (RVUs) This publication supports the H06.04 RVU and all subsequent H-series RVUs until otherwise indicated in its replacement publication.
Document History Part Number Product Version Published 528122-003 Native Inspect H01 July 2005 528122-004 Native Inspect H01 November 2005 528122-005 Native Inspect H01 May 2006
Native Inspect Manual Glossary Index What’s New in This Manual iii Manual Information iii New and Changed Information Figures Tables iii About This Manual v Who Should Read This Manual v Related Products and Manuals v Organization vi Notation Conventions vi 1.
1. Introducing Native Inspect (continued) Contents 1.
2. Using Native Inspect (continued) Contents 2. Using Native Inspect (continued) Sample Native Inspect Session (COBOL Program) 2-12 Start Program Under Native Inspect Control 2-13 Step Execution 2-14 Display a Level 88 Condition Name 2-14 Examine a Record 2-15 Modify a Record Field 2-16 Examine Tables 2-16 Set a Breakpoint on a Nested Program Unit 2-19 Debugging Copy Libraries 2-20 Terminate the Debugging Session 2-21 3.
4. Syntax of Native Inspect Commands Contents 4.
4. Syntax of Native Inspect Commands (continued) Contents 4.
4. Syntax of Native Inspect Commands (continued) Contents 4.
Figures Contents Figures Figure 1-1. Figure 1-2. Figure 1-3. Native Inspect Runs in Same CPU as Current Process 1-7 Debugger Selection for a TNS/E Native Process 1-10 Debugger Selection for a TNS Process Running on TNS/E 1-11 Tables Table i. Table 1-1. Table 1-2. Table 2-1. Table 4-1. Table 4-2. Table 4-3. Table 5-1. Table A-1. Table A-2.
Contents Native Inspect Manual—528122-005 10
What’s New in This Manual Manual Information Native Inspect Manual Abstract This manual describes how to use the symbolic command-line debugger Native Inspect for debugging TNS/E native processes and snapshot files on HP NonStop™ Series TNS/E systems. Product Version Native Inspect H01 Supported Release Version Updates (RVUs) This publication supports the H06.04 RVU and all subsequent H-series RVUs until otherwise indicated in its replacement publication.
New and Changed Information What’s New in This Manual Native Inspect Manual—528122-005 iv
About This Manual This manual describes the use of the Native Inspect symbolic command-line debugger for TNS/E systems. Who Should Read This Manual Anyone who wants to debug TNS/E native processes or snapshot files using a command-line debugger on a TNS/E system.
Organization About This Manual Organization Table i. Contents of the Native Inspect Manual Section Description 1, Introducing Native Inspect Describes the basic principles of using Native Inspect to debug TNS/E native processes and snapshot files. 2, Using Native Inspect Presents a sample session using Native Inspect to debug a TNS/E native process. 3, Using Native Inspect With COBOL Programs Describes features and behavior of Native Inspect that are specific to the debugging of COBOL programs.
General Syntax Notation About This Manual lowercase italic letters. Lowercase italic letters indicate variable items that you supply. Items not enclosed in brackets are required. For example: file-name computer type. Computer type letters within text indicate C and Open System Services (OSS) keywords and reserved words. Type these items exactly as shown. Items not enclosed in brackets are required. For example: myfile.c italic computer type.
General Syntax Notation About This Manual An ellipsis immediately following a single syntax item indicates that you can repeat that syntax item any number of times. For example: "s-char…" Punctuation. Parentheses, commas, semicolons, and other symbols not previously described must be typed as shown. For example: error := NEXTFILENAME ( file-name ) ; LISTOPENS SU $process-name.
1 Introducing Native Inspect Debuggers on NonStop TNS/E Systems on page 1-2 Origins of Native Inspect on page 1-3 Industry Standard, Open Source on page 1-3 Additional NonStop Extensions on page 1-3 Not Part of the Inspect Subsystem on page 1-4 Documentation for Native Inspect on page 1-4 Comparing Native Inspect to Debug on page 1-4 Comparing Native Inspect to Inspect on page 1-5 COBOL-Specific Differences on page 1-6 Process Debugging With Native Inspect on page 1-6 Languages Supported by Native Inspect
Native Inspect on TNS/E Systems Introducing Native Inspect Native Inspect on TNS/E Systems Native Inspect is a system-level command-line symbolic debugger that you use to debug TNS/E native processes and snapshot files. Native Inspect runs only on a NonStop TNS/E host system (not on a TNS/R or TNS system).
Origins of Native Inspect Introducing Native Inspect Table 1-1.
Not Part of the Inspect Subsystem Introducing Native Inspect Not Part of the Inspect Subsystem Because Native Inspect originated in the UNIX world, Native Inspect is not part of the Inspect subsystem. Both Inspect and Visual Inspect, however, are part of the Inspect subsystem.
Comparing Native Inspect to Inspect Introducing Native Inspect list of Debug commands that have equivalent Native Inspect commands, see Table A-1, Debug Commands and Equivalent Native Inspect Commands.
COBOL-Specific Differences Introducing Native Inspect to the automatic display list—a list that is automatically displayed each time the program is suspended. COBOL-Specific Differences The following capabilities of Inspect are not supported in Native Inspect: • • • • Setting breakpoints using the program-unit.label or program-unit.linenumber notation. Using PICTURE and FORMAT clauses for displaying items. Formatting records as an arbitrary type (DISPLAY AS command).
Starting Native Inspect Introducing Native Inspect Figure 1-1. Native Inspect Runs in Same CPU as Current Process NonStop TNS/E Host CPU 1 CPU 2 Native Inspect Current Process User Terminal VST0101.vsd Starting Native Inspect You can start or enter Native Inspect in several ways: • • • • You can start a process under the control of the debugger, subject to the Debugger Selection Criteria (using the TACL RUND command or the run -debug command in OSS).
Starting Native Inspect Introducing Native Inspect Starting a Process Under the Control of the Debugger At the TACL prompt, enter a RUND command, specifying the file name of the TNS/E native object file you want to debug: TACL> rund $DISK2.MYSUBVOL.MYFILE In OSS, enter a run command with the -debug option and specify the file name of the TNS/E native object file you want to debug: OSS> run -debug pathname/myfile Native Inspect is automatically run in the same CPU as the process ($DISK2.MYSUBVOL.
Debugger Selection Criteria Introducing Native Inspect Invoking the Debugger From a Running Process Native Inspect is automatically started by the NonStop operating system when a debugger is required for any of the following reasons: • • • TNS/E native process code calls the PROCESS_DEBUG_ or DEBUG procedure. A TNS/E native process encounters a breakpoint set by a prior debugging session. The user of another debugger switches to Native Inspect.
Debugger Selection Criteria Introducing Native Inspect To summarize, Native Inspect is selected as the debugger: • • For TNS/E native processes when you have not established a Visual Inspect connection to the NonStop host, or the INSPECT attribute is OFF (Figure 1-2). For TNS processes when the Inspect subsystem is not running (that is, neither Visual Inspect nor Inspect is available) (Figure 1-3). Note, however, that Native Inspect has only limited capabilities for debugging TNS processes.
Debugger Selection Criteria Introducing Native Inspect Note that in Figure 1-3 there is no checking for the INSPECT setting (ON or OFF) for the process. All TNS processes are given to the Inspect subsystem for debugging, so the INSPECT attribute has no effect. Figure 1-3. Debugger Selection for a TNS Process Running on TNS/E Emulated TNS Process Visual Inspect session? Yes Select Visual Inspect No Inspect available? No Yes Select Inspect Select Native Inspect End VST0103.
Debugger Selection Criteria Introducing Native Inspect Explicitly Starting Native Inspect At the TACL prompt, enter a RUN command specifying the Native Inspect object file (EINSPECT) and the CPU in which the process is running (the process that you want to debug). For example, to start Native Inspect in CPU 2 in the Guardian environment, enter: \SYSTEM.$D0117.INSPECT 1> einspect / cpu 2 / TNS/E Native Inspect gdb Debugger [T1237 - 13-Jan-2005 12:45] Copyright 1998 Free Software Foundation, Inc.
Abbreviating Native Inspect Commands Introducing Native Inspect Reading the eInspect Custom File As Native Inspect initializes, it reads the contents of its custom file, named EINSCSTM, located in your logon default $vol.subvol on the TNS/E host. This file can contain any Native Inspect commands that you want to take effect during initialization. For example, you might establish your typical debugging environment by including a number of set commands (see set command (environment)).
Debugging Two Processes With One Instance of Native Inspect Introducing Native Inspect • • Use a separate Native Inspect instance for each process so that you are issuing debug requests from separate terminal sessions. Use one instance of Native Inspect for all processes so that one process is the current process and the other processes are in the background.
Using a Separate Instance of Native Inspect for Each Process Introducing Native Inspect Remember that while you are debugging this second process on a different terminal session, the home terminal for the process itself remains unchanged, and the process might attempt to prompt or output to its home terminal, causing more contention. Because of this potential problem, use Visual Inspect as the preferred debugger for multiprocess debugging. 2.
Using One Instance of Native Inspect to Debug Multiple Processes Introducing Native Inspect The display on the new terminal session reveals that the attach has completed, and process 3,32 is the current process for the new instance of Native Inspect: (eInspect 3,-2): attach 32 Symbols read in for program loadfile \PIPPIN.$D0117.TESTS.ODISP3.
Global Debugging Introducing Native Inspect • • • When debugging multiple programs, Native Inspect, like Inspect, sets the designated current process to be the process for which the most recent debugging event has been reported. The current process is the process to which all commands apply and for which Native Inspect waits for events. Use the vector command to explicitly change the designated current process.
Debugging TNS Processes Introducing Native Inspect • • • • To set a global breakpoint, you must enable privileged debugging and then specify the -g flag when setting a breakpoint. Global breakpoints are triggered by any process that executes the code on which the breakpoint is set. Global debugging mode begins when the first global breakpoint is set, and ends when the last global breakpoint is deleted. While global debugging is in effect, all other debugging in the CPU is suspended.
Snapshot File Analysis Introducing Native Inspect Snapshot File Analysis A process snapshot file or snapshot is a disk file that is an image of a process, its data, and its status at the moment it was saved—analogous in function to “core” files on UNIX systems. Snapshot files have file code 130. All three debuggers—Native Inspect, Visual Inspect, and Inspect—can be used to debug snapshot files (Inspect refers to snapshot files as save files).
Listing DLLs Introducing Native Inspect Listing DLLs Native Inspect maintains a list of the loadfiles that compose the current program. You can display the list of loadfiles by entering the info command with the dll option. Loading Symbols for DLLs Native Inspect automatically loads symbols for the program file and for explicitly loaded DLLs. You must explicitly load symbols for other DLLs using the symbol command or symbol-file command.
Assessing Your Location After an Event Introducing Native Inspect Table 1-2. Event Handling by Native Inspect Events Response by Native Inspect Breakpoint events Instruction breakpoint Instruction step TNS instruction breakpoint Memory access breakpoint Displays current code location (PC) and prompts user for input. (For TNS instruction breakpoint, displays the current native code location.
Switching Debuggers (To or From Inspect and Visual Inspect) Introducing Native Inspect Switching Debuggers (To or From Inspect and Visual Inspect) If you need to use features that are unique to another debugger, you can switch to a different debugger as follows: From You Can Switch to Using Native Inspect Inspect or Visual Inspect (according to Debugger Selection Criteria on page 1-9) switch command Visual Inspect Native Inspect Switch to System Debugger command in Visual Inspect (switches to Nati
Stopping Native Inspect Introducing Native Inspect Stopping Native Inspect Native Inspect runs as a separate process from the current process being debugged and stops: • • When the current process stops, if Native Inspect was started automatically to debug a process. If you enter the exit command or the quit command to explicitly stop. Native Inspect detaches from the current process and stops, leaving breakpoints in place.
Introducing Native Inspect Differences Between Native Inspect and WDB and GDB Native Inspect Manual—528122-005 1- 24
2 Using Native Inspect Preparing to Debug Using Native Inspect on page 2-2 Compiling and Transferring Program Files on page 2-2 Gaining Control of a Process Using Native Inspect on page 2-3 Loading Symbols Information (If Necessary) on page 2-3 Scope of Symbol Files: Global versus Per-Process on page 2-4 Load Address of Symbol Files on page 2-4 Considerations for Locating Symbols on page 2-4 How Native Inspect Locates Files on page 2-4 Determining the Compilation-Time Source File Name (If Necessary) on pa
Preparing to Debug Using Native Inspect Using Native Inspect Table 2-1.
Gaining Control of a Process Using Native Inspect Using Native Inspect • The debugger displays only values that are known to be true. If you are developing your program on a remote system or on a Windows PC, transfer your files to the system where you will perform debugging. You will need the program files in addition to the DLLs you are using.
Loading Symbols Information (If Necessary) Using Native Inspect Native Inspect automatically reads in symbol table information for DLL loadfiles that are loaded in response to the dlopen() system call. Similarly, the symbol table is automatically discarded if the DLL is unloaded using the dlclose() system call. Scope of Symbol Files: Global versus Per-Process When Native Inspect loads a symbol file, by default the symbols are available only to the current process.
Using Native Inspect Determining the Compilation-Time Source File Name (If Necessary) as its default subvolume. The current working directory contains the process being debugged. You can reduce confusion by immediately entering a cd command and setting the default subvolume for Native Inspect to be your current working subvolume (that is, the subvolume where your source files are stored), in this example $data1.mysubvol): (eInspect 0,380): cd $data1.
For C/C++, Advancing Execution to Main() Using Native Inspect Path Change If the unqualified file names of your source files have not changed between compilation and debugging, use the dir command to add entries to the directory search list that Native Inspect uses to locate source files. For example: (eInspect 0,330): dir $myvol.
Sample Native Inspect Session (C++ Program) Using Native Inspect Sample Native Inspect Session (C++ Program) This sample session demonstrates these tasks: Task Native Inspect Command Set search path for source files dir command List source list command Set a code breakpoint break command, tbreak command Trace stack frames bt command Advance execution next command, nexti command, step command, stepi command Display a variable print command Modify a variable set command (variable) End progra
Using Native Inspect Launch a C++ Program Under Native Inspect Control Launch a C++ Program Under Native Inspect Control $DATA3 NITEST 30> rund nitest TNS/E Native Inspect gdb Debugger [T1237 - 04-Apr-2006 09:00] Copyright 1998 Free Software Foundation, Inc. Copyright 2003-2006 Hewlett-Packard Development Company, L.P. Native Inspect (based on GDB) is covered by the GNU General Public License. Type "show copying" for conditions for changing and/or distributing copies.
Advance Execution to main() Using Native Inspect Advance Execution to main() (eInspect 3,591):b main Breakpoint 1 at 0x70001200:0: file \PIPPIN.$D0117.NITEST.GARTCC, line 78. (eInspect 3,591):c Continuing. Breakpoint 1, main () at \PIPPIN.$D0117.NITEST.GARTCC:78 78 local_ptr1 = "From main"; Current language: auto; currently c++ Notes • When a C/C++ program is started under Native Inspect control, Native Inspect gains control of the program before static initializations and constructors are executed.
Control Execution Using Native Inspect Control Execution (eInspect 3,591):next 78.1 strcpy( local_buf, "Hello world" ); (eInspect 3,591):next 78.2 local_ptr2 = local_buf; (eInspect 3,591):b 79 Breakpoint 2 at 0x700012d0:1: file \PIPPIN.$D0117.NITEST.GARTCC, line 79. (eInspect 3,591):c Continuing. Breakpoint 2, main () at \PIPPIN.$D0117.NITEST.
Step Execution Into a Function Using Native Inspect Step Execution Into a Function (eInspect 3,591):next 80 call1(local_ptr1,local_q); (eInspect 3,591):step call1(char *, int) (string=0x0, q=0) at \PIPPIN.$D0117.NITEST.GARTCC:84 84 { (eInspect 3,591):next 85 A1 a1; (eInspect 3,591):bt #0 call1(char *, int) (string=0x80001f0 "From main", q=0) at \PIPPIN.$D0117.NITEST.GARTCC:85 #1 0x70001320:0 in main () at \PIPPIN.$D0117.NITEST.GARTCC:80 #2 0x700034d0:0 in _MAIN () at \SPEEDY.$RLSE.T8432H01.
End the Program and Debugging Session Using Native Inspect • Before the memory access breakpoint is hit, the program calls DEBUG, after which execution is resumed.
Using Native Inspect Start Program Under Native Inspect Control Start Program Under Native Inspect Control DATA3 COBBAT 53> rund xcs000ds0 TNS/E Native Inspect gdb Debugger [T1237 - 04-Apr-2006 09:00] Copyright 1998 Free Software Foundation, Inc. Copyright 2003-2006 Hewlett-Packard Development Company, L.P. Native Inspect (based on GDB) is covered by the GNU General Public License. Type "show copying" for conditions for changing and/or distributing copies.
Step Execution Using Native Inspect Step Execution eInspect 3,1012):step 351 PERFORM OPEN-SEQ1-FILE. (eInspect 3,1012):next 352 IF SEQ1-FILE-ER THEN Notes • • • The step command steps execution into PERFORM invocations and calls to program units. The next command steps execution over PERFORM invocations and calls to program units. PERFORM invocations are not listed on the call stack. Display a Level 88 Condition Name 77 SEQ1-FLAG PIC 9. 88 SEQ1-FILE-ER VALUE 0. 88 SEQ1-FILE-OPENED VALUE 1.
Examine a Record Using Native Inspect Examine a Record Breakpoint 2, CALE-1 () at \PELICAN.$DATA3.COBBAT.SCS000D:319 319 PERFORM READ-SEQ1-TABLE THRU SEQ1-TABLE-EXIT 4 TIMES. (eInspect 3,1012):next 320 IF ERROR-DETECTED (eInspect 3,1012):next 322 PERFORM READ-SEQ2-TABLE UNTIL EOF OR ERROR-DETECTED.
Modify a Record Field Using Native Inspect Modify a Record Field (eInspect 3,1012):set name of seq2-rec = "Bach" (eInspect 3,1012):print seq2-rec $4 = NAME = "Bach " FILLER = " " WORKS = "opera04" FILLER = " " REST-OF-LINE = "Gypsy Baron 1881Fledermouse 1879" Notes • • Values are padded or truncated according to COBOL rules. Native Inspect ignores any JUSTIFIED clause on a data item.
Examine Tables Using Native Inspect NAME = "Bellini " WORKS = ( TITLE = "Semiramide " LISTING-INFO = CONDUCTOR = "Davis " SCHWANN-LISTING = "LN1233/\2700" PRICE = "$34,597.00" TITLE = "Norma " LISTING-INFO = CONDUCTOR = "Rudel " SCHWANN-LISTING = "DG1233/\2670" PRICE = "$34,602.00" (eInspect 3,1012):print schwann-listing This variable is an element of an array which has not been subscripted. Supply necessary subscripts and try again.
Examine Tables Using Native Inspect (eInspect 1,301): ptype rec5 type = RECORD R51 RECORD OCCURS 2 TIMES R511 PIC X(16) R512 PIC X(16) R513 RECORD OCCURS 3 TIMES R5131 PIC XXX R5132 PIC XXX (eInspect 1,301): p rec5 $40 = R51 = ( R511 = "REC5.R51[1].R511" R512 = "REC5.R51[1].R512" R513 = ( R5131 = "111" R5132 = "112", R5131 = "111" R5132 = "112", R5131 = "111" R5132 = "112"), R511 = "REC5.R51[1].R511" R512 = "REC5.R51[1].
Using Native Inspect Set a Breakpoint on a Nested Program Unit Notes • • You can apply subscripts to an unqualified record element name as long as the name is unique. Subscripts are separated by commas and must always occur in the last item of the reference. Set a Breakpoint on a Nested Program Unit (eInspect 3,1012):b cale-1.cale-1-1 Breakpoint 3 at 0x7000c200:2: file \PELICAN.$DATA3.COBBAT.SCS000D, line 588. (eInspect 3,1012):c Continuing. Breakpoint 3, CALE-1.
Debugging Copy Libraries Using Native Inspect Debugging Copy Libraries (eInspect 3,1012):list 310 Test-SingleInclusion. 311 DISPLAY " ". 312 DISPLAY "Test-SingleInclusion: Begin". 313 ?SOURCE CLIBCLB1( RANGE-110-112 ) 314 DISPLAY " ". 315 DISPLAY "Test-SingleInclusion: End". (eInspect 3,1012):list CLIBCLB1:110 105 02 ALPHA-A26 PIC A(26) VALUE "abcdef". 106 107 108 109 ?SECTION RANGE-110-112 110 DISPLAY " CLIBCLB1: RANGE-110-112: line 110". 111 DISPLAY " CLIBCLB1: RANGE-110-112: line 111".
Terminate the Debugging Session Using Native Inspect • To set a breakpoint on a line in a copy library, specify the base file name and line number. Native Inspect sets breakpoints at each program location where that copy library line is included; therefore, multiple breakpoints might be reported. You can clear any breakpoints you do not wish to be set. Terminate the Debugging Session (eInspect 3,1012):kill Notes • Use the kill command to terminate the process and debugging session.
Terminate the Debugging Session Using Native Inspect Native Inspect Manual—528122-005 2- 22
3 Using Native Inspect With COBOL Programs This section describes concepts and additional details for using Native Inspect with COBOL programs. How Native Inspect Finds Data Items Native Inspect follows COBOL scoping rules for finding data items specified in Native Inspect commands. That is, Native Inspect attempts to find the item in the current program unit (the program unit where execution is currently suspended).
Using Native Inspect With COBOL Programs Displaying Source Lines Displaying Source Lines In a program consisting of multiple files, Native Inspect handles the list command as follows: • • • If the list command specifies a file name, Native Inspect lists the contents of that file. If the list command does not specify a file name, Native Inspect lists the contents of the last source file listed since execution was last suspended.
Using Native Inspect With COBOL Programs Specifying Tables The variable INT is defined in both REC and REC2. You would specify the variable INT that is contained in REC2 in any of the following ways: INT OF REC2 INT IN REC2 REC2.INT When you use the period (.) syntax, the record name comes first, followed by the variable name. (This use of the period is Native Inspect syntax, not COBOL syntax.
Using Native Inspect With COBOL Programs Specifying Tables With Variable Upper Bounds Examples of valid table references are: MODEL (3) STYLE OF MODEL (3,11) COLOR OF STYLE OF MODEL (3,11,14) MODEL.STYLE.COLOR (3,11,14) You reference an entire table by specifying the table name without subscripts. For example, the following command displays all elements of table TOTAL-A: print TOTAL-A Subscripts are used to refer to specific instances of scalar variables that are part of a table of records.
Using Native Inspect With COBOL Programs Specifying Level 88 Condition Names Specifying Level 88 Condition Names You can attach a condition name to any data item. You specify a condition name the same way as you would specify a member of a record. For example, consider the declaration: 01 REC. 05 ITEM PIC 99. 88 GOOD-ITEM VALUE 10 THRU 20. You could specify: GOOD-ITEM OF ITEM OF REC or omit any qualifiers not required for uniqueness, just as you would for any other data item.
Using Native Inspect With COBOL Programs Displaying Argument Values The following Native Inspect commands display the values indicated: print COND-1 displays the value ‘T’ because the value of COND-1 matches the value of VAR. print COND-2 displays the value ‘F’. print VAR displays the actual value stored in VAR (in this case, 1).
Using Native Inspect With COBOL Programs Changing the Radix of Numeric Literals Native Inspect follows COBOL rules for assigning values to numeric and alphanumeric variables. Some considerations are: • • • • • Native Inspect follows COBOL rules for truncation and padding, but ignores the JUSTIFIED clause. When assigning a numeric value to an alphanumeric item, the numeric item is treated as an alphanumeric item with digits moved from left to right.
Using Native Inspect With COBOL Programs Assigning Values to Character Strings Assigning Values to Character Strings You reference a character string by specifying the string name. The reference is to the entire string. Native Inspect does not support reference modifier notation. For example, consider the following declaration: 01 REC. 02 MYSTRING PIC X(10).
Using Native Inspect With COBOL Programs Machine-Level Debugging Machine-Level Debugging Native Inspect provides a full set of commands for machine-level debugging. These commands enable you to perform such low-level tasks as examining memory, examining registers, and listing machine-level instructions. One such command, the x command, provides a special form for use with COBOL programs. The x command, when used with the ADDRESS OF clause, is useful for generating memory dumps.
Using Native Inspect With COBOL Programs Considerations Considerations • • Stepping behavior depends on compiler code generation and can vary slightly with different compiler versions. You cannot use the finish command to step execution out of a PERFORM. To step out of a PERFORM, you can set a breakpoint at the return location and then continue execution until that breakpoint is encountered.
4 Syntax of Native Inspect Commands • • • • Categories of Native Inspect Commands on page 4-1 Table 4-1, Commands of Native Inspect, on page 4-1 (commands listed in related groups) Syntax of Common Command Elements on page 4-6 Detailed syntax and examples for all the Native Inspect commands in alphabetic order (from # command to x command) Categories of Native Inspect Commands In Table 4-1, Native Inspect commands are grouped as follows: Command-line options Utility commands Session control commands Snaps
Categories of Native Inspect Commands Syntax of Native Inspect Commands Table 4-1.
Categories of Native Inspect Commands Syntax of Native Inspect Commands Table 4-1.
Categories of Native Inspect Commands Syntax of Native Inspect Commands Table 4-1.
Categories of Native Inspect Commands Syntax of Native Inspect Commands Table 4-1.
Syntax of Common Command Elements Syntax of Native Inspect Commands Syntax of Common Command Elements This subsection describes the syntax of: • • • • • linespec native-address llce (low-level conditional expression) expression /format Syntax of linespec linespec specifies a single source line; used in the list command for printing source lines and in the breakpoint command for specifying where to plant an instruction breakpoint.
Syntax of Common Command Elements Syntax of Native Inspect Commands to specify a code location within a subprocedure. Specifying Code Locations for COBOL Programs To specify a code location for a COBOL program, you use a line specification, as defined previously. A line specification specifies a single source line. It is used by commands that specify a single source line, such as the list command for listing source lines and the break command for specifying where to set an instruction breakpoint.
Syntax of Common Command Elements Syntax of Native Inspect Commands • octal (for example, 044000016700) If the address is in the range of 0 through 0xFFFFFFFF, it is sign-extended to form a 64-bit address. Example: 0x80000 & 0x72000000 If the address is greater than 0xFFFFFFFF, it is treated as a 64-bit address, and no sign extension is done. Example: 0xFFFFC5000000 The output format for native-address is 0xnnnnnnnnnnnnnnnn with leading zeros included.
Syntax of Common Command Elements Syntax of Native Inspect Commands Native Inspect does not support expressions in pTAL. To specify pTAL expressions, use C-style syntax: pTAL C-Style x :=y; x = y; flag := (a<>b); flag = (a !=b); pTAL pointer example: Using C-style pointers: int x[0:9]; int .xptr; ... @xptr ;= @x[0]; ... To display the address, enter: p xptr To dereference ptr (display what xptr points to), enter: p *xptr Variable names are not casesensitive. Variable names are casesensitive.
Syntax of Common Command Elements Syntax of Native Inspect Commands $register-name displays the contents of the specified register. For example, print $pc displays the contents of the $pc register. Syntax of /format /format is a repeat count, followed by a format letter and a size letter in any order: /[ count ][ format ][ size ] count is an integer specifying the number of units of size to display or print.
# command Syntax of Native Inspect Commands # command An alias for the comment command, used to embed a comment in a Native Inspect command line. a command A Debug-compatible Tcl command that displays memory in ASCII format. Alias: an a native-address [ count ] native-address is the address in memory that you want to display in ASCII. count is the amount of memory to display. The default value is one byte. add-symbol-file command Reads debugging symbols from the specified loadfile (file code 800).
amap command Syntax of Native Inspect Commands -readnow expands the symbol table immediately rather than incrementally as needed. filename is the Guardian name of the TNS/E native code file (with file code 800) that Native Inspect is to open and from which Native Inspect will load symbols. address (optional for DLLs only) is the load address relative to which symbols should be rebased. See Debugging DLLs on page 1-19 for more information.
base command Syntax of Native Inspect Commands The attach command issues a PROCESS_DEBUG_ request for the specified process, and Native Inspect then waits for the next debugging event. (When privileged debugging is enabled, the attach command specifies the DEBUGNOW option.) Then when the process enters debug, Native Inspect receives the debugging event, creates a session for the process (adding the process to the set of processes being debugged), and makes the process the current process.
break command, tbreak command Syntax of Native Inspect Commands break command, tbreak command Break sets an instruction breakpoint for the current process, at a specified line, function, or address. The tbreak command is similar, but sets a temporary breakpoint that is deleted after it is hit. Related Commands: Use the enable command and disable command to enable and disable breakpoints, respectively.
break command, tbreak command Syntax of Native Inspect Commands You can also use the condition command to associate a condition with a previously set breakpoint. Setting Global Breakpoints Global breakpoints are breakpoints that are set using the -g command option. To set global breakpoints, you must be logged on as the super ID, you must turn on priv mode by using the priv command, and no one else can be performing global debugging at the same time.
bt command Syntax of Native Inspect Commands To define a conditional breakpoint: (eInspect 1,329):b 352 Breakpoint 1 at 0x70002540:0: file \SIERRA.$YOSE1.SYMBAT1.SCXXTST, line 352. (eInspect 1,329):condition 1 pcb->pin == 2 (eInspect 1,329):info break Num Type Disp Enb Address What 1 breakpoint keep y 0x70002540 in pcbDataStructs_initialize at \SIERRA.$YOSE1.SYMBAT1.
catch command Syntax of Native Inspect Commands Example To display the current frame: (eInspect 4,770): bt #0 pcbDataStructs_initialize () at \SIERRA.$YOSE1.SYMBAT1.SCXXTST:362 #1 0x700016a0:0 in main (argc=1, argv=0x8003010) at \SIERRA.$YOSE1.SYMBAT1.SCXXTST:217 #2 0x700011f0:0 in _MAIN () at \SPEEDY.$RLSE.T8432H01.CPLMAINC:68 catch command Sets a logical breakpoint on a specified event (a catch event).
cd command Syntax of Native Inspect Commands cd command Changes the current working directory (current Guardian subvolume): • • If you specify a subvolume, the current working directory is changed to the subvolume you specify. If you omit the subvolume name, the current working directory reverts to the startup subvolume. Alias: volume cd [ subvolume ] subvolume is the name of the new current working Guardian subvolume.
comment command Syntax of Native Inspect Commands Example To define breakpoint actions: (eInspect 1,329):commands 1 Type commands for when breakpoint 1 is hit, one per line. End with a line saying just "end". >print PCB >end comment command A Tcl command that introduces a line of comment. Alias: # command { comment | # } [ text ] Either comment or # must be the first nonblank character in the line. The entire line is then treated as a comment.
continue command Syntax of Native Inspect Commands continue command Continues execution of the current process. Native Inspect suspends command prompting until the next debugging event occurs, or until you press the Break key. continue [ ignore-count ] ignore-count specifies the number of times to ignore a breakpoint at the current location. Example To continue execution: (eInspect 1,329):c Continuing. Breakpoint 2, pcbDataStructs_initialize () at \SIERRA.$YOSE1.SYMBAT1.SCXXTST:386 386 pcb = PCBList.
delete command Syntax of Native Inspect Commands a for ASCII i for icode o[n] for octal d[n] for decimal h[n] for hexadecimal [n] is the bit size; bit sizes are 8, 16, 32, or 64. The default value is 32. If you omit the format option, 32-bit quantities are displayed in the default output base.
delete display command Syntax of Native Inspect Commands delete display command Deletes an expression from the list of expressions that are automatically displayed when the program is suspended. If you do not specify a num, the command deletes all automatic display expressions. delete display [ num ] num is an ordinal number that identifies one expression on the automatic display list. Considerations • • To specify an expression for automatic display, use the display command.
dir command Syntax of Native Inspect Commands • • If the process you name in a detach command is suspended, it will automatically be resumed. If you enter the detach command when breakpoints are set in the process, Native Inspect issues a warning describing the situation and gives you the option of continuing or aborting the operation. Example See Example of Using Multiple Instances of Native Inspect on page 1-15.
disable command Syntax of Native Inspect Commands disable command Disables specified breakpoints, which remain defined but are not hit until reenabled. Use the enable command to enable a disabled breakpoint. If you do not enter any breakpoint numbers, the command disables all the breakpoints associated with the current process. Alias: dis, disa disable [ breakpoints ] [ breakpoint-number ... ] breakpoint-number is the number of a breakpoint or catch event that you want disabled.
disassemble command, da command Syntax of Native Inspect Commands disassemble command, da command Displays a range of memory as instructions. The da command is an alias for the disassemble command. To display the instructions that compose the current line, first use the info line command to display the line’s address range and then use the disassemble command. Note. COBOL programs are often lengthy.
display command Syntax of Native Inspect Commands Example To display instructions for a function: (eInspect 3,663):da PCB_addAttribute Dump of assembler code for function PCB_addAttribute: ;;; File: \SIERRA.$YOSE1.SYMBAT1.SCXXTST 239 { 0x70001820:0 : [MII] alloc r34=ar.pfs,30,30,0 0x70001820:1 : adds r12=-96,r12 0x70001820:2 : nop.i 0x0;; 0x70001830:0 : [MMI] adds r27=32,r12 0x70001830:1 : nop.
dmab command Syntax of Native Inspect Commands Example To use the automatic display list: (eInspect 4,798):display pcb->attributeCount 1: pcb->attributeCount = 1 (eInspect 4,798):display pcb->pin 2: pcb->pin = 0 (eInspect 4,798):next 364 PCB_addAttribute( pcb, PCBAttribute_createNonstop( PCBLis t.
down command, down-silently command Syntax of Native Inspect Commands down command, down-silently command Selects the stack frame that is called by the current stack frame. The selected stack frame becomes the stack frame relative to which program state is displayed. The down command also prints out information about the selected stack frame. Related Commands: up command, up-silently command Alias: do, dow { down | down-silently } count count is the number of frames to go before selecting a frame.
enable display command Syntax of Native Inspect Commands Example To disable and then enable a breakpoint: (eInspect 1,329):disable 1 (eInspect 1,329):info break Num Type Disp Enb Address What 1 breakpoint keep n 0x70002540 in pcbDataStructs_initialize at \SIERRA.$YOSE1.SYMBAT1.SCXXTST:352 stop only if pcb->pin == 2 print PCB (eInspect 1,329):enable 1 (eInspect 1,329):info break Num Type Disp Enb Address What 1 breakpoint keep y 0x70002540 in pcbDataStructs_initialize at \SIERRA.$YOSE1.SYMBAT1.
env command Syntax of Native Inspect Commands env command Displays information about the environment of the current process, including register values; segment numbers for data space, code space and user stack; and user segment information. env Native Inspect also displays the current input and output base, whether logging is currently on or off, and the number of lines in a page (show height). For process debugging, the terminal name and the priv mode (show priv) are also displayed.
fc command Syntax of Native Inspect Commands fc command Redisplays a previous command and allows you to edit and reexecute the command. This command behaves like the fc command in TACL on a NonStop system. fc [ command-number | command-string ] command-number is the number of the command you want to redisplay, edit, and reexecute. Use the show command with the commands option to display the commands entered in the current session.
finish command Syntax of Native Inspect Commands finish command Executes the current process until execution either returns from the currently selected frame (by default, the current frame) or encounters a debugging event. The finish command prints the return value, if there is one. Use the frame command, select-frame command to select the current frame. The finish command operates relative to the currently selected frame, which might differ from the current execution frame.
frame command, select-frame command Syntax of Native Inspect Commands The select-frame command, the “silent” version of the frame command, does not print out information about the selected frame. Alias: f [ frame | select-frame ] [ number ] number is the number of the frame you want to select. To display frame numbers, use the bt command. The frame at which execution is currently halted is numbered 0, and frame numbers continue consecutively to the base frame from which execution began.
help command, help option Syntax of Native Inspect Commands To display frame number 1: (eInspect 6,679): frame 1 #1 0x70001570:0 in main (argc=1, argv=0x8003010) at \SYS04.$D0117.SYMBAT1.SCXXTST:218 218 test_complexTypes(); (eInspect 6,679): help command, help option Displays information about commands of Native Inspect. The online help for Native Inspect has been inherited from its WDG/GDB parents and thus provides somewhat different information than that provided in this manual.
hold command Syntax of Native Inspect Commands Examples To display help: (eInspect 3,-2): help List of classes of commands: aliases -- Aliases of other commands breakpoints -- Making program stop at certain points data -- Examining data filecmd -- Specifying and examining files internals -- Maintenance commands obscure -- Obscure features running -- Running the program stack -- Examining the stack status -- Status inquiries support -- Support facilities tracepoints -- Tracing of program execution without
ignore command Syntax of Native Inspect Commands native-address is the address at which you want to display instructions. count is the number of instructions to display. The default value is 1. function-name is the name of the function in the source whose instructions you want to display. Example To display instructions: (eInspect 3,663):i 0x700023c0 5 Dump of assembler code from 0x700023c0:0 to 0x700023d0:0: ;;; File: \SIERRA.$YOSE1.SYMBAT1.
info command Syntax of Native Inspect Commands ih [ signal_name ] signal-name is the name of the signal about which you want information. If you do not specify a signal name, Native Inspect displays information about all the signals. Table 4-2 on page 4-51 contains a list of signal names. The command output includes information such as the address of the signal handler, whether the signal handler is priv or not, and various flags.
info command Syntax of Native Inspect Commands attribute is one of: address symbolic-name describes where the specified symbol is stored. all-registers lists all registers and their contents for the currently selected frame. Listing includes floating-point registers. architecture lists information about the target architecture. args lists argument variables of the currently selected stack frame.
info command Syntax of Native Inspect Commands functions [ regular-expression ] prints all function names or those matching the specified regular expression. handle [ signal-number ] displays the response that Native Inspect gives when the current program receives various signals. line linespec displays the starting and ending addresses of the code corresponding to the specified source line. locals prints the values of local variables of the currently selected stack frame.
info command Syntax of Native Inspect Commands source prints information about the current source file. stack prints a backtrace of the stack, like the bt command. symbol native-address describes what symbol is at the specified address. symbol-files prints the names of all the symbol files visible to the current process, including both per-process and global symbol files. target prints information about the target being debugged.
info command Syntax of Native Inspect Commands To display information about current breakpoints: (eInspect 1,325): info break Num Type Disp Enb Address What 1 breakpoint keep y 0x70001672 in main at \SIERRA.$YOSE1.SYMBAT1.SCXXTST:216 2 breakpoint keep y 0x70003700 in test_complexTypes at \SIERRA.$YOSE1.SYMBAT1.
info command Syntax of Native Inspect Commands To list information about currently loaded DLLs, including the program loadfile: (eInspect 3,331):info dll Loadfiles: \PELICAN.$DATA3.COBBAT.XCS000D0: (symbol file:\PELICAN.$DATA3.COBBAT.XCS000D0) ( PIC ELF PROG) Text : 0x0000000070000000 (size: 0x25000) Data : 0x0000000008000000 UID : 21576679|146 \PELICAN.$SYSTEM.SYS00.ZCOBDLL:(PIC ELF DLL, Public LIB) Text : 0xfffffffffeb10000 (size: 0xc8000) Data : 0x000000006db50000 UID : 12085384|6 \PELICAN.$SYSTEM.
jump command Syntax of Native Inspect Commands To display the contents of the registers (output is several screens long): (eInspect 2,647):info reg pr0: 0x1 pr1: 0x0 pr2: 0x0 pr3: 0x0 pr4: 0x0 pr5: 0x0 pr6: 0x0 pr7: 0x0 pr8: 0x1 pr9: 0x0 pr10: 0x0 pr11: 0x0 pr12: 0x1 pr13: 0x0 pr14: 0x1 ...
kill command Syntax of Native Inspect Commands Example To jump to a specified location (line 51): (eInspect 3,638): list 44 } 45 46 void call1(char *string,long long q) 47 { 48 eight_byte_struct structure; 49 structure.a = "from call1"; 50 structure.b = 1; 51 printf("%s q = %d\n",string,q); 52 print_and_break(); 53 call2(structure); (eInspect 3,638): fr 0 #0 call1 (string=0x0, q=0) at C:\cygwin\home\save\test\gartest.c:49 49 structure.
list command Syntax of Native Inspect Commands list command Lists source code starting at the most recently listed location. Native Inspect reads source from EDIT files (file code 101) and unstructured files (file code 180). By default, Native Inspect displays 10 lines, with the current execution location in the middle of the display, where possible. You can use the set command (environment) with the listsize option to change the list size to a value other than 10.
list command Syntax of Native Inspect Commands • Otherwise, use the map-source-name command to map the compile-time file name to the current name. You can copy and paste the path name displayed in the error message as the left-hand argument to the map command. For examples of locating source files, see Determining the Compilation-Time Source File Name (If Necessary) on page 2-5 and Configuring a Search Path for Your Source Files (If Necessary) on page 2-5.
log command Syntax of Native Inspect Commands To list source at a function: eInspect 1,463):list 335 336 337 338 339 340 341 342 343 344 getStepPrefix( 1 ) ); (eInspect 1,463): pcbDataStructs_initialize /* ************************** * pcbDataStructs_initialize */ static void pcbDataStructs_initialize() { PCB_t *pcb; PCBHandle_t *pcbHandle; printf( "%s pcbDataStructs_initialize\n", To list source at an address: (eInspect 3,663): list *0x700001aa0 0x70001aa0:0 is in PCBAttribute_create (\SIERRA.$YOSE1.
ls command Syntax of Native Inspect Commands file is the Guardian file name of the log file. Native Inspect creates a text file (file code 101) in the current working directory or in the location you specify in the log command. If the log file already exists, Native Inspect opens it and appends output to it. -d shows the name of the log file that is currently open. When logging is on, Native Inspect records all commands and their results in the log file (file).
mab command Syntax of Native Inspect Commands The range over which a MAB is set (that is, native-address + size) cannot exceed a 16K-page boundary. flags is one of: -c specifies change access; triggers beakpoint when the value changes -g specifies a global MAB; can be set only when privileged debugging is enabled. See Global Debugging on page 1-17. You can specify both the -g and -h flags. -h indicates a halt loop breakpoint, which can only be set by the super ID user after issuing the priv command.
map-source-name command Syntax of Native Inspect Commands To set a MAB by address: (eInspect 3,880): mab *0x8000370 (eInspect 3,880): c Continuing. Process (3, 880) received DS_EVENT_MAB (seg:65535, addr:0x08000370, pc:0xa4bd4c1 1ea887459, len:-233208559 type:1) 0x700024e0:2 in pcbDataStructs_initialize () at \SIERRA.$YOSE1.SYMBAT1.SCXXTST:350 350 for (PCBList.count=0 ; PCBList.count < PCBLIST_MAX; PCBList.
mh command Syntax of Native Inspect Commands You can use the dir command and the map command in combination: • • Use the dir command to define the directory (subvolume). Use the map command to change the base file name. mh command Sets up signal handlers (modifies handlers) for the specified signal. The mh command applies to the current process only and cannot apply to TNS emulated processes. The signal handlers can be specified as actions or as a procedure entry address.
mh command Syntax of Native Inspect Commands Table 4-2. TNS/E Signal Names (page 2 of 2) TNS/E Signal Names SIGABRT SIGIO SIGSTK * SIGTIMEOUT SIGFPE SIGKILL SIGLIMIT * SIGSEGV SIGWINCH * SIGCONT * SIGTTIN * SIGTTOU * SIGPIPE * SIGABND * SIGALRM * SIGTERM * SIGUSR1 * SIGUSR2 * SIGRECV * ZSIGCHLD * * Indicates signals that apply only in the OSS environment. Signals without * apply in both the OSS and native Guardian environments.
modify command Syntax of Native Inspect Commands Example In this example of the mh command and the ih command, the first mh command causes the signal to be reported to the debugger; the second mh command restores the default signal handler; and the ih command displays information about the signal handlers: (eInspect 4,658):mh SIGNOMEM DIG_DBG (eInspect 4,658):mh SIGCHLD SIG_DFL (eInspect 4,658):ih Signal Priv/Non SIGHUP N SIGINT N SIGQUIT N SIGILL N SIGURG N SIGABRT N SIGIO N SIGFPE N SIGKILL N SIGSEGV N
next command, nexti command Syntax of Native Inspect Commands value is the value you want to assign to native-address. The options 8, 16, 32, and 64 specify the bit size of value. After completion of the command, Native Inspect prints out the address that was modified, the number of bytes that were modified, and the old and the new values. If the specified value does not fit in the size specified, an error is returned.
nocstm option Syntax of Native Inspect Commands nocstm option A command-line option that specifies that Native Inspect is to ignore the commands in the custom file, the EINSCSTM file. You can enter the nocstm option only when you explicitly start Native Inspect with a RUN command specifying EINSPECT. You cannot specify the nocstm option in a RUND command. Typically, when Native Inspect starts up, it checks for existence of the custom file in the user’s logon subvolume.
print command Syntax of Native Inspect Commands Alias: p print [ /format ] expression /format is an optional count, format, and size specification. expression evaluates the expression and assigns its value to a variable. In COBOL expressions, use COBOL operators, and in C and pTAL expressions, use the standard C assignment operators, including +=, *=, and \=.
print command Syntax of Native Inspect Commands • For C/C++, character pointers are displayed until a terminating null or the configured maximum number of elements is displayed. Use the set print elements number command to control the maximum number of elements printed for strings or arrays. For pTAL, only one character of a pointer to a string is printed. An array of strings is printed as an array with each different element printed separately.
print command Syntax of Native Inspect Commands To display pointers: (eInspect 3,657): print pcb $1 = (PCB_t *) 0x80048a0 (eInspect 3,657):print *pcb $2 = { state = 0, flags = { word = 0, item = { isBad = 0, isReady = 0, isHappy = 0, isStarved = 0, waitState = 0 } }, dispatchCount = 0, pin = 0, attributeCount = 2, attribute = {0x8004ee0, 0x8004f40, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0} } (eInspect 3,657) print pcb->flags.item.
print command Syntax of Native Inspect Commands To display a buffer formatted as a struct (use the set print pretty command to control display format of structures): (eInspect 3,663): print gBuffer $7 = '\000' , "\003\b\000N\340\b\000O@\b\000O\240", '\000' (eInspect 3,663): print {PCB_t} gBuffer $8 = { state = 0, flags = { word = 0, item = { isBad = 0, isReady = 0, isHappy = 0, isStarved = 0, waitState = 0 } }, dispatchCount = 0, pin = 0, attributeCount = 3, attribute
print command Syntax of Native Inspect Commands To display an item from the value history list: (eInspect 1,463): print *PCBList.
priv command Syntax of Native Inspect Commands priv command Sets, unsets, or shows the privilege level of the debugging session. The privilege level in turn controls whether a user can perform privileged debugging operations such as setting breakpoints on or stepping in to privileged functions. To use the priv command to turn privileged debugging on or off, you must be logged on as the super ID. Entered with no options, displays the current priv mode status.
pwd command Syntax of Native Inspect Commands COBOL example: (eInspect 7,444):ptype EM type = PIC X(4) (eInspect 7.444):ptype RECX type = RECORD 02 NATA NATIVE-4 02 NATB NATIVE-8 (eInspect 7,444):ptype ARRX type = NATIVE-2 OCCURS 4 TIMES pwd command Prints the current working directory. pwd Example To display the current working directory: (eInspect 2,1142):pwd Working directory \PIPPIN.$D0101.INSPECT. quit command Ends a Native Inspect session.
save command Syntax of Native Inspect Commands Table 4-3 lists the names of the registers on a TNS/E native NonStop system. The info, print, and reg commands in particular use register names. You can use any C assignment operator (such as += or -=) when assigning a value to a register. Table 4-3.
set command (environment) Syntax of Native Inspect Commands set command (environment) Sets debugging session options and environment variables. Compare with the set command (variable), which modifies the value of a variable in the program being debugged. All the environment attributes available to the set command are also supported by the show command. Some attributes, however, are supported only by the show command.
set command (environment) Syntax of Native Inspect Commands filename { on | off } sets the name of the file in which to record the command history. save { on | off } sets saving of the history record on exit from Native Inspect. size number sets the size of the command history. The default value is 256. input-radix { 8 | 10 | 16 } sets the default input radix for entering numbers. language { ptal | c | c++ | cobol } sets the current source language.
set command (environment) Syntax of Native Inspect Commands mode { user | priv } sets the working session as priv (privileged) mode for process debugging. Applies to individual debug sessions; restricted to the super ID (user 255,255). output-radix { 8 | 10 | 16 } sets the output radix for printing of values. print sub-attribute value where sub-attribute is one of: address { on | off } sets printing of addresses.
set command (environment) Syntax of Native Inspect Commands pretty { on | off } sets pretty printing of structures (prints one field per line rather than compressing multiple fields on one line). See following examples. repeats number sets threshold for repeated print elements. The default value is 10. sevenbit-strings { on | off } sets printing of 8-bit characters in strings as \nnn. static-members { on | off } sets printing of C++ static members.
set command (environment) Syntax of Native Inspect Commands Examples To set pretty printing on and off: (eInspect 4,770): set print pretty off (eInspect 4,770): print pcb $2 = (PCB_t *) 0x0 (eInspect 4,770): c Continuing. Breakpoint 3, pcbDataStructs_initialize () at \SIERRA.$YOSE1.SYMBAT1.
set command (variable) Syntax of Native Inspect Commands To set the number of elements to print: (eInspect 4,774): set print elements 5 (eInspect 4,774): print pcb->attribute $5 = {0x0, 0x0, 0x0, 0x0, 0x0...} set command (variable) Evaluates an expression and assigns the resulting value to a variable. set [ variable ] var-name { expression | value } var-name is the name of a variable in the current process. expression is an expression whose value you want to be assigned to var-name.
show command Syntax of Native Inspect Commands show command Displays either the environment settings for Native Inspect or the value of a variable in the program being debugged. show [ attribute | { history | print | check } [ sub-attr ] ] attribute is typically one of the same attributes as for the set command (environment). The history, print, and check attributes are as described for the set command (environment).
snapshot command Syntax of Native Inspect Commands Example To display the source search path: (eInspect 1,-2):show directories Source directories searched: $d0117.tests:$cdir:$cwd snapshot command Opens a TNS/E native process snapshot file (file code 130) for analysis. snapshot filename filename is the name of a TNS/E native snapshot file (with file code 130) that you want to open.
step command, stepi command Syntax of Native Inspect Commands step command, stepi command Advances program execution by one source statement or by a specified number of statements. For COBOL programs, execution advances to the next verb. Execution steps “in” any function calls or PERFORM statements that are executed within the step range. If a function call is made within the stepping range, the call is followed and execution suspended after the function’s prolog code is executed.
symbol command or symbol-file command Syntax of Native Inspect Commands After you enter a switch command, Native Inspect suspends command prompting until one of the following happens: • • • The process is transferred back to Native Inspect. You press the Break key. The process terminates. Native Inspect continues to maintain the associated state for the process until the process terminates or is transferred back to Native Inspect. Breakpoint attributes are not passed between debuggers.
tbreak command Syntax of Native Inspect Commands -readnow expands the symbol table immediately rather than incrementally as needed. filename is the Guardian name of the TNS/E native code file (with file code 800) that Native Inspect is to open. The symbol command reads in the symbols for the specified loadfile at the corresponding loadfile’s actual load address, if it can be determined.
tj command, tu command Syntax of Native Inspect Commands tu stack traces from a ucontext buffer contained at the specified address. native-address is the address that contains the jump buffer. Note. Unexpected results can occur if the native address specified does not correspond to a valid native jump buffer or a valid ucontext.
tn command Syntax of Native Inspect Commands To obtain the address of the ucontext buffer and then trace the stack relative to the ucontext buffer: (eInspect 1,1028):info locals ucp = (ucontext_t *) 0x6fffede0 (eInspect 1,1028):tu 0x6fffede0 #0 0x70000cd0:0 in func3 (p=1879043416, q=0, r=134222120) at \SIERRA.$OS.VIVTEST.STEST12:21.030 #1 0x70000e50:0 in func2 (p=5, q=10) at \SIERRA.$OS.VIVTEST.STEST12:21.060 #2 0x70000fa0:0 in func1 (p=5) at \SIERRA.$OS.VIVTEST.STEST12:21.
until command Syntax of Native Inspect Commands until command Continues executing the current process until a specified location is reached, a debugging event occurs, or the current stack frame returns. Alias: u until [ linespec ] linespec is the line number where you want execution to stop. If you enter the until command with no arguments, the results are similar to those of the next command, except that at the bottom of a loop the until command steps through all remaining iterations.
vector command Syntax of Native Inspect Commands Example To use the up and down commands (C example): (eInspect 4,770): bt #0 pcbDataStructs_initialize () at \SIERRA.$YOSE1.SYMBAT1.SCXXTST:362 #1 0x700016a0:0 in main (argc=1, argv=0x8003010) at \SIERRA.$YOSE1.SYMBAT1.SCXXTST:217 #2 0x700011f0:0 in _MAIN () at \SPEEDY.$RLSE.T8432H01.CPLMAINC:68 (eInspect 4,770): up #1 0x700016a0:0 in main (argc=1, argv=0x8003010) at \SIERRA.$YOSE1.SYMBAT1.
version option Syntax of Native Inspect Commands Considerations • • • Use the info command with the sessions option to list the sessions running under one instance of Native Inspect. Use this command during multiprocess debugging. The vector command preserves debugging attributes you have set for the previously designated process. When privileged debugging is enabled in Native Inspect, use the vector command to view the state of any process in the CPU without having to attach to the process.
wait command Syntax of Native Inspect Commands wait command Instructs Native Inspect to stop prompting and wait for a Debug event to occur or for you to press the Break key. You might need to use the wait command when debugging multiple processes because debugging events for processes other than the current process are reported only when Native Inspect waits (implicitly or explicitly) for events for the current process. wait whatis command Prints the data type of a specified expression.
x command Syntax of Native Inspect Commands format can be: a c d f i o s t u x address char signed decimal float instruction octal string binary unsigned decimal hexadecimal size can be: b h w g byte half word (16 bits) word (32 bits) giant (64 bits or 8 bytes) address is the address in memory at which you want the display to start. For additional details regarding COBOL programs, see “Using Native Inspect With COBOL Programs.
x command Syntax of Native Inspect Commands last address examined, and $__ stores the contents of that address formatted as specified in the command. Examples To display memory at address 0x70000fc0 and then display three machine instructions starting at that address: (eInspect 7,464):x 0x70000fc0 0x70000fc0:0 : 0x0900cc68 (eInspect 7,464):x /3i 0x70000fc0 0x70000fc0:0 : [MMI] 0x70000fc0:1 : 0x70000fc0:2 : st4 [r52]=r51 addl r53=192,r1 nop.
x command Syntax of Native Inspect Commands To display data in different format—t (binary), o (octal), d (signed decimal), u (unsigned decimal) and x (hexadecimal): (eInspect 7,498):x 0x6ffffee0 0x6ffffee0: 0x00250000 (eInspect 7,498):x /t 0x6ffffee0 0x6ffffee0: 00000000001001010000000000000000 (eInspect 7,498):x /o 0x6ffffee0 0x6ffffee0: 011200000 (eInspect 7,498):x /d 0x6ffffee0 0x6ffffee0: 2424832 (eInspect 7,498):x /u 0x6ffffee0 0x6ffffee0: 2424832 (eInspect 7,498):x /x 0x6ffffee0 0x6ffffee0: 0x002500
x command Syntax of Native Inspect Commands Native Inspect Manual—528122-005 4- 84
5 Using Tcl Scripting Introduction to Tcl on page 5-1 Learning Tcl on page 5-1 Using Native Inspect Tcl Commands on page 5-1 Loading a Tcl Script on page 5-2 Using Variables Defined in a Tcl Script on page 5-2 Programming Native Inspect Tcl Commands on page 5-2 Namespaces and Package Loading Rules on page 5-3 Tcl Examples on page 5-5 Tcl Commands Provided by Native Inspect on page 5-7 Introduction to Tcl Native Inspect includes Version 8.
Pass-Through of Tcl Commands Using Tcl Scripting Pass-Through of Tcl Commands Some commands, such as set and help, exist in both Native Inspect and Tcl. To use the Tcl version of such a command, you must “pass through” commands to Tcl by specifying Tcl on the Native Inspect command line, as follows: (eInspect 3,301): tcl tcl-command Native Inspect Commands Implemented in Tcl Native Inspect contains several commands that are implemented in Tcl.
Namespaces and Package Loading Rules Using Tcl Scripting • Procedure headers (one or more) ° Abstract ° Arguments ° Results Namespaces and Package Loading Rules Tcl supports packages and hierarchical namespaces. Creating Packages Packages are libraries of Tcl code that you can create using the Tcl package provide command: # mySub.tcl package provide mySub 1.0 # my package code Putting a Package in a Namespace The global namespace contains the built-in Tcl commands, such as set, puts, and open.
Namespaces and Package Loading Rules Using Tcl Scripting Explicitly Export Your Public Commands: Your package should export its public commands (but not its private commands), as follows: namespace eval ::mySub::: { namespace export {[a-z]*} } proc ::mySub::myPublicProc{} {...} Each namespace exports symbols that can be explicitly included, and unambiguously defined.
Tcl Examples Using Tcl Scripting Tcl Examples The code for the Native Inspect eq command is implemented in Tcl: # Syntax: eq # # Effect: Evaluate the expression and display the result in different # formats.
Tcl Examples Using Tcl Scripting To use a Tcl command (ListPCBs) to walk data structure (symexpr is a Tcl command used to evaluate symbolic expressions): #-----------------------------------------------------------------# Syntax: ListPCBS # Synopsis: Walk the PCBList, printing info about each PCB #-----------------------------------------------------------------proc ListPCBs { } { set pcbCount [FORMAT [SYMEXPR PCBList.
Tcl Commands Provided by Native Inspect Using Tcl Scripting Tcl Commands Provided by Native Inspect Native Inspect includes the built-in commands that are provided by open-source Tcl (such as package provide and namespace eval). In addition to these, the commands listed in Table 5-1 are provided specifically for the NonStop platform. Table 5-1. Tcl Commands for NonStop Systems Tcl Command Description expr expression Evaluates a 32-bit expression.
Using Tcl Scripting Tcl Commands Provided by Native Inspect Native Inspect Manual—528122-005 5 -8
A Command Mapping With Debug and Inspect • • Table A-1 lists Debug commands and equivalent Native Inspect commands. Table A-2 lists Inspect commands and equivalent Native Inspect commands. Table A-1.
Command Mapping With Debug and Inspect Table A-2.
Command Mapping With Debug and Inspect Table A-2.
Command Mapping With Debug and Inspect Table A-2.
Glossary address space. The memory locations to which a process has access. break condition. An event indicator or sequence of data from a terminal or terminal emulator that requests interruption of an application program. breakpoint. A location that you specify in a program at which execution stops and the debugger allows you to examine the state of the program and its variables. command. A demand for action by or information from a subsystem or the operation demanded by an operator or application.
export Glossary export. To offer a symbol definition for use by other loadfiles. A loadfile exports a symbol definition for use by other loadfiles that need a data item or function having that symbolic name. extended link format (ELF). A standard binary file format common on UNIX systems. The ELF format is used for position-independent code (PIC) files on both TNS/R and TNS/E systems. file name. A string of characters that uniquely identifies a file.
native Glossary native. An adjective that can modify object code, object file, loadfile, process, procedure, and mode of process execution. Native object files contain native object code, which directly uses the processor's instruction set and the corresponding conventions for register handling and procedure calls. Native processes are those created by executing native object files. Native procedures are units of native object code.
signal Glossary A save file can be created through an Inspect or Native Inspect SAVE command at any time. A save file called a saveabend file can be created by the DMON debug monitor when a process’s SAVEABEND attribute is set and the process terminates abnormally. signal. The method by which an environment notifies a process of an event. Signals are used to notify a process when an error that is not related to input or output has occurred. signal handler.
TNS/E Glossary TNS/E. Fault-tolerant HP NonStop computers that support the HP NonStop operating system and are based on the Intel® Itanium® processor. TNS/E systems run the Itanium instruction set and can run TNS object files by interpretation or after acceleration. TNS/E systems include all HP NonStop systems that use NSE-x processors. Contrast with TNS mode and user code. TNS/E library. A TNS/E native-mode library.
TNS/R native compiler Glossary TNS/R native compiler. A compiler in the TNS/R development environment that generates TNS/R native object code, following the TNS/R native-mode conventions for memory, stack, 32-bit registers, and call linkage. The TNS/R native C compiler is an example of such a compiler. Contrast with TNS/E native compiler. TNS/R native mode.
Visual Inspect Glossary Visual Inspect. A symbolic debugger that runs on a Windows workstation. Visual Inspect is an indepent product bundled with the NonStop Enterprise Toolkit (ETK). Visual Inspect supports CISC (TNS), RISC (TNS/R), and Itanium (TNS/E) machine architectures and compilers (that is, C, C++, COBOL, TAL, and pTAL) in both the Guardian and HP NonStop Open System Services (OSS) execution environments. Visual Inspect uses client-server architecture.
Visual Inspect Glossary Native Inspect Manual—528122-005 Glossary- 8
Index A Buffers, displaying 4-59 a command 4-4, 4-11, 4-21 Abbreviation of commands 1-13 add source assign (Inspect) A-2 Address of symbol file 2-4 address option 4-66 Address, attributes 4-12 add-symbol-file command 1-19, 4-5, 4-11 Advancing execution to main() 2-6 Alias, for commands 1-13 all-registers option 4-38 amap command 4-1, 4-12 an command 4-11 Application registers 4-63 architecture option 4-38 args option 4-38 Array elements, displaying 4-59 array option 4-66 ASCII 4-11, 4-21 asm-demangle opti
E Index Data structures, displaying 4-59 debug command 1-8, 2-3 DEBUG procedure 1-9 Debugger selection 1-9 switching 1-22 DEBUGNOW command 1-8 Default subvolume 2-4, 4-18 Deferred breakpoints 1-23 delete command 2-2, 4-3, 4-21 delete display command 4-4, 4-22 demangle option 4-66 detach command 1-15, 1-17, 4-2, 4-22 dir command 1-19, 2-6, 4-2, 4-23, 4-50 directories option 4-23, 4-70 Directory search path 4-23 Directory, working.
H Index Global debugging 1-17 Global MAB 4-27 Global symbol file 2-4, 4-11, 4-73 H h command 4-34 handle option 4-39 height option 4-64 help command 4-1, 4-2, 4-34 History buffer 4-55 History of commands 4-70 history option 4-64 hlce (high-level conditional expression) 4-19 hold command 4-3, 4-35 HP NonStop Open System Services (OSS) 1-7, 1-8, 4-12 I i command 4-4, 4-35 icode 4-21 ignore command 4-3, 4-36 ih command 4-3, 4-36 in command 4-35 info command 2-2, 4-2, 4-37 input-radix option 4-65 Inspect 1-
N Index N n command 4-54 namespace eval command (Tcl) 5-3 native-address specification 4-7 next command 1-18, 4-3, 4-54 nexti command 4-3, 4-54 ni command 4-54 nocstm option 4-1, 4-55 null-stop option 4-66 O object option 4-66 OCA (Object Code Accelerator) 1-18 Optimization level 2-2 OSS See HP NonStop Open System Services (OSS) output command 4-4, 4-10, 4-55 output-radix option 4-66 OutsideView 1-14 P p command 4-56 package provide command (Tcl) 5-3 package require command (Tcl) 5-3 Pointers (pTAL) 4-9
T Index show command 4-2, 4-31, 4-70 show directories command 4-23 si command 4-72 Signal handlers 4-51 Signal names 4-51 signals option 4-39 snapshot command 1-19, 4-2, 4-71 Snapshot file 1-19 source command 4-2, 4-71 Source files 4-45 Source name mapping 2-6, 4-45 source option 4-40 Source search path 2-6, 4-23, 4-70 SPI buffers 1-5 stack option 4-40 Starting Native Inspect 1-7 static-members option 4-67 step command 1-18, 2-1, 4-3, 4-33, 4-72 stepi command 4-3, 4-72 Stopping Native Inspect 1-23 Structu
X Index WDB 1-3 whatis command 4-5, 4-80 width option 4-67 Working directory 2-4, 4-62 X x command 4-4, 4-10, 4-80 Special Characters != (operator) 4-8 # command 4-2, 4-11 #, in frame number 4-16 $ 4-9, 4-55 $cdir 4-23, 4-70 $cwd 4-23, 4-70 $SYSTEM.SYSnn.