hp.com home products and services support and drivers solutions how to buy
cd-rom home
End of Jump to page title
HP OpenVMS systems
documentation

Jump to content


HP OpenVMS Debugger Manual

HP OpenVMS Debugger Manual


Previous Contents Index


SHOW STACK

Displays information on the currently active routine calls.

Format

SHOW STACK [integer]


Parameters

integer

Specifies the number of frames to display. If you omit the parameter, the debugger displays information about all call frames.

Description

For each call frame, the SHOW STACK command displays information such as stack pointers, condition handler, saved register values (Alpha and VAX), local register allocation (I64), and, if any, the argument list (VAX). Note that an argument passed through a register or an argument list may contain the addresses of the actual argument. In such cases, use the EXAMINE address-expression command to display the values of these arguments.

On VAX processors, each routine invocation results in a call frame on the memory stack.

On Alpha and I64 processors, a routine invocation can result in:

The SHOW STACK command provides information on all three procedures: stack frame, register frame, and null frame. (See the examples below.)

Related command:

SHOW CALLS

Examples

VAX example:


DBG> SHOW STACK 
stack frame 0 (2146814812) 
 
    condition handler: 0 
       SPA:            0 
       S:              0 
       mask:           ^M<R2> 
       PSW:            0000 (hexadecimal) 
    saved AP:          7 
    saved FP:          2146814852 
    saved PC:          EIGHTQUEENS\%LINE 69 
    saved R2:          0 
    argument list:(1)  EIGHTQUEENS\%LINE 68+2 
 
stack frame 1 (2146814852) 
    condition handler: SHARE$PASRTL+888 
       SPA:            0 
       S:              0 
       mask:           none saved 
       PSW:            0000 (hexadecimal) 
    saved AP:          2146814924 
    saved FP:          2146814904 
    saved PC:          SHARE$DEBUG+667 
DBG> 

In the above example, the SHOW STACK command displays information about all call stack frames from the current PC and FP location.

Alpha example:


 
DBG> SHOW STACK 
invocation block 0 
 
    FP: 000000007F907AD0 
    Detected what appears to be a NULL frame 
    NULL frames operate in the same invocation context as their caller 
    NULL Procedure Descriptor (0000000000010050): 
        Flags:                  3089 
          KIND:                 PDSC$K_KIND_FP_STACK (09) 
        Signature Offset        0000 
        Entry Address:          MAIN\FFFF 
    Procedure Descriptor (0000000000010000): 
        Flags:                  3089 
          KIND:                 PDSC$K_KIND_FP_STACK (09) 
          FP is Base Register 
        Rsa Offset:             0008 
        Signature Offset        0000 
        Entry Address:          MAIN 
        Ireg Mask:              20000004 <R2,FP> 
          RA Saved @ 000000007F907AD8:  FFFFFFFF8255A1F8 
          R2 Saved @ 000000007F907AE0:  000000007FFBF880 
          FP Saved @ 000000007F907AE8:  000000007F907B30 
        Freg Mask:              00000000 
        Size:                   00000020 
 
 
invocation block 1 
 
    FP: 000000007F907B30 
    Procedure Descriptor (FFFFFFFF8255D910): 
        Flags:                  3099 
          KIND:                 PDSC$K_KIND_FP_STACK (09) 
          Handler Valid 
          FP is Base Register 
        Rsa Offset:             0048 
        Signature Offset        0001 
        Entry Address:          -2108317536 
        Ireg Mask:              20002084 <R2,R7,R13,FP> 
          RA Saved @ 000000007F907B78:  000000007FA28160 
          R2 Saved @ 000000007F907B80:  0000000000000000 
          R7 Saved @ 000000007F907B88:  000000007FF9C9E0 
          R13 Saved @ 000000007F907B90: 000000007FA00900 
          FP Saved @ 000000007F907B98:  000000007F907BB0 
        Freg Mask:              00000000 
        Size:                   00000070 
        Condition Handler:      -2108303104 
DBG> 

In the above example, note that sections of routine prologues and epilogues appear to the debugger to be null frames. The portion of the prologue before the change in the frame pointer (FP) and the portion of the epilogue after restoration of the FP each look like a null frame, and are reported accordingly.

I64 example---The following abbreviations are used in the example:

GP---Global data segement Pointer (%R1)
PC---Program Counter (Instruction Pointer + instruction slot number)
SP---Stack Pointer (memory stack)
BSP---Backing Store Pointer (register stack)
CFM---Current Frame Marker


 
DBG> SHOW STACK 
Invocation block 0      Invocation handle 000007FDC0000270 
    
    GP:         0000000000240000 
    PC:         MAIN\FFFF 
                In prologue region 
    RETURN PC:  MAIN\%LINE 15 
    SP:         000000007AD13B40 
    Is memory stack frame: 
        previous SP:    000000007AD13B40 
    BSP:        000007FDC0000270 
    Is register stack frame: 
        previous BSP:   000007FDC0000248 
    CFM:        0000000000000005 
        No locals       Outs R32 : R36 
 
Invocation block 1      Invocation handle 000007FDC0000248 
    GP:         0000000000240000 
    PC:         MAIN\%LINE 15 
    RETURN PC:  0FFFFFFFF80C2A200 
    SP:         000000007AD13B40 
    Is memory stack frame: 
        previous SP:    000000007AD13B70 
    BSP:        000007FDC0000248 
    Is register stack frame: 
        previous BSP:   000007FDC0000180 
    CFM:        000000000000028A 
        Ins/Locals R32 : R36    Outs R37 : R41 
 
Invocation block 2      Invocation handle 000007FDC0000180 
    GP:         0FFFFFFFF844DEC00 
    PC:         0FFFFFFFF80C2A200 
    RETURN PC:  SHARE$DCL_CODE0+5AB9F 
    SP:         000000007AD13B70 
    Is memory stack frame: 
        previous SP:    000000007AD13BC0 
    BSP:        000007FDC0000180 
    Is register stack frame: 
        previous BSP:   000007FDC00000B8 
    Has handler: 
        function value:         0FFFFFFFF842DFBD0 
    CFM:        0000000000000C20 
        Ins/Locals R32 : R55    Outs R56 : R63 
DBG> 

See HP OpenVMS Calling Standard for more information.


SHOW STEP

Identifies the default qualifiers (/INTO, /INSTRUCTION, /NOSILENT and so on) currently in effect for the STEP command.

Format

SHOW STEP


Description

The default qualifiers for the STEP command are the default qualifiers last established by the SET STEP command. If you did not enter a SET STEP command, the default qualifiers are /LINE, /OVER, /NOSILENT, and /SOURCE.

Enabling screen mode by pressing PF1-PF3 enters the SET STEP NOSOURCE command as well as the SET MODE SCREEN command (to eliminate redundant source display in output and DO displays). In that case, the default qualifiers are /LINE, /OVER, /NOSILENT, and /NOSOURCE.

Related commands:

STEP
SET STEP

Example


DBG> SET STEP INTO,NOSYSTEM,NOSHARE,INSTRUCTION,NOSOURCE
DBG> SHOW STEP
step type: nosystem, noshare, nosource, nosilent, into routine calls, 
           by instruction
DBG>
      

In this example, the SHOW STEP command indicates that the debugger take the following actions:


SHOW SYMBOL

Displays information about the symbols in the debugger's run-time symbol table (RST) for the current image.

Note

The current image is either the main image (by default) or the image established as the current image by a previous SET IMAGE command.

Format

SHOW SYMBOL symbol-name[,...] [IN scope[,...]]


Parameters

symbol-name

Specifies a symbol to be identified. A valid symbol name is a single identifier or a label name of the form %LABEL n, where n is an integer. Compound names such as RECORD.FIELD or ARRAY[1,2] are not valid. If you specify the asterisk (*) wildcard character by itself, all symbols are listed. You can use the wildcard within a symbol name.

scope

Specifies the name of a module, routine, or lexical block, or a numeric scope. It has the same syntax as the scope specification in a SET SCOPE command and can include path-name qualification. All specified scopes must be in set modules in the current image.

The SHOW SYMBOL command displays only those symbols in the RST for the current image that both match the specified name and are declared within the lexical entity specified by the scope parameter. If you omit this parameter, all set modules and the global symbol table (GST) for the current image are searched for symbols that match the name specified by the symbol-name parameter.


Qualifiers

/ADDRESS

Displays the address specification for each selected symbol. The address specification is the method of computing the symbol's address. It can merely be the symbol's memory address, but it can also involve indirection or an offset from a register value. Some symbols have address specifications too complicated to present in any understandable way. These address specifications are labeled "complex address specifications."

On Alpha processors, the command SHOW SYMBOL/ADDRESS procedure-name displays both the code address and procedure descriptor address of a specified routine, entry point, or Ada package.

/DEFINED

Displays symbols you have defined with the DEFINE command (symbol definitions that are in the DEFINE symbol table).

/DIRECT

Displays only those symbols that are declared directly in the scope parameter. Symbols declared in lexical entities nested within the scope specified by the scope parameters are not shown.

/FULL

Displays all information associated with the /ADDRESS, /TYPE, and /USE_CLAUSE qualifiers.

For C++ modules, if symbol-name is a class, SHOW SYMBOL/FULL also displays information about the class.

/LOCAL

Displays symbols that are defined with the DEFINE/LOCAL command (symbol definitions that are in the DEFINE symbol table).

/TYPE

Displays data type information for each selected symbol.

/USE_CLAUSE

(Applies to Ada programs.) Identifies any Ada package that a specified block, subprogram, or package names in a use clause. If the symbol specified is a package, also identifies any block, subprogram, package, and so on, that names the specified symbol in a use clause.

Description

The SHOW SYMBOL command displays information that the debugger has about a given symbol in the current image. This information might not be the same as what the compiler had or even what you see in your source code. Nonetheless, it is useful for understanding why the debugger might act as it does when handling symbols.

If you do not specify a qualifier, the SHOW SYMBOL command lists all of the possible declarations or definitions of a specified symbol that exist in the RST for the current image (that is, in all set modules and in the GST for that image). Symbols are displayed with their path names. A path name identifies the search scope (module, nested routines, blocks, and so on) that the debugger must follow to reach a particular declaration of a symbol. When specifying symbolic address expressions in debugger commands, use path names only if a symbol is defined multiple times and the debugger cannot resolve the ambiguity.

The /DEFINED and /LOCAL qualifiers display information about symbols defined with the DEFINE command (not the symbols that are derived from your program). The other qualifiers display information about symbols defined within your program.

For information specific to Ada programs, type Help Language_Support Ada.

Related commands:

DEFINE
DELETE
SET MODE [NO]LINE
SET MODE [NO]SYMBOLIC
SHOW DEFINE
SYMBOLIZE

Examples

#1

DBG> SHOW SYMBOL I
data FORARRAY\I
DBG>
      

This command shows that symbol I is defined in module FORARRAY and is a variable (data) rather than a routine.

#2

DBG> SHOW SYMBOL/ADDRESS INTARRAY1
data FORARRAY\INTARRAY1 
     descriptor address: 0009DE8B
DBG>
      

This command shows that symbol INTARRAY1 is defined in module FORARRAY and has a memory address of 0009DE8B.

#3

DBG> SHOW SYMBOL *PL*
      

This command lists all the symbols whose names contain the string "PL".

#4

DBG> SHOW SYMBOL/TYPE COLOR
data SCALARS\MAIN\COLOR 
    enumeration type (primary, 3 elements), size: 4 bytes
      

This command shows that the variable COLOR is an enumeration type.

#5

DBG> SHOW SYMBOL/TYPE/ADDRESS *
      

This command displays all information about all symbols.

#6

DBG> SHOW SYMBOL * IN MOD3\COUNTER
    routine MOD3\COUNTER 
    data MOD3\COUNTER\X 
    data MOD3\COUNTER\Y
DBG>
      

This command lists all the symbols that are defined in the scope denoted by the path name MOD3\COUNTER.

#7

DBG> DEFINE/COMMAND SB=SET BREAK
DBG> SHOW SYMBOL/DEFINED SB
defined SB
    bound to: SET BREAK
    was defined /command
DBG>
      

In this example, the DEFINE/COMMAND command defines SB as a symbol for the SET BREAK command. The SHOW SYMBOL/DEFINED command displays that definition.


SHOW TASK|THREAD

Displays information about the tasks of a multithread program (also called a tasking program).

Format

SHOW THREAD [task-spec[,...]]


Parameters

task-spec

Specifies a task value. Use any of the following forms:

Do not use the asterisk (*) wildcard character. Instead, use the /ALL qualifier. Do not specify a task with /ALL, /STATISTICS, or /TIME_SLICE.


Qualifiers

/ALL

Selects all existing tasks for display---namely, tasks that have been created and (in the case of Ada tasks) whose master has not yet terminated.

/CALLS[=n]

Does a SHOW CALLS command for each task selected for display. This identifies the currently active routine calls (the call stack) for a task.

/FULL

When the event facility is THREADS, use the command.

Displays additional information for each task selected for display. The additional information is provided if you use /FULL by itself or with /CALLS or /STATISTICS.

/HOLD

/NOHOLD (default)

When the event facility is THREADS, use the PTHREAD tset -n thread-number command.

Selects either tasks that are on hold, or tasks that are not on hold for display.

If you do not specify a task, /HOLD selects all tasks that are on hold. If you specify a task list, /HOLD selects the tasks in the task list that are on hold.

If you do not specify a task, /NOHOLD selects all tasks that are not on hold. If you specify a task list, /NOHOLD selects the tasks in the task list that are not on hold.

/IMAGE

Displays the image name for each active call on the call stack. Valid only with the /CALLS qualifier.

/PRIORITY=(n[,...])

When the event facility is THREADS, use the PTHREAD tset -s thread-number command.

If you do not specify a task, selects all tasks having any of the specified priorities, n, where n is a decimal integer from 0 to 15. If you specify a task list, selects the tasks in the task list that have any of the priorities specified.

/STATE=(state[,...])

If you do not specify a task, selects all tasks that are in any of the specified states---RUNNING, READY, SUSPENDED, or TERMINATED. If you specify a task list, selects the tasks in the task list that are in any of the states specified.

/STATISTICS

(Compaq Ada on VAX only) Displays task statistics for the entire tasking system. This information enables you to measure the performance of your tasking program. The larger the number of total schedulings (also known as context switches), the more tasking overhead there is.

/TIME_SLICE

(VAX only) Displays the current time-slice value, in seconds, as specified by a previous SET TASK/TIME_SLICE command. If no SET TASK/TIME_SLICE command was previously entered, displays the time-slice value, if any, that was specified in the program. If no time-slice value was previously established, the value is 0.0---that is, time slicing is disabled.

/TIME_SLICE is valid only when the event facility is ADA.


Description

A task can first appear in a SHOW THREAD display as soon as it is created. A task can no longer appear in a SHOW THREAD display if it is terminated or (in the case of an Ada tasking program) if its master is terminated. By default, the SHOW THREAD command displays one line of information for each task selected.

When you specify the /IMAGE qualifier, the debugger first does a SET IMAGE command for each image that has debug information (that is, it was linked using the /DEBUG or /TRACEBACK qualifier). The debugger then displays the image name for each active call on the calls stack. The output display has been expanded and displays the image name in the first column.

The debugger suppresses the share$image_name module name, because that information is provided by the /IMAGE qualifier.

The SET IMAGE command lasts only for the duration of the SHOW THREAD/CALLS/IMAGE command. The debugger restores the set image state when the SHOW THREAD/CALLS/IMAGE command is complete.

Related commands:

DEPOSIT/TASK
EXAMINE/TASK
(SET, SHOW) EVENT_FACILITY
SET TASK|THREAD

Examples

#1

DBG> SHOW EVENT_FACILITY
event facility is ADA
 
    ...
DBG> SHOW TASK/ALL
  task id   pri hold state   substate        task object 
* %TASK 1    7       RUN                   122624 
  %TASK 2    7  HOLD SUSP  Accept          H4.MONITOR 
  %TASK 3    6       READY Entry call      H4.CHECK_IN
DBG>
      

In this example, the SHOW EVENT_FACILITY command identifies ADA as the current event facility. The SHOW TASK/ALL command provides basic information about all the tasks that were created through Ada services and currently exist. One line is devoted to each task. The active task is marked with an asterisk (*). In this example, it is also the active task (the task that is in the RUN state).

#2

DBG> SHOW TASK %ACTIVE_TASK,3,MONITOR
      

This command selects the active task, 3, and task MONITOR for display.

#3

DBG> SHOW TASK/PRIORITY=6
      

This command selects all tasks with priority 6 for display.

#4

DBG> SHOW TASK/STATE=(RUN,SUSP)
      

This command selects all tasks that are either running or suspended for display.

#5

DBG> SHOW TASK/STATE=SUSP/NOHOLD
      

This command selects all tasks that are both suspended and not on hold for display.

#6

DBG> SHOW TASK/STATE=(RUN,SUSP)/PRIO=7 %VISIBLE_TASK, 3
      

This command selects for display those tasks among the visible task and %TASK 3 that are in either the RUNNING or SUSPENDED state and have priority 7.


Previous Next Contents Index